public TreeNodeAccess(RemoteAccess remoteAccess, string text) : base(text)
 {
     this._remoteAccess      = remoteAccess;
     this.SelectedImageIndex = remoteAccess.protocol.id;
     this.ImageIndex         = _remoteAccess.protocol.id;
     this.ToolTipText        = String.Format("$1 ($2) - $3",
                                             remoteAccess.host, remoteAccess.protocol.ToString(), remoteAccess.login);
 }
        public DialogResult ShowDialog(string inName, RemoteAccess ra)
        {
            protocol.Text = ra.protocol.name;

            name.Text     = inName;
            host.Text     = (ra.host != null ? ra.host : "");
            login.Text    = (ra.login != null ? ra.login : "");
            port.Value    = ra.port;
            resource.Text = (ra.resource != null ? ra.resource : "");

            if (ra.password != null)
            {
                password = ra.password;
            }

            return(this.ShowDialog());
        }
        private void ok_Click(object sender, EventArgs e)
        {
            if ((name.Text == "") || (host.Text == "") || (protocol.SelectedIndex < 0))
            {
                MessageBox.Show("Name, host or protocol cannot be empty", "Error editing remote access", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            RemoteName            = name.Text;
            RemoteDetail          = new RemoteAccess();
            RemoteDetail.protocol = protocolList[protocol.Text];

            RemoteDetail.host     = (host.Text != "" ? host.Text : null);
            RemoteDetail.login    = (login.Text != "" ? login.Text : null);
            RemoteDetail.password = (password != "" ? password : null);
            RemoteDetail.port     = (int)port.Value;
            RemoteDetail.resource = (resource.Text != "" ? resource.Text : null);

            DialogResult = DialogResult.OK;
        }
 public TreeNodeAccess(string text) : base(text)
 {
     _remoteAccess           = null;
     this.SelectedImageIndex = 0;
     this.ImageIndex         = 0;
 }