示例#1
0
        public static T GetInstance()
        {
            if (!SingletonEx.IsInitialized <T>())
            {
                throw new NullReferenceException($"Singleton<{typeof(T).Name}>.GetInstance() failed. The requested type singleton is not initialized and for that reason it's instance is null.");
            }

            return(Instance);
        }
示例#2
0
 static CoreConfig()
 {
     dependencies = new System.Collections.Generic.List <Func <bool> > {
         () => SingletonEx.IsInitialized <DirectoryConfig>()
     };
 }