6
6
using System . IO . IsolatedStorage ;
7
7
using System . Linq ;
8
8
using System . Reflection ;
9
- using System . Text ;
10
9
using System . Text . RegularExpressions ;
11
10
using Exceptionless . Dependency ;
12
- using Exceptionless . Extensions ;
13
- using Exceptionless . Models ;
14
- using Exceptionless . Storage ;
15
11
using Exceptionless . Utility ;
16
12
17
13
namespace Exceptionless . Storage {
18
14
public class IsolatedStorageObjectStorage : IObjectStorage {
19
15
private readonly object _lockObject = new object ( ) ;
20
16
private readonly IDependencyResolver _resolver ;
21
- private static readonly Encoding _encodingUTF8NoBOM = new UTF8Encoding ( false , true ) ;
22
17
23
18
public IsolatedStorageObjectStorage ( IDependencyResolver resolver ) {
24
19
_resolver = resolver ;
@@ -40,7 +35,7 @@ public IEnumerable<string> GetObjects(string searchPattern = null, int? limit =
40
35
stack . Push ( initialDirectory ) ;
41
36
Regex searchPatternRegex = null ;
42
37
if ( ! String . IsNullOrEmpty ( searchPattern ) )
43
- searchPatternRegex = new Regex ( "^" + Regex . Escape ( searchPattern ) . Replace ( Path . DirectorySeparatorChar + "*" , ".*?" ) . Replace ( Path . AltDirectorySeparatorChar + "*" , ".*?" ) + " $") ;
38
+ searchPatternRegex = new Regex ( $ "^ { Regex . Escape ( searchPattern ) . Replace ( Path . DirectorySeparatorChar + "*" , ".*?" ) . Replace ( Path . AltDirectorySeparatorChar + "*" , ".*?" ) } $") ;
44
39
45
40
while ( stack . Count > 0 ) {
46
41
string dir = stack . Pop ( ) ;
@@ -112,7 +107,7 @@ public T GetObject<T>(string path) where T : class {
112
107
} ) ;
113
108
114
109
if ( buffer == null || buffer . Length == 0 )
115
- return default ( T ) ;
110
+ return default ;
116
111
return _resolver . GetStorageSerializer ( ) . Deserialize < T > ( new MemoryStream ( buffer ) ) ;
117
112
} catch ( Exception ex ) {
118
113
_resolver . GetLog ( ) . Error ( ex . Message , exception : ex ) ;
0 commit comments