상속: Microsoft.Synchronization.ClientServices.IsolatedStorage.IsolatedStorageOfflineContext
예제 #1
0
파일: ModelList.cs 프로젝트: rafek/SyncFx
        /// <summary>
        /// Construct which takes the underlying list and its associated context.
        /// </summary>
        /// <param name="list"></param>
        /// <param name="context"></param>
        public ModelList(DefaultScope.List list, ListSampleOfflineContext context)
        {
            this.list = list;
            this.context = context;
            items = null;

            // Register for the property changed event
            list.PropertyChanged += new PropertyChangedEventHandler(list_PropertyChanged);
        }
예제 #2
0
        /// <summary>
        /// Creates and initializes the context
        /// </summary>
        /// <param name="cachePath"></param>
        /// <param name="uri"></param>
        private void CreateContext(string cachePath, Uri uri)
        {
            context = new ListSampleOfflineContext(cachePath, uri);

            // Need to specify the filter paramters.
            context.CacheController.ControllerBehavior.AddScopeParameters("userid", UserID.ToString("D"));

            context.LoadCompleted += new EventHandler<LoadCompletedEventArgs>(ContextLoadCompleted);
            context.CacheController.RefreshCompleted += new EventHandler<RefreshCompletedEventArgs>(CacheController_RefreshCompleted);
        }