예제 #1
0
 void AddGroupClick(object sender, EventArgs e)
 {
     InputBox dlg;
     dlg = new InputBox(true, "New connection group","Name for the new connection group");
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         ConnectionGroup aux = new ConnectionGroup();
         aux.Name = dlg.Input;
         CGs.Add(aux);
         LoadInfo();
     }
 }
예제 #2
0
 /// <summary>
 /// Basic Constructor, initializes this node to start at the root of the first drive found on the disk. ONLY USE THIS FOR ROOT NODES
 /// </summary>
 public ConxGroupNode(RootConxNode Dad, ConnectionGroup Conx)
 {
     parent = Dad;
     szDisplayName = Conx.Name;
     ThisGConx = Conx;
 }
예제 #3
0
        /// <summary>
        /// Updates the contents of this node.
        /// </summary>
        public void UpdateNode()
        {
            try
            {
                //if we have not allocated our children yet
                //get sub-folders for this folder
                List<ConnectionGroup> Groups = Globals.GetConnections(MainForm.ConDataFileName);

                if (children != null)
                {
                    for (int i = 0; i < this.children.Length; i++)
                        this.children.SetValue(null, i);

                    this.children = null;
                }

                if(Groups == null)
                {
                    return;
                }
                else
                {
                    foreach(ConnectionGroup g in Groups)
                    {
                        if(g.Name.Equals(ThisGConx.Name, StringComparison.CurrentCultureIgnoreCase))
                        {
                            ThisGConx = g;
                            children = new ConxNode[ThisGConx.Connections.Count];
                            break;
                        }
                    }
                }

                for (int i = 0; i < ThisGConx.Connections.Count; i++)
                {
                    children[i] = new ConxNode(this, ThisGConx.Connections[i]);
                }
            }
            catch (System.Exception ioex)
            {
                //write a message to stderr
                System.Console.Error.WriteLine(ioex.Message);
            }
        }
예제 #4
0
 private void LoadInfo(ConnectionGroup Current = null)
 {
     LGroup.Items.Clear();
     foreach (ConnectionGroup gc in CGs)
         LGroup.Items.Add(gc.Name, 0);
     if (Current != null)
     {
         LGroup.SelectedIndices.Clear();
         LGroup.SelectedIndices.Add(CGs.IndexOf(Current));
     }
 }