void NewItem(string strServerPath) { Debug.Assert(this.LinkInfos != null, ""); OneLinkInfoDlg dlg = new OneLinkInfoDlg(); dlg.Font = GuiUtil.GetDefaultFont(); dlg.Text = "指定一个新的连接关系"; dlg.textBox_serverPath.Text = strServerPath; dlg.ShowDialog(this); if (dlg.DialogResult != DialogResult.OK) return; LinkInfo info = new LinkInfo(); info.ServerPath = dlg.textBox_serverPath.Text; info.LocalPath = dlg.textBox_localPath.Text; this.LinkInfos.Add(info); this.LinkInfos.Changed = true; FillList(); int nRet = 0; string strError = ""; nRet = info.Link(out strError); if (nRet == -1) MessageBox.Show(this, strError); }
public void Add(LinkInfo info) { info.Container = this; base.Add(info); }