Exemplo n.º 1
0
 private void UpdateStartProc()
 {
     try
     {
         uDebugLogAdd("Updating existing start process item");
         StartProcessItem foundItem = Toolbox.settings.ActiveStartList.Find(x => x == _startItem);
         if (foundItem != null)
         {
             uDebugLogAdd($"Found existing Start Proc Item: [Name] {foundItem.Name} [Args] {foundItem.Args} [Move] {foundItem.MoveAfterStart} [Path] {foundItem.Path}");
             foundItem.Name           = TxtFriendlyName.Text;
             foundItem.Path           = TxtProcPath.Text;
             foundItem.Args           = TxtProcArgs.Text;
             foundItem.MoveAfterStart = ComboWindowMove.Text == "Yes" ? true : false;
             uDebugLogAdd($"Updated existing Start Proc Item: [Name] {foundItem.Name} [Args] {foundItem.Args} [Move] {foundItem.MoveAfterStart} [Path] {foundItem.Path}");
             Director.Main.ShowNotification($"Updated Start Process for: {foundItem.Name}");
             CloseEditor();
         }
         else
         {
             uDebugLogAdd("Couldn't find existing Start Proc Item, canceling...");
             Director.Main.ShowNotification("Was unable to find Process, not updated");
             UpdateMessage("Error: Start Item Not Found, Not Updated");
         }
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 2
0
 private void EditSelectedStartProcessItem()
 {
     try
     {
         StartProcessItem startItem = (StartProcessItem)ListStartProc.SelectedItem;
         Director.Main.OpenStartProcessWindow(startItem);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 3
0
 private void DeleteSelectedStartItem()
 {
     try
     {
         StartProcessItem item = (StartProcessItem)ListStartProc.SelectedItem;
         Toolbox.settings.RemoveStartProcess(item);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 4
0
 private void StartSelectedProcess()
 {
     try
     {
         StartProcessItem startItem = (StartProcessItem)ListStartProc.SelectedItem;
         Actions.StartProcess(startItem.Path, startItem.Args, startItem.MoveAfterStart);
         Director.Main.ShowNotification($"Started Process: {startItem.Name}");
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 5
0
 private void CreateNewStartProc()
 {
     try
     {
         uDebugLogAdd("Creating new Start Proc Item");
         StartProcessItem newItem = new StartProcessItem()
         {
             Path           = TxtProcPath.Text,
             Args           = TxtProcArgs.Text,
             Name           = TxtFriendlyName.Text,
             MoveAfterStart = ComboWindowMove.Text == "Yes" ? true : false
         };
         uDebugLogAdd($"Adding newly created StartProcItem to list: [Name] {newItem.Name} [Args] {newItem.Args} [Move] {newItem.MoveAfterStart} [Path] {newItem.Path}");
         Toolbox.settings.AddStartProcess(newItem);
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 6
0
 private void ChangeUIForEditing(StartProcessItem startItem)
 {
     try
     {
         uDebugLogAdd($"Changing UI for Editing: {startItem.Name}");
         _action                  = StartEditorAction.Edit;
         lblTitle.Text            = "Start Process Editor";
         WinStartProcEditor.Title = "Start Process Editor";
         BtnFinish.Content        = "Save";
         TxtProcPath.Text         = startItem.Path;
         TxtProcArgs.Text         = startItem.Args;
         TxtFriendlyName.Text     = startItem.Name;
         string comboString = startItem.MoveAfterStart ? "Yes" : "No";
         if (Toolbox.FindComboBoxItemByString(ComboWindowMove, comboString) != null)
         {
             ComboWindowMove.SelectedItem = Toolbox.FindComboBoxItemByString(ComboWindowMove, comboString);
         }
         uDebugLogAdd($"Finished UI update for editing");
     }
     catch (Exception ex)
     {
         LogException(ex);
     }
 }
Exemplo n.º 7
0
 public StartProcEditor(StartProcessItem startItem = null)
 {
     InitializeComponent();
     _startItem = startItem;
     Startup();
 }