private void joinButton_Click(object sender, RoutedEventArgs e) { if (joinNetworkID.Text.Length < 16) { MessageBox.Show("Invalid Network ID"); } else { handler.JoinNetwork(joinNetworkID.Text); } }
private async void ToolbarItem_NewNetwork(object sender, System.Windows.RoutedEventArgs e) { if (CentralAPI.Instance.HasAccessToken()) { CentralAPI api = CentralAPI.Instance; CentralNetwork newNetwork = await api.CreateNewNetwork(); APIHandler handler = APIHandler.Instance; handler.JoinNetwork(this.Dispatcher, newNetwork.Id); string nodeId = APIHandler.Instance.NodeAddress(); bool authorized = await CentralAPI.Instance.AuthorizeNode(nodeId, newNetwork.Id); } }