Ejemplo n.º 1
0
 public void _003CInitSyncCenter_003Eb__1c()
 {
     try
     {
         SyncCenter syncCenter = new SyncCenter();
         syncCenter.bookManager = new BookManager(dbPath);
         int bookPath = _003C_003E4__this.getBookPath(dbPath, bookId, account, meetingId);
         Dictionary <string, object> dictionary = new Dictionary <string, object>();
         dictionary.Add("SBookmark", new BookMarkData());
         dictionary.Add("SAnnotation", new NoteData());
         dictionary.Add("SSpline", new StrokesData());
         dictionary.Add("SLastPage", new LastPageData());
         Dictionary <string, object> dictionary2 = dictionary;
         foreach (KeyValuePair <string, object> item in dictionary2)
         {
             string key                      = item.Key;
             Type   typeFromHandle           = typeof(SyncManager <>);
             Type   type                     = typeFromHandle.MakeGenericType(item.Value.GetType());
             AbstractSyncManager syncManager = (AbstractSyncManager)Activator.CreateInstance(type, account, "free", bookId, bookPath, key, 0, "0", WsTool.GetAbstractSyncCenter_BASE_URL());
             syncCenter.addSyncConditions(key, syncManager);
         }
     }
     catch (Exception ex)
     {
         LogTool.Debug(ex);
     }
 }
Ejemplo n.º 2
0
        public void InitSyncCenter(string dbPath, string bookId, string account, string meetingId)
        {
            if (PaperLess_Emeeting.Properties.Settings.Default.HasSyncCenterModule == true)
            {
                Task.Factory.StartNew(() =>
                {
                    try
                    {
                        SyncCenter syncCenter  = new SyncCenter();
                        syncCenter.bookManager = new BookManager(dbPath);
                        int userBookSno        = getBookPath(dbPath, bookId, account, meetingId);
                        Dictionary <String, Object> cloudSyncingClsList = new Dictionary <String, Object>()
                        {
                            { "SBookmark", new BookMarkData() }, { "SAnnotation", new NoteData() }, { "SSpline", new StrokesData() }, { "SLastPage", new LastPageData() }
                        };

                        foreach (KeyValuePair <String, Object> syncType in cloudSyncingClsList)
                        {
                            string className = syncType.Key;
                            Type openType    = typeof(SyncManager <>);
                            Type actualType  = openType.MakeGenericType(new Type[] { syncType.Value.GetType() });

                            //AbstractSyncManager sm = (AbstractSyncManager)Activator.CreateInstance(actualType, account, meetingId, bookId, userBookSno, className, 0, "0", WsTool.GetAbstractSyncCenter_BASE_URL());
                            AbstractSyncManager sm = (AbstractSyncManager)Activator.CreateInstance(actualType, account, "free", bookId, userBookSno, className, 0, "0", WsTool.GetAbstractSyncCenter_BASE_URL());
                            syncCenter.addSyncConditions(className, sm);
                        }
                    }
                    catch (Exception ex)
                    {
                        LogTool.Debug(ex);
                    }
                });
            }
        }
Ejemplo n.º 3
0
 void Awake()
 {
     center = SyncCenter.getInstance();
 }
Ejemplo n.º 4
0
        private IEnumerator ProcessSync(SyncEvent evt)
        {
            yield return(new WaitForEndOfFrame());

            SyncCenter.ApplySync(evt.ServiceType, evt.SyncData);
        }
Ejemplo n.º 5
0
 public void SyncMyDataToClient(SceneSyncData syncData)
 {
     SyncCenter.ApplySync(syncData);
 }