Ejemplo n.º 1
0
 public static void AddDockAbleContent(this IDockableManager manager, FrmState thisState, object model, object thisControl, params string[] objects)
 {
     manager.AddDockAbleContent(thisState, thisControl, objects);
     manager.ViewDictionary.Last().Model = model;
 }
Ejemplo n.º 2
0
        public void AddDockAbleContent(FrmState thisState, object thisControl, string name)
        {
            string name2 = null;
            int    count = ViewDictionary.Count(d => d.Name == name);

            if (count != 0)
            {
                name2 = name + count;
            }
            else
            {
                name2 = name;
            }
            var viewitem            = new ViewItem(thisControl, name, thisState);
            LayoutAnchorable layout = null;

            ViewDictionary.Add(viewitem);
            try
            {
                switch (thisState)
                {
                case FrmState.Large:
                    layout = Factory(name, thisControl);
                    documentMain.Children.Add(layout);

                    layout.IsActive = true;
                    break;

                case FrmState.Buttom:
                    layout = Factory(name, thisControl);

                    var view = thisControl as DebugManagerUI;
                    if (view != null)
                    {
                        RichTextBoxAppender.SetRichTextBox(view.richtextBox, DebugText);
                    }

                    documentButtom.Children.Add(layout);

                    layout.IsActive = true;
                    break;

                case FrmState.Middle:
                    layout             = Factory(name, thisControl);
                    viewitem.Container = layout;
                    dockablePane1.Children.Add(layout);

                    layout.IsActive = true;
                    break;

                case FrmState.Mini:
                    layout             = Factory(name, thisControl);
                    viewitem.Container = layout;
                    dockablePane2.Children.Add(layout);

                    layout.IsActive = true;
                    break;

                case FrmState.Custom:
                    var window = new Window {
                        Title = name
                    };
                    window.Content = thisControl;
                    window.ShowDialog();
                    break;

                case FrmState.Float:

                    layout = Factory(name, thisControl);

                    dockablePane2.Children.Add(layout);

                    layout.Float();

                    break;
                }
                viewitem.Container = layout;
            }
            catch (Exception ex)
            {
                XLogSys.Print.ErrorFormat("{0}{1},{2}", Core.Properties.Resources.ControlLoad, Core.Properties.Resources.Error, ex.Message);
            }
        }
Ejemplo n.º 3
0
 public ViewItem(object view, string name, FrmState frmState)
 {
     this.View = view;
     this.Name = name;
     this.FrmState = frmState;
 }
Ejemplo n.º 4
0
 public void AddDockAbleContent(FrmState thisState, object thisControl, params string[] objects)
 {
     AddDockAbleContent(thisState, thisControl, objects[0]);
 }
Ejemplo n.º 5
0
        public void AddDockAbleContent(FrmState thisState, object thisControl, string name)
        {
            string name2 = null;
            var    count = ViewDictionary.Count(d => d.Name == name);

            if (count != 0)
            {
                name2 = name + count;
            }
            else
            {
                name2 = name;
            }
            var viewitem            = new ViewItem(thisControl, name, thisState);
            LayoutAnchorable layout = null;

            ViewDictionary.Add(viewitem);
            try
            {
                switch (thisState)
                {
                case FrmState.Large:
                    layout = Factory(name, thisControl);
                    documentMain.Children.Add(layout);

                    layout.IsActive = true;
                    break;

                case FrmState.Buttom:
                    layout = Factory(name, thisControl);

                    var view = thisControl as DebugManagerUI;
                    if (view != null)
                    {
                        RichTextBoxAppender.SetRichTextBox(view.richtextBox, DebugText, notifier);
                    }

                    documentButtom.Children.Add(layout);
                    documentButtom.Children.RemoveElementsNoReturn(d => d.Content == null);
                    layout.IsActive = true;
                    layout.CanClose = false;
                    break;

                case FrmState.Middle:
                    layout             = Factory(name, thisControl);
                    viewitem.Container = layout;
                    dockablePane1.Children.Add(layout);
                    dockablePane1.Children.RemoveElementsNoReturn(d => d.Content == null);
                    layout.IsActive = true;
                    layout.CanClose = false;
                    break;

                case FrmState.Mini:
                    layout             = Factory(name, thisControl);
                    viewitem.Container = layout;
                    dockablePane2.Children.Add(layout);
                    dockablePane2.Children.RemoveElementsNoReturn(d => d.Content == null);
                    layout.IsActive = true;
                    break;

                case FrmState.Mini2:
                    layout             = Factory(name, thisControl);
                    viewitem.Container = layout;
                    dockablePane3.Children.Add(layout);
                    dockablePane3.Children.RemoveElementsNoReturn(d => d.Content == null);
                    layout.IsActive = true;
                    layout.CanClose = false;
                    break;

                case FrmState.Custom:
                    var window = new Window {
                        Title = name
                    };
                    window.Content = thisControl;
                    window.ShowDialog();
                    break;

                case FrmState.Float:

                    layout = Factory(name, thisControl);

                    dockablePane1.Children.Add(layout);

                    layout.Float();

                    break;
                }
                var canNotClose = new[]
                { GlobalHelper.Get("ModuleMgmt"), GlobalHelper.Get("SysState"), GlobalHelper.Get("DebugView") };
                if (canNotClose.Contains(name))
                {
                    if (layout != null)
                    {
                        layout.CanClose = false;
                    }
                }
                viewitem.Container = layout;
            }
            catch (Exception ex)
            {
                XLogSys.Print.ErrorFormat("{0}{1},{2}", GlobalHelper.Get("ControlLoad"), GlobalHelper.Get("Error"),
                                          ex.Message);
            }
        }
Ejemplo n.º 6
0
 public ViewItem(object view, string name, FrmState frmState)
 {
     this.View     = view;
     this.Name     = name;
     this.FrmState = frmState;
 }
Ejemplo n.º 7
0
        public void AddDockAbleContent(FrmState thisState, object thisControl, string name)
        {
            string name2 = null;
            int count = ViewDictionary.Count(d => d.Name == name);
            if (count != 0)
            {
                name2 = name + count;
            }
            else
            {
                name2 = name;
            }
            var viewitem = new ViewItem(thisControl, name, thisState);
            LayoutAnchorable layout = null;
            ViewDictionary.Add(viewitem);
            try
            {
                switch (thisState)
                {
                    case FrmState.Large:
                        layout = Factory(name, thisControl);
                        documentMain.Children.Add(layout);

                        layout.IsActive = true;
                        break;
                    case FrmState.Buttom:
                        layout = Factory(name, thisControl);

                        var view = thisControl as DebugManagerUI;
                        if (view != null)
                        {
                            RichTextBoxAppender.SetRichTextBox(view.richtextBox, DebugText);
                        }

                        documentButtom.Children.Add(layout);

                        layout.IsActive = true;
                        break;
                    case FrmState.Middle:
                        layout = Factory(name, thisControl);
                        viewitem.Container = layout;
                        dockablePane1.Children.Add(layout);

                        layout.IsActive = true;
                        break;
                    case FrmState.Mini:
                        layout = Factory(name, thisControl);
                        viewitem.Container = layout;
                        dockablePane2.Children.Add(layout);

                        layout.IsActive = true;
                        break;
                    case FrmState.Custom:
                        var window = new Window {Title = name};
                        window.Content = thisControl;
                        window.ShowDialog();
                        break;

                    case FrmState.Float:

                        layout = Factory(name, thisControl);

                        dockablePane2.Children.Add(layout);

                        layout.Float();

                        break;
                }
                viewitem.Container = layout;
            }
            catch (Exception ex)
            {
                XLogSys.Print.ErrorFormat("{0}{1},{2}",Core.Properties.Resources.ControlLoad,Core.Properties.Resources.Error , ex.Message);
            }
        }
Ejemplo n.º 8
0
 public void AddDockAbleContent(FrmState thisState, object thisControl, params string[] objects)
 {
     AddDockAbleContent(thisState, thisControl, objects[0]);
 }