Esempio n. 1
0
 /// <summary>
 /// Method is used for geting instace of localContextSingelton.
 /// </summary>
 /// <typeparam name="RootType">Type that will be used for initialization of Context</typeparam>
 /// <param name="newStorage">This object will be used for new storage if LocalContextSingleton
 /// is not yet initialized</param>
 /// <returns></returns>
 public static LocalContextSingleton GetInstance <RootType>(IKeyValueStorage <Guid, object> newStorage)
 {
     lock (locker)
     {
         if (instance == null)
         {
             instance = new LocalContextSingleton(typeof(RootType), newStorage);
         }
     }
     return(instance);
 }
Esempio n. 2
0
 /// <summary>
 /// Method is used for geting instace of localContextSingelton.
 /// </summary>
 /// <typeparam name="RootType">Type that will be used for initialization of Context</typeparam>
 /// <returns></returns>
 public static LocalContextSingleton GetInstance <RootType>()
 {
     lock (locker)
     {
         if (instance == null)
         {
             instance = new LocalContextSingleton(typeof(RootType));
         }
     }
     return(instance);
 }
Esempio n. 3
0
 /// <summary>
 /// Creates new instance of ServerContext type with specified KeyValueStorage
 /// </summary>
 public IOGServerContext(IKeyValueStorage <Guid, object> newStorage)
 {
     localContext = LocalContextSingleton.GetInstance <RootType>(newStorage);
 }
Esempio n. 4
0
 /// <summary>
 /// Creates new instance of ServerContext type
 /// </summary>
 public IOGServerContext()
 {
     localContext = LocalContextSingleton.GetInstance <RootType>();
 }