Наследование: 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;
                    }
                }

            }
        }