Esempio n. 1
0
 private void SettingsWorker_RootPathListUpdated(object sender, RootPathListEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <RootPathListEventArgs>(SettingsWorker_RootPathListUpdated), new object[] { sender, e });
         }
         else
         {
             listViewRootPath.BeginUpdate();
             listViewRootPath.Items.Clear();
             foreach (RootPath rootPath in e.RootPaths)
             {
                 ListViewItem item = listViewRootPath.Items.Add(rootPath.Path);
                 item.SubItems.Add(rootPath.UserName);
                 item.Tag = rootPath;
             }
             listViewRootPath.EndUpdate();
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 2
0
        private object CommonWorker_ShowMessage(object sender, MessageEventArgs e)
        {
            if (InvokeRequired)
            {
                return(Invoke(new CommonWorker.EventHandler <MessageEventArgs>(CommonWorker_ShowMessage), new object[] { sender, e }));
            }

            return(FormUtilities.ShowMessage(this, e.Message, e.Buttons, e.Icon));
        }
Esempio n. 3
0
 private void toolStripMenuItemServiceStart_Click(object sender, EventArgs e)
 {
     if (ServiceHandler.ServiceIsStopped())
     {
         if (!ServiceHandler.StartService())
         {
             FormUtilities.ShowError(this, "The Unpakk Daemon service failed to start.");
         }
     }
     else if (ServiceHandler.ServiceIsRunning() && ObjectPool.StatusServiceHandler.EngineIsPaused())
     {
         ObjectPool.StatusServiceHandler.ResumeEngine();
     }
 }
Esempio n. 4
0
 private void SettingsWorker_SleepTimeUpdated(object sender, TimeSpanEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <TimeSpanEventArgs>(SettingsWorker_SleepTimeUpdated), new object[] { sender, e });
         }
         else
         {
             textBoxSleepTime.Text = e.Value.TotalMinutes.ToString();
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 5
0
 private void SettingsWorker_OutputFolderUpdated(object sender, StringEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <StringEventArgs>(SettingsWorker_OutputFolderUpdated), new object[] { sender, e });
         }
         else
         {
             textBoxOutputFolder.Text = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }
Esempio n. 6
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     if (RootPath != null)
     {
         RootPath.Path     = textBoxPath.Text;
         RootPath.UserName = textBoxUserName.Text;
         RootPath.Password = textBoxPassword.Text;
     }
     else
     {
         RootPath newRootPath = new RootPath(textBoxPath.Text, textBoxUserName.Text, textBoxPassword.Text);
         if (EngineSettings.RootPaths.Contains(newRootPath))
         {
             FormUtilities.ShowError(this, "Root path already exist.");
             return;
         }
         RootPath = newRootPath;
     }
     DialogResult = DialogResult.OK;
     Close();
 }
Esempio n. 7
0
 private void SettingsWorker_UseSpecificOutputFolderUpdated(object sender, BooleanEventArgs e)
 {
     try
     {
         if (InvokeRequired)
         {
             Invoke(new EventHandler <BooleanEventArgs>(SettingsWorker_UseSpecificOutputFolderUpdated), new object[] { sender, e });
         }
         else
         {
             _discardEvents = true;
             checkBoxUseSpecificOutputFolder.Checked = e.Value;
             _discardEvents = false;
             textBoxOutputFolder.Enabled      = e.Value;
             buttonBrowseOutputFolder.Enabled = e.Value;
         }
     }
     catch (Exception ex)
     {
         FormUtilities.ShowError(this, ex);
     }
 }