示例#1
0
 public void ShowObject(object obj)
 {
     fields.FieldSource             = obj;
     toolWindow.ButtonAcceptEnabled = true;
     toolWindow.Label.Text          = toolAdd.Text;
     toolWindow.Show(bar, bar.Bounds.BottomLeft);
 }
示例#2
0
        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));
            }
        }
示例#3
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));
     }
 }
示例#4
0
        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);
        }