Esempio n. 1
0
        private void notifyIconContextMenu_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            ToolStripItem item = e.ClickedItem;

            if (item == menuItemOpen)
            {
                Visible     = true;
                WindowState = FormWindowState.Normal;
            }
            else if (item == menuItemToggleActivate)
            {
                if (menuItemToggleActivate.CheckState == CheckState.Unchecked)
                {
                    Sherpa.StartServer();
                }
                else
                {
                    Sherpa.StopServer();
                }
            }
            else if (item == menuItemShutdown)
            {
                Application.Exit();
            }
        }
Esempio n. 2
0
        private void notifyIconContextMenu_PathClicked(object sender, EventArgs e)
        {
            ToolStripItem item = (ToolStripItem)sender;

            comboRoot.Text = item.Text;
            Sherpa.UpdateRootDir(item.Text);
        }
Esempio n. 3
0
 private void comboRoot_TextUpdate(object sender, EventArgs e)
 {
     if (Directory.Exists(comboRoot.Text))
     {
         MaybeAddPathToDropDown(comboRoot.Text);
         Sherpa.UpdateRootDir(comboRoot.Text);
     }
 }
Esempio n. 4
0
        private void ServerOptionsForm_Load(object sender, EventArgs e)
        {
            comboRoot.Text = Properties.Settings.Default.rootDir;
            editPort.Value = Properties.Settings.Default.port;

            for (int i = 0; i < Properties.Settings.Default.previousRootDirs.Count; i++)
            {
                MaybeAddPathToDropDown(Properties.Settings.Default.previousRootDirs[i].ToString());
            }

            Sherpa.StartServer();
        }
Esempio n. 5
0
        private void buttonBrowseRoot_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            fbd.SelectedPath = comboRoot.Text;

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                comboRoot.Text = fbd.SelectedPath;
                MaybeAddPathToDropDown(comboRoot.Text);
                Sherpa.UpdateRootDir(fbd.SelectedPath);
            }
        }
Esempio n. 6
0
        private void ServerOptionsForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Sherpa.StopServer();

            var it = comboRoot.Items.GetEnumerator();

            while (it.MoveNext())
            {
                if (!Properties.Settings.Default.previousRootDirs.Contains(it.Current.ToString()))
                {
                    Properties.Settings.Default.previousRootDirs.Add(it.Current.ToString());
                }
            }

            Properties.Settings.Default.Save();
        }
Esempio n. 7
0
 private void editPort_ValueChanged(object sender, EventArgs e)
 {
     Sherpa.UpdatePort((int)editPort.Value);
 }
Esempio n. 8
0
 private void buttonPaused_Click(object sender, EventArgs e)
 {
     buttonActive.Enabled = false;
     Sherpa.StartServer();
 }
Esempio n. 9
0
 private void comboRoot_SelectionChangeCommitted(object sender, EventArgs e)
 {
     Sherpa.UpdateRootDir(comboRoot.SelectedItem.ToString());
 }