Beispiel #1
0
 public static TService Service <TService>() where TService : class
 {
     if (typeof(TService) == typeof(ISessionManager))
     {
         return(Instance._sessionManager as TService);
     }
     if (typeof(TService) == typeof(IDataManager))
     {
         return(Instance._dataManager as TService);
     }
     return(DefaultServiceProvider.GetDefaultProvider <TService>(typeof(StoreKeeperServer)));
 }
Beispiel #2
0
        public static T Service <T>() where T : class
        {
            if (typeof(T) == typeof(IResourceProvider))
            {
                return(Instance as T);
            }

            if (typeof(T) == typeof(ILocalizationProvider))
            {
                return(Instance._localizationProvider as T);
            }
            T service = Instance.GetService <T>();

            return(service ?? DefaultServiceProvider.GetDefaultProvider <T>(typeof(ResourceLibrary)));
        }
        public static TService Service <TService>() where TService : class
        {
            TService service = Instance.GetService <TService>();

            return(service ?? DefaultServiceProvider.GetDefaultProvider <TService>(Instance.GetType()));
        }