コード例 #1
0
        private void addNetworkButton_Clicked(object o, EventArgs args)
        {
            AddNetworkDialog addDialog = new AddNetworkDialog(dialog);

            if (addDialog.Run() == (int)ResponseType.Ok)
            {
                foreach (object[] row in networksListStore)
                {
                    NetworkInfo networkInfo = (NetworkInfo)row[0];
                    if (networkInfo.NetworkName == addDialog.NetworkInfo.NetworkName)
                    {
                        Gui.ShowErrorDialog("A network with that name has already been added.");
                        return;
                    }
                }

                networksListStore.AppendValues(addDialog.NetworkInfo);
                PopulateAutoConnectList();
            }
        }
コード例 #2
0
        private void addNetworkButton_Clicked(object o, EventArgs args)
        {
            AddNetworkDialog addDialog = new AddNetworkDialog(dialog);
            if (addDialog.Run() == (int)ResponseType.Ok) {
                foreach (object[] row in networksListStore) {
                    NetworkInfo networkInfo = (NetworkInfo)row[0];
                    if (networkInfo.NetworkName == addDialog.NetworkInfo.NetworkName) {
                        Gui.ShowErrorDialog("A network with that name has already been added.");
                        return;
                    }
                }

                networksListStore.AppendValues(addDialog.NetworkInfo);
                PopulateAutoConnectList();
            }
        }