Inheritance: System.Windows.Forms.UserControl
示例#1
0
 private void btn_newSync_Click(object sender, EventArgs e)
 {
     SyncSettings ss = new SyncSettings();
     tc_syncs.TabPages.Add("<New Sync>");
     tc_syncs.TabPages[tc_syncs.TabPages.Count-1].Controls.Add(ss);
     linkSyncSettings(ss);
     ss.Dock = DockStyle.Top;
 }
示例#2
0
 private void linkSyncSettings(SyncSettings ss)
 {
     ss.Dock = DockStyle.Fill;
     ss.BringToFront();
     ss.SrcChanged += new EventHandler<EventArgs>(ss_SrcChanged);
     ss.CloseClicked += new EventHandler<EventArgs>(ss_CloseClicked);
     ss.Status += new EventHandler<SyncSettings.StatusEventArgs>(ss_Status);
     ss.NeedScpPath += new EventHandler<SyncSettings.GetPathEventArgs>(ss_NeedScpPath);
 }
示例#3
0
 void ss_Status(object sender, SyncSettings.StatusEventArgs e)
 {
     StatusOut(((SyncSettings)sender).src, e.status);
 }
示例#4
0
        void ss_NeedScpPath(object sender, SyncSettings.GetPathEventArgs e)
        {
            if (File.Exists(_scpPath)) {
                e.path = _scpPath;
            } else {
                e.path = Environment.ExpandEnvironmentVariables("%programfiles(x86)%\\putty\\pscp.exe");
                if (!File.Exists(e.path)) {
                    e.path=Environment.ExpandEnvironmentVariables("%programfiles%\\putty\\pscp.exe");
                    if (!File.Exists(e.path)) {
                        e.path = null;
                    }
                }

            }
        }