示例#1
0
文件: DAL.cs 项目: Fedorm/core-master
        public DAL(IsolatedStorageOfflineContext context
                   , String appName
                   , String language
                   , String userName
                   , String userPassword
                   , String configName
                   , String configVersion
                   , IDictionary <string, string> deviceInfo
                   , ProgressDelegate p
                   , Func <Uri, CacheControllerBehavior, AsyncWorkerManager, CacheRequestHandler> chacheRequestFactory)
        {
            this.appName       = appName;
            this.language      = language;
            this.configName    = configName;
            this.configVersion = configVersion;
            this.onProgress    = p;

            this.context = context;
            this.context.LoadCompleted += context_LoadCompleted;
            this.context.CacheController.SetCacheRequestFactory(chacheRequestFactory);
            this.context.CacheController.RefreshCompleted += CacheController_RefreshCompleted;
            this.context.CacheController.ControllerBehavior.Credentials          = new System.Net.NetworkCredential(userName, userPassword);
            this.context.CacheController.ControllerBehavior.ConfigName           = this.configName;
            this.context.CacheController.ControllerBehavior.ConfigVersion        = this.configVersion;
            this.context.CacheController.ControllerBehavior.CoreVersion          = CoreInformation.CoreVersion;
            this.context.CacheController.ControllerBehavior.ReadProgressCallback = ReadProgressCallback;
            this.context.CacheController.ControllerBehavior.DeviceInfo           = deviceInfo;

            //this.context.CacheController.ControllerBehavior.AddScopeParameters("Outlet","{A507956F-D135-4E8A-BD7F-14B54AC1E95C}");
        }
示例#2
0
        public SQLiteCacheData(IsolatedStorageSchema schema, IsolatedStorageOfflineContext context)
        {
//            Collections = new Dictionary<EntityType, IsolatedStorageCollection>();
            SyncConflicts = new List <SyncConflict>();
            SyncErrors    = new List <SyncError>();

            CreateCollections(schema, context);
        }
示例#3
0
        private void CreateCollections(IsolatedStorageSchema schema, IsolatedStorageOfflineContext context)
        {
//            Type collectionType = typeof(IsolatedStorageCollection<>);
//            foreach (EntityType t in schema.Collections)
//            {
//                // CreateInstance the generic type for the type in the collection.
//                Type generic = collectionType.MakeGenericType(t);
//                IsolatedStorageCollection collection = (IsolatedStorageCollection)Activator.CreateInstance(generic, context);
//                Collections[t] = collection;
//            }
        }
示例#4
0
        public SQLiteStorageHandler(IsolatedStorageOfflineContext ctx, IsolatedStorageSchema schema, string cachePath, SymmetricAlgorithm encryptionAlgorithm)
        {
            _context             = ctx;
            _schema              = schema;
            _cachePath           = cachePath;
            _encryptionAlgorithm = encryptionAlgorithm;
            _anchor              = null;

            _knownTypes = new List <EntityType>
            {
//                new EntityType(typeof (SyncConflict)),
//                new EntityType(typeof (SyncError))
            };

            AddKnownTypes();
        }
示例#5
0
 public SQLiteCacheData Load(IsolatedStorageOfflineContext context)
 {
     return(new SQLiteCacheData(_schema, context));
 }
示例#6
0
 public void AddUploadChanges(byte[] anchor, IEnumerable <Conflict> conflicts, IEnumerable <IsolatedStorageOfflineEntity> updatedItems, IsolatedStorageOfflineContext context)
 {
 }
示例#7
0
 private void ClearSyncConflict(SyncConflict syncConflict, IsolatedStorageOfflineContext context)
 {
 }
示例#8
0
 public void AddSerializedError(SyncError error, IsolatedStorageOfflineContext context)
 {
 }
示例#9
0
 public void AddErrors(IEnumerable <SyncError> errors, IsolatedStorageOfflineContext context)
 {
 }
示例#10
0
 public void AddSerializedConflict(SyncConflict conflict, IsolatedStorageOfflineContext context)
 {
 }
示例#11
0
 public void AddConflicts(IEnumerable <SyncConflict> conflicts, IsolatedStorageOfflineContext context)
 {
 }
示例#12
0
 public ProxyCollection(IEnumerable <T> source, IsolatedStorageOfflineContext context)
 {
     _collection = source;
     _context    = context;
 }