public void ShowObject(object obj) { fields.FieldSource = obj; toolWindow.ButtonAcceptEnabled = true; toolWindow.Label.Text = toolAdd.Text; toolWindow.Show(bar, bar.Bounds.BottomLeft); }
private void OnToolLoadClick(object sender, EventArgs e) { var dialog = new OpenFileDialog(); if (dialog.Run(ParentWindow)) { StateInfoList newList = null; using (var fileStream = File.Open(dialog.FileName, FileMode.Open, FileAccess.Read)) { Stream stream; if (Helper.IsGZip(fileStream)) { stream = Helper.GetUnGZipStrem(fileStream); } else { stream = fileStream; } newList = Serialization.Deserialize(stream) as StateInfoList; stream.Close(); } var form = new ToolWindow(); form.Label.Text = Path.GetFileNameWithoutExtension(dialog.FileName); form.Target = new LogList() { ListSource = newList }; form.Mode = ToolShowMode.Dialog; form.Show(this, new Point(0, 0)); } }
public void ShowDropDown(ToolShowMode mode) { if (dropDown != null && !dropDown.Visible) { if (dropDown.ScreenBounds.Width < Bounds.Width && Bounds.Width > 200) { dropDown.Size = new Size(Bounds.Width, dropDown.ScreenBounds.Height); } if (mode == ToolShowMode.AutoHide) { dropDown.TimerInterval = 10000; } dropDown.Mode = mode; dropDown.Show(this, new Point(0, Bounds.Height)); } }
protected void ShowException(Exception ex) { var list = new LayoutList() { FieldSource = new ExceptionInfo(ex) }; list.ListInfo.CalcHeigh = true; var exceptionWindow = new ToolWindow() { Title = "Exception!", Mode = ToolShowMode.Dialog, Width = 640, Target = list }; exceptionWindow.ButtonClose.Visible = false; exceptionWindow.Show(null, Point.Zero); }