Beispiel #1
0
        /// <summary>
        /// Adds Firebase Delete request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueDelete(SimpleFirebase firebase, SimpleFirebaseParam param)
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnDeleteSuccess += OnSuccess;
            temp.OnDeleteFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Delete, param.Parameter);
        }
Beispiel #2
0
        /// <summary>
        /// Adds Firebase Push request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueuePush(SimpleFirebase firebase, object val, SimpleFirebaseParam param)
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnPushSuccess += OnSuccess;
            temp.OnPushFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Push, param.Parameter, val);
        }
Beispiel #3
0
        /// <summary>
        /// Adds Firebase Update request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueUpdate(SimpleFirebase firebase, object val, SimpleFirebaseParam param)
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnUpdateSuccess += OnSuccess;
            temp.OnUpdateFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Update, param.Parameter, val);
        }
Beispiel #4
0
        /// <summary>
        /// Adds Firebase Set request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueSet(SimpleFirebase firebase, object val, string param = "")
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnSetSuccess += OnSuccess;
            temp.OnSetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Set, param, val);
        }
Beispiel #5
0
        /// <summary>
        /// Adds Firebase Get request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueGet(SimpleFirebase firebase, SimpleFirebaseParam param)
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnGetSuccess += OnSuccess;
            temp.OnGetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Get, param.Parameter);
        }
Beispiel #6
0
        /// <summary>
        /// Adds Firebase Get request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueGet(SimpleFirebase firebase, string param = "")
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnGetSuccess += OnSuccess;
            temp.OnGetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Get, param);
        }
 /// <summary>
 /// Creates an Observer that calls GetValue request at the given refresh rate (in seconds) and checks whether the value has changed.
 /// </summary>
 /// <param name="firebase">Firebase.</param>
 /// <param name="refreshRate">Refresh rate (in seconds).</param>
 /// <param name="getParam">Parameter value for the Get request that will be called periodically.</param>
 public SimpleFirebaseObserver(SimpleFirebase _firebase, float _refreshRate, SimpleFirebaseParam _getParam)
 {
     active       = false;
     lastSnapshot = null;
     firebase     = _firebase;
     refreshRate  = _refreshRate;
     getParam     = _getParam.Parameter;
     target       = _firebase.Copy();
 }
 /// <summary>
 /// Creates an Observer that calls GetValue request at the given refresh rate (in seconds) and checks whether the value has changed.
 /// </summary>
 /// <param name="firebase">Firebase.</param>
 /// <param name="refreshRate">Refresh rate (in seconds).</param>
 /// <param name="getParam">Parameter value for the Get request that will be called periodically.</param>
 public SimpleFirebaseObserver(SimpleFirebase _firebase, float _refreshRate, string _getParam = "")
 {
     active       = false;
     lastSnapshot = null;
     firebase     = _firebase;
     refreshRate  = _refreshRate;
     getParam     = _getParam;
     target       = _firebase.Copy();
     routine      = null;
 }
Beispiel #9
0
        /// <summary>
        /// Adds Firebase Push request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="json">Json.</param>
        /// <param name="isJson">If set to <c>true</c> is json.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueuePush(SimpleFirebase firebase, string json, bool isJson, SimpleFirebaseParam param)
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnPushSuccess += OnSuccess;
            temp.OnPushFailed  += OnFailed;
            if (!isJson)
            {
                AddQueue(temp, FirebaseCommand.Push, param.Parameter, json);
            }
            else
            {
                AddQueue(temp, FirebaseCommand.Push, param.Parameter, Json.Deserialize(json));
            }
        }
Beispiel #10
0
        /// <summary>
        /// Adds Firebase Update request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="json">Json.</param>
        /// <param name="isJson">If set to <c>true</c> is json.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueUpdate(SimpleFirebase firebase, string json, bool isJson, string param = "")
        {
            SimpleFirebase temp = firebase.Copy(true);

            temp.OnUpdateSuccess += OnSuccess;
            temp.OnUpdateFailed  += OnFailed;
            if (!isJson)
            {
                AddQueue(temp, FirebaseCommand.Update, param, json);
            }
            else
            {
                AddQueue(temp, FirebaseCommand.Update, param, Json.Deserialize(json));
            }
        }