예제 #1
0
        public static void InitApp(string applicationId, string secretKey, string version)
        {
            if (string.IsNullOrEmpty(applicationId))
            {
                throw new ArgumentNullException(ExceptionMessage.NULL_APPLICATION_ID);
            }

            if (string.IsNullOrEmpty(secretKey))
            {
                throw new ArgumentNullException(ExceptionMessage.NULL_SECRET_KEY);
            }

            if (string.IsNullOrEmpty(version))
            {
                throw new ArgumentNullException(ExceptionMessage.NULL_VERSION);
            }

            AppId      = applicationId;
            SecretKey  = secretKey;
            VersionNum = version;

            Persistence = new PersistenceService();
            Data        = Persistence;
            Geo         = new BackendlessAPI.Service.GeoService();
            Messaging   = new BackendlessAPI.Service.MessagingService();
            Files       = new BackendlessAPI.Service.FileService();
            UserService = new BackendlessAPI.Service.UserService();
            Events      = BackendlessAPI.Events.GetInstance();
            Cache       = BackendlessAPI.Caching.Cache.GetInstance();
            Counters    = BackendlessAPI.Counters.CounterService.GetInstance();
            Logging     = new BackendlessAPI.Logging.LoggingService();

            HeadersManager.CleanHeaders();
        }
예제 #2
0
        public static void InitApp(string applicationId, string secretKey, string version)
        {
            if (string.IsNullOrEmpty(applicationId))
            throw new ArgumentNullException(ExceptionMessage.NULL_APPLICATION_ID);

              if (string.IsNullOrEmpty(secretKey))
            throw new ArgumentNullException(ExceptionMessage.NULL_SECRET_KEY);

              if (string.IsNullOrEmpty(version))
            throw new ArgumentNullException(ExceptionMessage.NULL_VERSION);

              AppId = applicationId;
              SecretKey = secretKey;
              VersionNum = version;

              Persistence = new PersistenceService();
              Data = Persistence;
              Geo = new BackendlessAPI.Service.GeoService();
              Messaging = new BackendlessAPI.Service.MessagingService();
              Files = new BackendlessAPI.Service.FileService();
              UserService = new BackendlessAPI.Service.UserService();
              Events = BackendlessAPI.Events.GetInstance();
              Cache = BackendlessAPI.Caching.Cache.GetInstance();
              Counters = BackendlessAPI.Counters.CounterService.GetInstance();
              Logging = new BackendlessAPI.Logging.LoggingService();

              HeadersManager.CleanHeaders();
        }