public override void Execute(object parameter) { SetupWindow Setup = new SetupWindow(); Setup.Show(); //Setup.Owner = this; }
void App_Startup(object sender, StartupEventArgs e) { var process = Process.GetCurrentProcess(); var otherProcess = Process.GetProcesses().FirstOrDefault(p => p.ProcessName == process.ProcessName && p.Id != process.Id); if (otherProcess != null) { PerformRegularShutdownOprations = false; ShowWindow(otherProcess); Current.Shutdown(); return; } if (!UserSettings.HasSettings() || UserSettings.Settings.Devices.Count == 0) { var setupWindow = new SetupWindow(); setupWindow.Show(); } else { var primaryColor = (Color)ColorConverter.ConvertFromString("#3FAE29"); var secondaryColor = (Color)ColorConverter.ConvertFromString("#2D2F30"); var baseTheme = Theme.Dark; var theme = Theme.Create(baseTheme, primaryColor, secondaryColor); Application.Current.Resources.SetTheme(theme); NormalStartup(e); } }
private void App_OnStartup(object sender, StartupEventArgs e) { string commandArg = string.Empty; if (e.Args.Length > 0) { commandArg = e.Args[0].ToLower().Trim().Substring(0, 2); } switch (commandArg) { case "/p": // preview this.Shutdown(); break; case "/s": // screensaver this.controller = new ApplicationController(Current); this.StartScreensaver(); break; default: // no argument or /c both show config this.controller = new ApplicationController(Current); var setupWindow = new SetupWindow(this.controller); setupWindow.Show(); break; } }
private void App_OnStartup(object sender, StartupEventArgs e) { this.controller = new ApplicationController(Current); var setupWindow = new SetupWindow(this.controller); setupWindow.Show(); }
void App_Startup(object sender, StartupEventArgs e) { var process = Process.GetCurrentProcess(); var otherProcess = Process.GetProcesses().FirstOrDefault(p => p.ProcessName == process.ProcessName && p.Id != process.Id); if (otherProcess != null) { PerformRegularShutdownOprations = false; ShowWindow(otherProcess); Current.Shutdown(); return; } if (!UserSettings.HasSettings() || UserSettings.Settings.Devices.Count == 0) { var setupWindow = new SetupWindow(); setupWindow.Show(); } else { NormalStartup(e); } }
public static void ResetAllSettings(MainWindow mainWindow) { UserSettings.DeleteSettings(); var setupWindow = new SetupWindow(); setupWindow.Show(); mainWindow.Close(); }
public void OpenSetup(Action OnSetupFinished) { if (Data.Settings.FirstTimeSetup) { SetupWindow setupWindow = new SetupWindow(this, OnSetupFinished); setupWindow.Owner = App.Current.MainWindow; setupWindow.Show(); } }
private void btnOpenJ_Click(object sender, RoutedEventArgs e) { var openFile = new OpenFileDialog(); openFile.FileName = CFiles.MotionParams; if (openFile.ShowDialog() == true) { JsonSerializer Jser = new JsonSerializer(); StreamReader sr = new StreamReader(openFile.FileName); JsonReader Jreader = new JsonTextReader(sr); Xparam = Jser.Deserialize <MotionParams_Copy>(Jreader); sr.Close(); CFiles.MotionParams = openFile.FileName; Xparam.CopyParams(KM.CoordMotion.MotionParams); // copy the motion parameters to the KM instance SetupWindow st1 = new SetupWindow(KM.CoordMotion.MotionParams); st1.Show(); } }
private void btnSaveJ_Click(object sender, RoutedEventArgs e) { SetupWindow St2 = new SetupWindow(KM.CoordMotion.MotionParams); St2.Show(); }
private void User_ActiveEvent(int id, string name, int command) { if (command == ElementCommands.InfoModule) { Connection.SendMessage(new MessageClass(Connection.ID, id, Commands.GetInfo, 0)); } if (command == ElementCommands.SendModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < Setupers.Count; i++) { if (gid == Setupers[i].ID) { ok = true; } } } var setup = new SetupWindow(gid, id, name, Connection); Setupers.Add(setup); setup.Owner = this; setup.CloseEvent += (SetupWindow window) => { Setupers.Remove(window); GC.Collect(); }; setup.Show(); } if (command == ElementCommands.VideoModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < VideoWindows.Count; i++) { if (gid == VideoWindows[i].ID) { ok = true; } } } var video = new VideoWindow(gid, id, name, Connection); VideoWindows.Add(video); video.CloseEvent += (VideoWindow window) => { VideoWindows.Remove(window); GC.Collect(); }; video.Show(); } if (command == ElementCommands.FileModule) { Random r = new Random(); int gid = -1; bool ok = true; while (ok) { ok = false; gid = r.Next(1, Int32.MaxValue / 2); for (int i = 0; i < VideoWindows.Count; i++) { if (gid == VideoWindows[i].ID) { ok = true; } } } var fileWindow = new FileWindow(gid, id, name, Connection); FileWindows.Add(fileWindow); fileWindow.CloseEvent += (FileWindow window) => { FileWindows.Remove(window); GC.Collect(); }; fileWindow.Show(); } }
/// <summary> /// Inicia la configuración del PlugIn, esta debe ser una nueva ventana. /// </summary> public void startPluginConfiguration() { SetupWindow sw = new SetupWindow(); sw.Closed += new EventHandler(SetupWindow_Closed); sw.Show(); }