public IssueBrowserWindow(IssueMonitor IssueMonitor, string ServerAndPort, string UserName, TimeSpan?ServerTimeOffset, TextWriter Log, string CurrentStream, Dictionary <string, Func <IssueData, bool> > CustomFilters, string FilterName) { this.IssueMonitor = IssueMonitor; this.ServerAndPort = ServerAndPort; this.UserName = UserName; this.ServerTimeOffset = ServerTimeOffset; this.Log = Log; this.CurrentStream = CurrentStream; this.FilterName = FilterName; this.CustomFilters = CustomFilters; this.MainThreadSynchronizationContext = SynchronizationContext.Current; IssueMonitor.AddRef(); InitializeComponent(); using (Graphics Graphics = Graphics.FromHwnd(IntPtr.Zero)) { float DpiScaleX = Graphics.DpiX / 96.0f; foreach (ColumnHeader Column in IssueListView.Columns) { Column.Width = (int)(Column.Width * DpiScaleX); } } System.Reflection.PropertyInfo DoubleBufferedProperty = typeof(Control).GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); DoubleBufferedProperty.SetValue(IssueListView, true, null); }
public IssueAlertWindow(IssueMonitor IssueMonitor, IssueData Issue, IssueAlertReason Reason) { this.IssueMonitor = IssueMonitor; this.Issue = Issue; InitializeComponent(); SetIssue(Issue, Reason); }
public IssueBrowserWindow(IssueMonitor IssueMonitor, string ServerAndPort, string UserName, TimeSpan?ServerTimeOffset, TextWriter Log, string CurrentStream) { this.IssueMonitor = IssueMonitor; this.ServerAndPort = ServerAndPort; this.UserName = UserName; this.ServerTimeOffset = ServerTimeOffset; this.Log = Log; this.CurrentStream = CurrentStream; IssueMonitor.AddRef(); InitializeComponent(); System.Reflection.PropertyInfo DoubleBufferedProperty = typeof(Control).GetProperty("DoubleBuffered", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); DoubleBufferedProperty.SetValue(IssueListView, true, null); }
public static void Show(Form Owner, IssueMonitor IssueMonitor, string ServerAndPort, string UserName, TimeSpan?ServerTimeOffset, TextWriter Log, string CurrentStream, Dictionary <string, Func <IssueData, bool> > CustomFilters, string DefaultFilter) { IssueBrowserWindow Window = ExistingWindows.FirstOrDefault(x => x.IssueMonitor == IssueMonitor); if (Window == null) { Window = new IssueBrowserWindow(IssueMonitor, ServerAndPort, UserName, ServerTimeOffset, Log, CurrentStream, CustomFilters, DefaultFilter); Window.Owner = Owner; Window.StartPosition = FormStartPosition.Manual; Window.Location = new Point(Owner.Location.X + (Owner.Width - Window.Width) / 2, Owner.Location.Y + (Owner.Height - Window.Height) / 2); Window.Show(Owner); ExistingWindows.Add(Window); Window.FormClosed += (E, S) => ExistingWindows.Remove(Window); } else { Window.Activate(); } }