示例#1
0
文件: Class2.cs 项目: mlatjac/synched
 public static SynchedDB GetInstance()
 {
     if (DBUniqueInstance == null)
     {
         DBUniqueInstance = new SynchedDB();
     }
     return(DBUniqueInstance);
 }
示例#2
0
文件: Class2.cs 项目: mlatjac/synched
        private SynchedModel(FlowDocument fdDoc, String strUser)
        {
            ModelDB = SynchedDB.GetInstance();
            Doc     = fdDoc;

            // Get a user object for the current user
            currentUser = ModelDB.GetUserByKey(strUser);

            if (currentUser == null)
            {
                throw new Exception("No user found for user key " + strUser);
            }

            // Create an object for the current document
            SDCurrentDoc = new SynchedDocument {
                Id = 1, Owner = currentUser
            };                                                                  // FIXME Document ID is hardcoded
        }