/// <summary> /// 簡易サーバーを開始 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void clickStartServer(object sender, RoutedEventArgs e) { this.textIP.Text = NetworkPresenter.GetCurrentIpv4Address(); _server = new SimpleWebServer(); _server.OnReceived += _server_OnReceived; _server.Start(); }
private void OnSetupTextboxGotFocus(object sender, RoutedEventArgs e) { TextBox tbx = sender as TextBox; if (tbx.Text.Trim() == "") { tbx.Text = "http://" + NetworkPresenter.GetCurrentIpv4Address() + "/" + tbx.Tag + "/public"; } }
public async Task UpdateNetworkInfo() { this.DeviceName = DeviceInfoPresenter.GetDeviceName(); this.IpAddress1 = NetworkPresenter.GetCurrentIpv4Address(); this.NetworkName1 = NetworkPresenter.GetCurrentNetworkName(); var networkInfos = await NetworkPresenter.GetNetworkInformation(); this.NetworkInfos = new ObservableCollection <NetworkPresenter.NetworkInfo>(networkInfos); }
public static string SerializeMessage(string apiSettings, string action, string param) { var dataObj = new BridgeMessage() { Timestamp = DateTime.Now, IpFrom = NetworkPresenter.GetCurrentIpv4Address(), ApiSettings = apiSettings, Action = action, Parameter = param }; string body = JsonConvert.SerializeObject(dataObj, Formatting.None, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); return(body); }
// Displays basic device info private void DisplayDeviceInfoDialog(object sender, RoutedEventArgs e) { string msg = string.Format(Common.GetLocalizedText("DeviceInfoDialogMessage"), NetworkPresenter.GetCurrentIpv4Address(), Common.GetOSVersionString(), Common.GetAppVersion()); foreach (var feature in AppComposer.Imports.Features) { if (!string.IsNullOrEmpty(feature.DeviceInfo)) { msg += "\n" + feature.DeviceInfo; } } DialogButton primaryButton = new DialogButton(Common.GetLocalizedText("DeviceInfoDialogButton"), (Sender, ClickEventsArgs) => { NavigateTo(typeof(DeviceInfoPage)); }); AppService.DisplayDialog(Common.GetLocalizedText("DeviceInfoDialogTitle"), msg, primaryButton); }
private async Task <bool> UpdateNetworkInfo() { DeviceName = DeviceInfoPresenter.GetDeviceName(); IPAddress = NetworkPresenter.GetCurrentIpv4Address(); NetworkName = NetworkPresenter.GetCurrentNetworkName(); AppBuild = Common.GetAppVersion(); AzureHub = IoTHubService?.HostName ?? Common.GetLocalizedText("NotAvailable"); AzureDeviceId = IoTHubService?.DeviceId ?? Common.GetLocalizedText("NotAvailable"); var networkInfoList = await NetworkPresenter.GetNetworkInformation(); if (networkInfoList != null) { NetworkCollection.Clear(); foreach (var network in networkInfoList) { NetworkCollection.Add(new NetworkInfoDataTemplate(network)); } return(true); } return(false); }
private void SetupDeviceNames() { DeviceName = DeviceInfoPresenter.GetDeviceName(); DeviceIpAddress = NetworkPresenter.GetCurrentIpv4Address(); }
private void UpdateNetworkInfo() { DeviceName = DeviceInfoPresenter.GetDeviceName(); IPv4Address = NetworkPresenter.GetCurrentIpv4Address(); }