예제 #1
0
 private void joinButton_Click(object sender, RoutedEventArgs e)
 {
     if (joinNetworkID.Text.Length < 16)
     {
         MessageBox.Show("Invalid Network ID");
     }
     else
     {
         handler.JoinNetwork(joinNetworkID.Text);
     }
 }
예제 #2
0
        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);
            }
        }