예제 #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);
 }
예제 #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);
 }
예제 #3
0
파일: IOGServer.cs 프로젝트: nemanjazz/iog
 /// <summary>
 /// Creates new instance of ServerContext type with specified KeyValueStorage
 /// </summary>
 public IOGServerContext(IKeyValueStorage <Guid, object> newStorage)
 {
     localContext = LocalContextSingleton.GetInstance <RootType>(newStorage);
 }
예제 #4
0
파일: IOGServer.cs 프로젝트: nemanjazz/iog
 /// <summary>
 /// Creates new instance of ServerContext type
 /// </summary>
 public IOGServerContext()
 {
     localContext = LocalContextSingleton.GetInstance <RootType>();
 }