Esempio n. 1
0
File: Main.cs Progetto: yqMac/School
 //
 //ShowMyServerControl tool
 //
 private void toolStripButton3_Click(object sender, EventArgs e)
 {
     ServerControlForm serverControl = new ServerControlForm(this);
     serverControl.Show();
 }
Esempio n. 2
0
File: Main.cs Progetto: yqMac/School
 //
 //ShowMyServerControl Menu
 //
 private void menuItem11_Click(object sender, EventArgs e)
 {
     ServerControlForm serverControl = new ServerControlForm(this);
     serverControl.Show();
 }
Esempio n. 3
0
File: Main.cs Progetto: yqMac/School
        private void toolStripButton_Click(object sender, EventArgs e)
        {
            string tagstr = "";
            if(typeof(Button )==sender .GetType())
            {
                Button tmpbtn = (Button)sender;
                tagstr = tmpbtn.Tag.ToString();
            }else if (typeof (ToolStripButton )==sender.GetType())
            {
                ToolStripButton tmptsb = (ToolStripButton)sender;
                tagstr = tmptsb.Tag.ToString();
            }
            else if (typeof(ToolStripMenuItem ) == sender.GetType())
            {
                ToolStripMenuItem tmptsb = (ToolStripMenuItem)sender;
                tagstr = tmptsb.Tag.ToString();
            }

            //Button tsb = (Button)sender;
            if(tagstr!="")
            {
                switch (tagstr)
                {
                    case "refresh":
                        if (localLv.Focused)
                        {
                            FillLocalView(ftpHelper1.Localfolder);
                        }
                        else if (serverLv.Focused)
                        {
                            ftpHelper1.Dir();
                        }
                        break;
                    case "execute":
                        if (!isExcuteTransfering)
                            ExcuteTranfer();
                        break;
                    case "abor":
                        ftpHelper1.Abor();
                        break;
                    case "Connect":
                        timer1.Enabled = true;
                        btn_tool_disconnect.Enabled = true;
                        btn_tool_Connect.Enabled = false;
                        connectToolStripMenuItem.Enabled = false;
                        disConnnectToolStripMenuItem.Enabled = true;
                        this.Cursor = Cursors.WaitCursor;
                        SetSatusInfor("[操作]   链接服务器中 请稍候...");
                        Connect();
                        break;
                    case "disConnect":
                        SwitchUpDownLoad(false);
                        timer1.Enabled = false;
                        ServerRootFlag = false;
                        btn_tool_disconnect.Enabled = false;
                        btn_tool_Connect.Enabled = true;
                        connectToolStripMenuItem.Enabled = true;
                        disConnnectToolStripMenuItem.Enabled = false;
                        serverLv.Items.Clear();
                        ftpHelper1.DisConnect();
                        ftpHelper1.ClearCommandList();
                        SetConnetInfor("欢迎: 未知   状态: 未连接");
                        break;
                    case "manage":
                        ServerControlForm serverControl = new ServerControlForm(this);
                        serverControl.Show();
                        break;
                    case "quit":
                        this.Close();
                        break;
                }
            }
        }