Пример #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 bool CompareAndSet(Int64 expected, Int64 updated)
 {
     return(CounterService.GetInstance().CompareAndSet(counterName, expected, updated));
 }
Пример #3
0
 public void GetAndAdd(Int64 value, Async.AsyncCallback <T> callback)
 {
     CounterService.GetInstance().GetAndAdd(counterName, value, callback);
 }
Пример #4
0
 public T GetAndAdd(Int64 value)
 {
     return(CounterService.GetInstance().GetAndAdd <T>(counterName, value));
 }
Пример #5
0
 public T AddAndGet(Int64 value)
 {
     return(CounterService.GetInstance().AddAndGet <T>(counterName, value));
 }
Пример #6
0
 public void DecrementAndGet(Async.AsyncCallback <T> callback)
 {
     CounterService.GetInstance().DecrementAndGet(counterName, callback);
 }
Пример #7
0
 public T DecrementAndGet()
 {
     return(CounterService.GetInstance().DecrementAndGet <T>(counterName));
 }
Пример #8
0
 public T GetAndDecrement()
 {
     return(CounterService.GetInstance().GetAndDecrement <T>(counterName));
 }
Пример #9
0
 public T Get()
 {
     return(CounterService.GetInstance().Get <T>(counterName));
 }
Пример #10
0
 public void Reset(AsyncCallback <Object> callback)
 {
     CounterService.GetInstance().Reset(counterName, callback);
 }
Пример #11
0
 public void Reset()
 {
     CounterService.GetInstance().Reset(counterName);
 }
Пример #12
0
 public void CompareAndSet(Int64 expected, Int64 updated, Async.AsyncCallback <bool> callback)
 {
     CounterService.GetInstance().CompareAndSet(counterName, expected, updated, callback);
 }
Пример #13
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();
        }