private void LogTree_Load(object sender, EventArgs e) { if (VistaStuff.IsVistaOrNot) { VistaStuff.SetWindowTheme(treeView.Handle, "explorer", null); } }
private void ChapterCreator_Load(object sender, EventArgs e) { if (VistaStuff.IsVistaOrNot) { VistaStuff.SetWindowTheme(chapterListView.Handle, "explorer", null); } }
private void JobQueue_Load(object sender, EventArgs e) { if (VistaStuff.IsVistaOrNot) { VistaStuff.SetWindowTheme(queueListView.Handle, "explorer", null); } }
public void changePriority(ProcessPriority priority) { if (isRunning()) { try { switch (priority) { case ProcessPriority.IDLE: proc.PriorityClass = ProcessPriorityClass.Idle; break; case ProcessPriority.BELOW_NORMAL: proc.PriorityClass = ProcessPriorityClass.BelowNormal; break; case ProcessPriority.NORMAL: proc.PriorityClass = ProcessPriorityClass.Normal; break; case ProcessPriority.ABOVE_NORMAL: proc.PriorityClass = ProcessPriorityClass.AboveNormal; break; case ProcessPriority.HIGH: proc.PriorityClass = ProcessPriorityClass.RealTime; break; } VistaStuff.SetProcessPriority(proc.Handle, proc.PriorityClass); MainForm.Instance.Settings.ProcessingPriority = priority; return; } catch (Exception e) // process could not be running anymore { throw new JobRunException(e); } } else { if (proc == null) { throw new JobRunException("Process has not been started yet"); } else { Debug.Assert(proc.HasExited); throw new JobRunException("Process has exited"); } } }
private void ChapterCreator_Load(object sender, EventArgs e) { if (VistaStuff.IsVistaOrNot) { VistaStuff.SetWindowTheme(chapterListView.Handle, "explorer", null); } if (minimumTitleLength.Maximum >= MainForm.Instance.Settings.ChapterCreatorMinimumLength && minimumTitleLength.Minimum <= MainForm.Instance.Settings.ChapterCreatorMinimumLength) { minimumTitleLength.Value = MainForm.Instance.Settings.ChapterCreatorMinimumLength; } else { minimumTitleLength.Value = 900; } }
private void UpdateWindow_Load(object sender, EventArgs e) { // Move window in the visible area of the screen if neccessary Size oSizeScreen = Screen.GetWorkingArea(this).Size; Point oLocation = Screen.GetWorkingArea(this).Location; int iScreenHeight = oSizeScreen.Height - 2 * SystemInformation.FixedFrameBorderSize.Height; int iScreenWidth = oSizeScreen.Width - 2 * SystemInformation.FixedFrameBorderSize.Width; if (this.Size.Height >= iScreenHeight) { this.Location = new Point(this.Location.X, oLocation.Y); } else if (this.Location.Y <= oLocation.Y) { this.Location = new Point(this.Location.X, oLocation.Y); } else if (this.Location.Y + this.Size.Height > iScreenHeight) { this.Location = new Point(this.Location.X, iScreenHeight - this.Size.Height); } if (this.Size.Width >= iScreenWidth) { this.Location = new Point(oLocation.X, this.Location.Y); } else if (this.Location.X <= oLocation.X) { this.Location = new Point(oLocation.X, this.Location.Y); } else if (this.Location.X + this.Size.Width > iScreenWidth) { this.Location = new Point(iScreenWidth - this.Size.Width, this.Location.Y); } if (VistaStuff.IsVistaOrNot) { VistaStuff.SetWindowTheme(listViewDetails.Handle, "explorer", null); } }