private void CompileStartStopButton_OnClick(object sender, RoutedEventArgs e) { CompilingManager.ToggleCompileState(); CompileStartStopButton.Content = (string)CompileStartStopButton.Content == "Compile" ? "Cancel" : "Compile"; OutputTab.Focus(); }
private void CompileStartStopButton_OnClick(object sender, RoutedEventArgs e) { CompilingManager.ToggleCompileState(); CompileStartStopButton.Content = (string)CompileStartStopButton.Content == "Compile" ? "Cancel" : "Compile"; OutputTab.Focus(); UpdateProcessList(); // used for updating the PreviousTimeTaken values shown next to each Process }
public MainWindow(string cmd) { Instance = this; base.Topmost = Settings.Instance.TopMost; InitializeComponent(); base.ResizeMode = ResizeMode.NoResize; tabEditWindow = new TabEditWindow(EditorTabs); scriptsContextMenu = new ScriptsContextMenu(this); EditorTabs.Loaded += delegate { EditorTabs.GetTemplateChild <Button>("AddTabButton").Click += delegate { MakeTab("", "New Tab"); }; tabScroller = EditorTabs.GetTemplateChild <ScrollViewer>("TabScrollViewer"); }; OutputTab.Loaded += delegate { OutputTab.GetTemplateChild <Button>("CloseButton").Visibility = Visibility.Collapsed; }; OutputTab.MouseWheel += ScrollTabs; OutputTab.Tag = true; MakeTab("", "New Tab"); base.Closing += delegate { CloseWindows(); }; watcher = new FileSystemWatcher("scripts\\"); watcher.Created += delegate { base.Dispatcher.Invoke(ReloadScripts); }; watcher.Renamed += delegate { base.Dispatcher.Invoke(ReloadScripts); }; watcher.Deleted += delegate { base.Dispatcher.Invoke(ReloadScripts); }; watcher.EnableRaisingEvents = true; ReloadScripts(); int attachedPid = 0; this.Output.TextChanged += delegate(object sender, EventArgs e) { Output.ScrollToEnd(); }; IPC instance = IPC.Instance; instance.Connected += delegate { base.Dispatcher.Invoke(delegate { Output.AppendText("Client has connected.\n"); Bridge.Sentinel.UnlockFPS(Settings.Instance.UnlockFPS); }); }; instance.Disconnected += delegate { base.Dispatcher.Invoke(delegate { attachedPid = 0; Output.AppendText("Client has disconnected.\n"); }); }; instance.Error += delegate { base.Dispatcher.Invoke(delegate { }); }; DispatcherTimer dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Interval = TimeSpan.FromMilliseconds(500.0); dispatcherTimer.Tick += delegate { if (Body2.Visibility != Visibility.Hidden && Settings.Instance.AutoAttach) { Process[] processesByName = Process.GetProcessesByName("RobloxPlayerBeta"); if (processesByName.Length == 1 && processesByName[0].Id != attachedPid && !(processesByName[0].MainWindowHandle == IntPtr.Zero)) { attachedPid = processesByName[0].Id; Bridge.Injector.Inject(); } } }; dispatcherTimer.Start(); }