Ejemplo n.º 1
0
        private void ListenRequest(RequestModel req)
        {
            state = "L";

            Action <Dictionary <string, RequestModel> > onValueEvent = (Dictionary <string, RequestModel> request) =>
            {
                try
                {
                    System.Diagnostics.Debug.WriteLine("---> EVENT Get Request Data FromFirebase ");

                    Action onSetValueSuccess = () =>
                    {
                    };

                    Action <string> onSetValueError = (string errorDesc) =>
                    {
                    };

                    if (request != null)
                    {
                        foreach (KeyValuePair <string, RequestModel> item in request)
                        {
                            if (item.Key == req.Driver.Key)
                            {
                                SetRequest(item.Value);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    System.Diagnostics.Debug.WriteLine("---> error Get Request Data FromFirebase " + ex.Message);
                    throw;
                }
            };

            _firebaseDatabase.GetRequests("requests", onValueEvent);
        }