Пример #1
0
        /// <summary>
        /// Adds Firebase Set request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueSet(Firebase firebase, object val, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnSetSuccess += OnSuccess;
            temp.OnSetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Set, param, val);
        }
Пример #2
0
        /// <summary>
        /// Adds Firebase Delete request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueDelete(Firebase firebase, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnDeleteSuccess += OnSuccess;
            temp.OnDeleteFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Delete, param);
        }
Пример #3
0
        /// <summary>
        /// Adds Firebase Push request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueuePush(Firebase firebase, object val, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnPushSuccess += OnSuccess;
            temp.OnPushFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Push, param, Json.Serialize(val));
        }
Пример #4
0
        /// <summary>
        /// Adds Firebase Get request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueGet(Firebase firebase, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnGetSuccess += OnSuccess;
            temp.OnGetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Get, param);
        }
Пример #5
0
        /// <summary>
        /// Adds Firebase Get request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueGet(Firebase firebase, FirebaseParam param)
        {
            Firebase temp = firebase.Copy(true);

            temp.OnGetSuccess += OnSuccess;
            temp.OnGetFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Get, param.Parameter);
        }
        /// <summary>
        /// Adds Firebase Delete request to queue.
        /// </summary>
        /// <param name="firebase">Firebase.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueDelete(Firebase firebase, FirebaseParam param)
        {
            Firebase temp = firebase.Copy(true);

            temp.OnDeleteSuccess += OnSuccess;
            temp.OnDeleteFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Delete, param.Parameter);
        }
        /// <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(Firebase firebase, object val, FirebaseParam param)
        {
            Firebase temp = firebase.Copy(true);

            temp.OnPushSuccess += OnSuccess;
            temp.OnPushFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Push, param.Parameter, val);
        }
        /// <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(Firebase firebase, object val, FirebaseParam param)
        {
            Firebase temp = firebase.Copy(true);

            temp.OnUpdateSuccess += OnSuccess;
            temp.OnUpdateFailed  += OnFailed;
            AddQueue(temp, FirebaseCommand.Update, param.Parameter, val);
        }
Пример #9
0
        /// <summary>
        /// Adds Firebase Push request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="val">Value.</param>
        /// <param name="isJson">True if string is an object parsed in a json string.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueuePush(Firebase firebase, string val, bool isJson, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnPushSuccess += OnSuccess;
            temp.OnPushFailed  += OnFailed;

            AddQueue(temp, FirebaseCommand.Push, param, val, isJson);
        }
Пример #10
0
        /// <summary>
        /// Adds Firebase Update request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="valJson">Value in json format.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueUpdate(Firebase firebase, string valJson, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnUpdateSuccess += OnSuccess;
            temp.OnUpdateFailed  += OnFailed;

            AddQueue(temp, FirebaseCommand.Update, param, valJson, false); // Update value is strictly json.
        }
Пример #11
0
        /// <summary>
        /// Adds Firebase Update request to queue.
        /// </summary>
        /// <param name="firebase">Firebase node.</param>
        /// <param name="val">Value.</param>
        /// <param name="param">Parameter.</param>
        public void AddQueueUpdate(Firebase firebase, Dictionary <string, object> val, string param = "")
        {
            Firebase temp = firebase.Copy(true);

            temp.OnSetSuccess += OnSuccess;
            temp.OnSetFailed  += OnFailed;

            AddQueue(firebase, FirebaseCommand.Update, param, val);
        }
Пример #12
0
 /// <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 FirebaseObserver(Firebase _firebase, float _refreshRate, FirebaseParam _getParam)
 {
     active       = false;
     lastSnapshot = null;
     firebase     = _firebase;
     refreshRate  = _refreshRate;
     getParam     = _getParam.Parameter;
     target       = _firebase.Copy();
 }
Пример #13
0
 /// <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 FirebaseObserver(Firebase _firebase, float _refreshRate, string _getParam = "")
 {
     active       = false;
     lastSnapshot = null;
     firebase     = _firebase;
     refreshRate  = _refreshRate;
     getParam     = _getParam;
     target       = _firebase.Copy();
     routine      = null;
 }
        /// <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(Firebase firebase, string json, bool isJson, FirebaseParam param)
        {
            Firebase 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));
            }
        }
        /// <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(Firebase firebase, string json, bool isJson, string param = "")
        {
            Firebase 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));
            }
        }