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