private StationOptions CreateDefaultEditableStationOption(CloudTable tab, String name) { StationOptions option = new StationOptions(name); TableOperation insertOp = TableOperation.InsertOrReplace(option); //We do not need to await this tab.ExecuteAsync(insertOp); return(option); }
public async Task <bool> UpdateDeviceOptions(string DeviceName, StationOptions opt) { try { var json = JsonConvert.SerializeObject(opt); var commandMessage = new Message(Encoding.ASCII.GetBytes(json)); await client.SendAsync(DeviceName, commandMessage); } catch (Exception e) { Console.WriteLine(e.Message); return(await Task.FromResult(false)); } return(await Task.FromResult(true)); }
private async Task <bool> UpdateDeviceConfigSettings(StationOptions option) { CloudTableClient tableClient = storageAccount.CreateCloudTableClient(); CloudTable table = tableClient.GetTableReference("DeviceConfigSettings"); TableOperation insertOrRepOp = TableOperation.InsertOrReplace(option); TableResult res = await table.ExecuteAsync(insertOrRepOp); if (res.HttpStatusCode != 204) { Console.WriteLine("Failure updating station options"); } return(true); }
async void Config_Clicked(object sender, EventArgs e) { StationOptions opt = await viewModel.GetStationOptions(); await Navigation.PushAsync(new DeviceConfigPage(opt, viewModel.Item.StationName)); }
public async Task <bool> UpdateStationOptions(StationOptions stationOption) { return(await UpdateDeviceConfigSettings(stationOption)); }
public DeviceConfigPage(StationOptions options, string devName) { InitializeComponent(); BindingContext = stationOption = options; deviceName = devName; }
public WeatherStation(StationOptions givenStatOptions, long id, List <WeatherSet> sets) { statOptions = givenStatOptions; rgWeatherSets = sets; }