Exemplo n.º 1
0
 private void addNetworkToolStripMenuItem_Click(object sender, EventArgs e)
 {
     NetworkSettings net = IrcSettingsManager.Instance.AddNetwork("New Network");
     var node = new NetworkSettingsTreeNode(net, networkContextMenuStrip);
     ircSettingsTree.Nodes.Add(node);
     node.BeginEdit();
 }
Exemplo n.º 2
0
        private void addNetworkToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NetworkSettings net  = IrcSettingsManager.Instance.AddNetwork("New Network");
            var             node = new NetworkSettingsTreeNode(net, networkContextMenuStrip);

            ircSettingsTree.Nodes.Add(node);
            node.BeginEdit();
        }
Exemplo n.º 3
0
        protected override void OnLoad(EventArgs e)
        {
            foreach (var network in IrcSettingsManager.Instance.Networks)
            {
                var net = new NetworkSettingsTreeNode(network, networkContextMenuStrip);
                foreach (var server in network.Servers)
                {
                    var serverSettings = new ServerSettingsTreeNode(server, serverContextMenuStrip);
                    net.AddServerNode(serverSettings);
                }

                ircSettingsTree.Nodes.Add(net);
            }

            HideBothPanes();

            base.OnLoad(e);
        }
Exemplo n.º 4
0
        protected override void OnLoad(EventArgs e)
        {
            foreach (var network in IrcSettingsManager.Instance.Networks)
            {
                var net = new NetworkSettingsTreeNode(network, networkContextMenuStrip);
                foreach (var server in network.Servers)
                {
                    var serverSettings = new ServerSettingsTreeNode(server, serverContextMenuStrip);
                    net.AddServerNode(serverSettings);
                }

                ircSettingsTree.Nodes.Add(net);
            }

            HideBothPanes();

            base.OnLoad(e);
        }
Exemplo n.º 5
0
        private void addServerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ContextMenuStrip cms          = (ContextMenuStrip)((ToolStripMenuItem)sender).Owner;
            TreeView         treeView     = (TreeView)cms.SourceControl;
            TreeNode         selectedNode = treeView.GetNodeAt(treeView.PointToClient(cms.Location));

            if (selectedNode.GetType() != typeof(NetworkSettingsTreeNode)) //Not sure if this would actually ever happen
            {
                throw new InvalidOperationException();
            }

            NetworkSettingsTreeNode netnode = (NetworkSettingsTreeNode)selectedNode;
            ServerSettings          server  = netnode.Settings.AddServer();

            server.Description = "New Server";
            var node = new ServerSettingsTreeNode(server, serverContextMenuStrip);

            netnode.AddServerNode(node);
            node.BeginEdit();
        }