private static object[] GetChildren(TreeNode parent)
        {
            List <object> l = new List <object>();

            if (parent.Nodes != null)
            {
                foreach (TreeNode n in parent.Nodes)
                {
                    if (n.Tag is ManagedConnection)
                    {
                        ManagedConnection mc = n.Tag as ManagedConnection;
                        ServerType        s  = mc.Config;
                        s.DisplayName = n.Text;
                        l.Add(s);
                    }
                    else
                    {
                        FolderType f = new FolderType();
                        f.Name  = n.Text;
                        f.Items = GetChildren(n);
                        f.Name  = n.Text;
                        l.Add(f);
                    }
                }
            }

            return(l.ToArray());
        }
        private void Save()
        {
            ManagedConnection c = currentConnection;

            c.Config.DisplayName = DisplayNameFld.Text;
            c.Config.HostName    = HostNameFld.Text;
            c.Config.Port        = Convert.ToInt32(PortFld.Text);
        }
        public ServerModify(ManagedConnection c)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            ApplyButton       = this.ApplyBtn;
            currentConnection = c;
        }
Beispiel #4
0
 private static void OnConnectStateChanged(ManagedConnection mc, bool oldConnectedState, bool newConnectedState)
 {
     if (ConnectStateChanged != null)
     {
         if (oldConnectedState != newConnectedState)
         {
             ConnectStateChanged(mc, newConnectedState);
             oldConnectedState = newConnectedState;
         }
     }
 }
 public ServerModify(string newCaption, ManagedConnection c) : this(c)
 {
     this.Text = newCaption;
 }