public async void TestFixtureSetUp() { IFirebaseConfig config = new FirebaseConfig { AuthSecret = FirebaseSecret, BasePath = BasePath }; _client = new FirebaseClient(config); //Uses Newtonsoft.Json Json Serializer Task<FirebaseResponse> task1 = _client.DeleteAsync("todos"); Task<FirebaseResponse> task2 = _client.DeleteAsync("fakepath"); await Task.WhenAll(task1, task2); }
public async Task BackupDocumentChat() { try { _firebaseClient = _iDbService.GetFirebaseClient(CloudConfigurationManager.GetSetting("Firebasenode")); FirebaseResponse chatResponse = _firebaseClient.Get("ChatRoom"); dynamic rooms = JsonConvert.DeserializeObject(chatResponse.Body); foreach (var room in rooms) { dynamic r = room; await Backup(r); } } catch (Exception e) { //wait and retry 5 times if (reTry > 0) { reTry--; Trace.TraceInformation("Restart BackupFirebaseChat... in 1 min " + reTry); Thread.Sleep(60000); BackupDocumentChat().Wait(); } else { Trace.TraceError("Error in BackupChat " + e.Message); } } }
async Task IEventProcessor.ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> messages) { var iDbService = new DbService(); _client = iDbService.GetFirebaseClient(); foreach (EventData eventData in messages) { string data = Encoding.UTF8.GetString(eventData.GetBytes()); FirebaseResponse response = await _client.PushAsync("event", new EHdata { offset = eventData.Offset, body = data, partitionId = context.Lease.PartitionId }); Console.WriteLine(String.Format("Message received. Partition: '{0}', Data: '{1}', Offset: '{2}'", context.Lease.PartitionId, data, eventData.Offset)); } //Call checkpoint every 5 minutes, so that worker can resume processing from the 5 minutes back if it restarts. if (this.checkpointStopWatch.Elapsed > TimeSpan.FromMinutes(5)) { Console.WriteLine(this.checkpointStopWatch.Elapsed); await context.CheckpointAsync(); this.checkpointStopWatch.Restart(); } }
private void Init() { //Get DBservice _databaseSelfLink = _databaseSelfLink ?? ConfigurationManager.AppSettings["DBSelfLink"]; _iDbService = _iDbService ?? new DbService(); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); }
public static void SetupDb() { fbConfig = new FirebaseConfig { AuthSecret = "FO85aksCBndB5fXAykNFQstlLqqYrHsiq4myZTQW", BasePath = "https://scorching-heat-9815.firebaseio.com/" }; FbClient = new FirebaseClient (fbConfig); }
public PacienteRepository(IOptions<FireOps> options) { client = new FirebaseClient(new FirebaseConfig { AuthSecret = options.Value.Secret, BasePath = options.Value.Url }); }
public ProcessMessage(DbService iDbService, QueueService iQueueService) { _documentClient = iDbService.GetDocumentClient(); _client = iDbService.GetFirebaseClient(); _documentCollection = iDbService.GetDc("LMSCollection", "LMSRegistry"); _sp = iDbService.GetSp(_documentCollection, "Post"); _queue = iQueueService.GetQueue("queue"); }
public void Setup() { IFirebaseConfig config = new FirebaseConfig { AuthSecret = FIREBASE_SECRET, BasePath = BASE_PATH }; _client = new FirebaseClient(config); //Uses RestSharp JsonSerializer as default _client.Delete("todos"); }
private void LoginForm_Load(object sender, EventArgs e) { try { client = new DataConnect().getClient(); } catch { MessageBox.Show("Connection have problem"); } }
private void InitializeComponent() { try { client = new FireSharp.FirebaseClient(ifc); } catch { Console.WriteLine("Existe un error de conexion - Contacte con el administrador XD "); } }
private void Form3_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); } catch { MessageBox.Show("Tolong cek kembali koneksi internet anda"); } }
protected void Page_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(config); } catch { Response.Write("<script>alert('No Internet or Connection Problem')</script>"); } }
private void Form1_Load(object sender, EventArgs e) { client = new FireSharp.FirebaseClient(config); if (client != null) { MessageBox.Show("Cloud Firebase Connection is Established"); } timer1.Start(); }
public CustomerFamilyPageUI() { InitializeComponent(); BindingContext = new CustomerFamilyPageVM(Navigation); client = new FireSharp.FirebaseClient(iconfig.config); getgiadinh(CMND_); getAddressResident(); CLICKNAVIGATEPAGEADDADDRESS.Text = KeyCustomerViewEnumeration.CustomerFamilyPlaceholder_Current; this.handelAction(); }
public Form4() { InitializeComponent(); client = new FireSharp.FirebaseClient(config); if (client != null) { MessageBox.Show("Conexión Establecida con Servidor B"); } comboBox1.SelectedItem = "5"; }
internal static bool Connect() { client = new FireSharp.FirebaseClient(config); if (client != null) { return(true); } else { return(false); } }
public void Init() { try { client = new FireSharp.FirebaseClient(fcon); } catch (Exception ex) { Console.Write("Problem COnnection to the Firebase"); System.Diagnostics.Debug.WriteLine(ex.Message); } }
/** * Metoda odpowiedzialna za utworzenie obiektu klienta gdy * formularz LoginForm się załaduje */ private void LoginForm_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); SetResponse set = client.Set("Status", "false"); } catch { MessageBox.Show("No internet or connection problem"); } }
private async void Button_Click_2(object sender, RoutedEventArgs e) { if (pOrderID.Text.Length > 0 && pSupplier.Text.Length > 0 && DateT.Text.Length > 0 && TimeT.Text.Length > 0 && endList.Items.Count > 0) { try { client = new FireSharp.FirebaseClient(config); pOrderFinal a = new pOrderFinal(); a.purchaseNumber = pOrderID.Text; a.supplierName = pSupplier.Text; a.date = DateT.Text; a.time = TimeT.Text; FirebaseResponse response2 = await client.GetAsync("Purchase/PurchaseReturn/Spinner/pending/count/"); int cnt; try { cnt = response2.ResultAs <int>(); } catch (Exception) { cnt = 0; } cnt++; FirebaseResponse firebaseResponse3 = await client.SetAsync("Purchase/PurchaseReturn/Spinner/pending/count/", cnt); FirebaseResponse firebaseResponse = await client.SetAsync("Purchase/PurchaseReturn/Spinner/pending/" + cnt, a.purchaseNumber); FirebaseResponse ab = await client.SetAsync("Purchase/PurchaseReturn/" + a.purchaseNumber + "/", a); foreach (Product1 temp in endList.Items) { client = new FireSharp.FirebaseClient(config); FirebaseResponse response = await client.SetAsync("Purchase/PurchaseReturn/" + a.purchaseNumber + "/itemLayout/" + temp.SNo + "/", temp); FirebaseResponse response1 = await client.SetAsync("Purchase/PurchaseReturn/" + a.purchaseNumber + "/itemLayout/" + temp.SNo + "/count/", temp.SNo); } MessageDialog md = new MessageDialog("Purchase Return Successfully Added!"); await md.ShowAsync(); } catch (Exception) { MessageDialog error = new MessageDialog("Failed to connect to database!"); this.Frame.Navigate(typeof(BlankPage6)); } } else { MessageDialog md = new MessageDialog("Check the inputs!"); await md.ShowAsync(); } }
public UserChatView(Guid userId) { IFirebaseConfig config = new FirebaseConfig { BasePath = "https://akkaplayground.firebaseio.com/" }; client = new FirebaseClient(config); _userId = userId; Ready(); }
public void conetar(string xml) { config.AuthSecret = "b0XxnSJaXkbSpqaI9OTw7udzNOnUCacbEXSgSBvV"; config.BasePath = "https://prueba-c-64168.firebaseio.com/"; cliente = new FireSharp.FirebaseClient(config); if (cliente != null) { MessageBox.Show("entrado"); } }
private void Form2_Load(object sender, EventArgs e) { try { client = new FirebaseClient(config); } catch { MessageBox.Show("Connection Fail"); } Load_data(); }
public WebServicesApi() { if (Client == null) { IFirebaseConfig config = new FirebaseConfig { AuthSecret = _authSecret, BasePath = _baseUrl }; Client = new FirebaseClient(config); } }
public LoginViewModel() { client = new FireSharp.FirebaseClient(this.config); NewAccount = new AccountModel(); LoginCommand = new RelayCommand(o => UserLogin(NewAccount)); RegisterCommand = new RelayCommand(o => OpenRegister()); CloseCommand = new RelayCommand(o => CloseAction()); MouseDownCommand = new RelayCommand(o => DragWindow()); EmailError = PasswordError = ""; FocusElement = "tbxEmail"; ButtonEnable = "True"; }
private void Form3_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); } catch { MessageBox.Show("Please check your internet connection"); } }
private void AddStudentToFirebase(Department department, string _strFile) { client = new FireSharp.FirebaseClient(config); // var data = department; var data = new Department { DepartmentName = department.DepartmentName, FromFile = _strFile }; PushResponse response = client.Push("Departments/", data); data.id = response.Result.name; SetResponse setResponse = client.Set("Departments/" + data.id, data); }
public FireBase() { client = new FireSharp.FirebaseClient(config); if (client != null) { Console.WriteLine("Succsess Firebase connection"); } else { Console.WriteLine("Not Succsess Firebase connection"); } }
private void UC_AddItems_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); } catch { MessageBox.Show("No Internet Or Connection Problem"); } loadcombobox(); }
private void PersonelForm_Load(object sender, EventArgs e) { label9.Text = Form1.doktoradi; //yukarıda oluşturduğumuz client'i config'e bağlıyoruz client = new FireSharp.FirebaseClient(config); //Bu döngüyle de veritabanımız ile bağlantı kuruluyor mu onu kontrol ediyoruz if (client != null) { DialogResult mesaj = new DialogResult(); mesaj = MessageBox.Show("Başarıyla Giriş Yapıldı!", "Veritabanı", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void Form1_Load(object sender, EventArgs e) { client = new FireSharp.FirebaseClient(config); if (client != null) { MessageBox.Show("Connection established to firebase"); } else { MessageBox.Show("Failed"); } }
private void Login_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); } catch { MessageBox.Show("No Internet or Connection Problem"); } }
private async void FormHiUser_Load(object sender, EventArgs e) { client = new FireSharp.FirebaseClient(config); var data = await client.GetTaskAsync("CONTADOR/usuarios"); if (data.Body != "null") { FirebaseResponse recuperacion = await client.GetTaskAsync("CONTADOR/usuarios"); Contador obj = recuperacion.ResultAs <Contador>(); numerousuario = obj.cantidad; userLimite = obj.userlimite; } else { var contador = new Contador { cantidad = 0, userlimite = 1 }; SetResponse response = await client.SetTaskAsync("CONTADOR/usuarios", contador); numerousuario = 0; } /* * client = new FireSharp.FirebaseClient(config); * * var datos = await client.GetTaskAsync("USUARIOS"); * if (datos.Body != "null") * { * usuarios = datos.ResultAs<Dictionary<string,Usuario>>(); * * foreach (var Usuario in usuarios) * { * userList.Add(Usuario.Value.userID); * } * numerousuario = userList.Count; * MessageBox.Show(numerousuario.ToString()); * } * * client = new FireSharp.FirebaseClient(config); * var data = await client.GetTaskAsync("USUARIOS/"); * //Dictionary<string, Usuario> usuarios = data.ResultAs<Dictionary<string, Usuario>>(); * Dictionary<string, Usuario> usuarios = data.ResultAs<Dictionary<string, Usuario>>(); * foreach (var usuario in usuarios) * { * userList.Add(usuario.Value.username); * } * * numerousuario = userList.Count; */ }
private void VenuePen_Load(object sender, EventArgs e) { try { client = new FireSharp.FirebaseClient(config); if (client != null) { this.CenterToScreen(); this.Size = Screen.PrimaryScreen.WorkingArea.Size; this.WindowState = FormWindowState.Normal; } } catch { MessageBox.Show("No Internet or Connection Problem"); } string ids = "Pending"; FirebaseResponse response = client.Get("Venue/VenueReservation/"); Dictionary <string, VenueReservation> Dick = response.ResultAs <Dictionary <string, VenueReservation> >(); foreach (var find in Dick) { string coomit = find.Value.committee_in_charge; string inc = find.Value.incharge; if (venhome.otap.Equals(coomit)) { if (inc.Equals(ids)) { dataGridView1.Update(); dataGridView1.Refresh(); dataGridView1.Rows.Add( find.Key, find.Value.name_of_project, find.Value.beneficiaries, find.Value.nature_of_project, find.Value.venue, find.Value.date_of_event, find.Value.time_from, find.Value.time_to, find.Value.approver, find.Value.committee_in_charge, find.Value.org_adviser_status, find.Value.org_dean_status, find.Value.org_president_status, find.Value.status); } } } }
private void FormBuscaEscalas_Load(object sender, EventArgs e) { Client = new FireSharp.FirebaseClient(config); dt.Columns.Add("Ref"); dt.Columns.Add("ESCALA"); dt.Columns.Add("JORNADA"); dataGridView1.DataSource = dt; export(); }
public void initFirebase(string authSecret, string basePath) { IFirebaseConfig firebaseConfig; firebaseConfig = new FirebaseConfig { AuthSecret = authSecret, BasePath = basePath, }; firebaseClient = new FireSharp.FirebaseClient(firebaseConfig); }
private void Lupapassword_loaded(object sender, RoutedEventArgs e) { try { client = new FireSharp.FirebaseClient(ifc); } catch { MessageBox.Show("Check kembali koneksi internet anda"); } }
public void Initialize(string path) { _path = path; var config = new FirebaseConfig { AuthSecret = "", BasePath = "https://vivium.firebaseio.com/" }; _client = new FirebaseClient(config); _baseUrl = $"{_baseUrl}/{path}.json"; }
static void Main() { config = new FirebaseConfig { AuthSecret = "5mEJmENtkosiLf6Dd37yjc4RKXxONSsRuiNWKRJV", BasePath = "https://foreveralone.firebaseio.com/" }; client = new FirebaseClient(config); Debug.WriteLine("Hell"); getValue(); working(); }
private void Init() { _run = true; //Get DBservice _databaseSelfLink = _databaseSelfLink ?? CloudConfigurationManager.GetSetting("DBSelfLink"); _iDbService = _iDbService ?? new DbService(); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); //check resolver state lock (Object) { if (_n <= 0) return; _n--; Task.Run(() => CheckResolver()); } }
public static void TableDemo() { CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString); CloudTableClient c = storageAccount.CreateCloudTableClient(); CloudTable table = c.GetTableReference("Chat"); table.CreateIfNotExists(); IDbService i = new DbService(); _firebaseClient = i.GetFirebaseClient(); //Search3(table); //Search2(table); //Search3(table); Insert(table).Wait(); //BackupDocumentChat(table).Wait(); }
private void Init() { _run = true; //Get DBservice _endpointUrl = _endpointUrl ?? CloudConfigurationManager.GetSetting("DocumentDBUrl"); _authorizationKey = _authorizationKey ?? CloudConfigurationManager.GetSetting("DocumentDBAuthorizationKey"); _databaseSelfLink = _databaseSelfLink ?? CloudConfigurationManager.GetSetting("DBSelfLink"); _iDbService = _iDbService ?? new DbService(_endpointUrl, _authorizationKey); //Init DB and Firebase _client = _client ?? _iDbService.GetFirebaseClient(); //check resolver state lock (_object) { if (n <= 0) return; n--; Task.Run(() => CheckResolver()); } }
private async void ListenToStream() { client = new FirebaseClient(config); await client.OnAsync("FireSharp/Name/", (sender, args) => { //Gets the Unique ID and deletes the any other string attached to it string dataFromFB = args.Data; string paths = args.Path; string key = RemoveNameSubstring(paths); string uniqueKey = key.Split('/').Last(); if (keyHolder.ContainsKey(uniqueKey)) { keyHolder[uniqueKey] = dataFromFB; AddToListView(dataFromFB); } else { keyHolder.Add(uniqueKey, dataFromFB); AddToListView(dataFromFB); } }); }
public MainWindow() { InitializeComponent(); config = new FirebaseConfig { AuthSecret = "5mEJmENtkosiLf6Dd37yjc4RKXxONSsRuiNWKRJV", BasePath = "https://foreveralone.firebaseio.com/" }; client = new FirebaseClient(config); Debug.WriteLine("Hell"); getValue(); working(); }
internal Firebase(IFirebaseClient client, Path path) { this.client = client; Path = path; }
protected override async void FinalizeSetUp() { IFirebaseConfig config = new FirebaseConfig(); _client = new FirebaseClient(config); //Uses RestSharp JsonSerializer as default await _client.DeleteAsync("todos"); }
private async void SetDataToFirebase(string text) { client = new FirebaseClient(config); Dictionary<string, string> values = new Dictionary<string, string>(); values.Add("Name", text); var response = await client.PushAsync("FireSharp/Name/", values); textBox.Text = ""; }
private async void DeleteFromFirebase(string val) { client = new FirebaseClient(config); FirebaseResponse delete = await client.DeleteAsync("FireSharp/Name/" + val); var status = delete.StatusCode; //If Firebase returns OK status, value is removed from ListView if (status.ToString() == "OK") { listView.Items.Remove(listView.SelectedItem); keyHolder.Remove(val); } }
public HomeController(IFirebaseClient client) { _client = client; }
public Interaction(string username) { //Set the username member this.username = username; //Instantiate the default config config = new FirebaseConfig { AuthSecret = "h2X1OAqY2EOs0vIsyhomap4PKS4vMjnQyv57tEJd", BasePath = "https://firesharing.firebaseio.com/" }; //Instantiate the Firebase client using the above config client = new FirebaseClient(config); //Define the base url for the user user_url = basename + username; //Prepare details for delivery details = new Details(); }