public void DoCommand()
            {
                switch (command)
                {
                case FirebaseCommand.Get:
                    firebase.GetValue(param);
                    break;

                case FirebaseCommand.Set:
                    firebase.SetValue(obj, param);
                    break;

                case FirebaseCommand.Update:
                    firebase.UpdateValue(obj, param);
                    break;

                case FirebaseCommand.Push:
                    firebase.Push(obj, param);
                    break;

                case FirebaseCommand.Delete:
                    firebase.Delete(param);
                    break;
                }
            }
Beispiel #2
0
            public void DoCommand()
            {
                switch (command)
                {
                case FirebaseCommand.Get:
                    firebase.GetValue(param);
                    break;

                case FirebaseCommand.Set:
                    if (valObj != null)
                    {
                        firebase.SetValue(valObj, param);
                    }
                    else
                    {
                        firebase.SetValue(valStr, isJson, param);
                    }
                    break;

                case FirebaseCommand.Update:
                    if (valObj != null)
                    {
                        firebase.UpdateValueObject(valObj, param);
                    }
                    else
                    {
                        firebase.UpdateValue(valStr, param);
                    }
                    break;

                case FirebaseCommand.Push:
                    if (valObj != null)
                    {
                        firebase.Push(valObj, param);
                    }
                    else
                    {
                        firebase.Push(valStr, isJson, param);
                    }
                    break;

                case FirebaseCommand.Delete:
                    firebase.Delete(param);
                    break;
                }
            }
        /// <summary>
        /// Sets the time stamp with the time since UNIX epoch by server value (in milliseconds).
        /// </summary>
        /// <param name="keyName">Key name.</param>
        /// <param name="OnSuccess">On success callback.</param>
        /// <param name="OnFailed">On fail callback.</param>
        public void SetTimeStamp(string keyName, Action <Firebase, DataSnapshot> OnSuccess, Action <Firebase, FirebaseError> OnFailed)
        {
            Firebase temp = Child(keyName);

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

            temp.SetValue(SERVER_VALUE_TIMESTAMP, true);
        }