Exemple #1
0
 private void _navsach_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentPanel dcpanelSach = documentGr.Items.SingleOrDefault(m => m.Caption.Equals("Quản lý Sách")) as DocumentPanel;
         if (dcpanelSach == null)
         {
             DocumentPanel panelSach
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\frmSach.xaml", UriKind.Relative),
                 Caption = "Quản lý Sách"
                 };
             documentGr.Items.Add(panelSach);
             docklayout.DockController.Activate(panelSach);
         }
         else
         {
             docklayout.DockController.Activate(dcpanelSach);
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #2
0
 private void navProductType_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentPanel getPanelProductType = documentGroup.Items.SingleOrDefault(m => m.Caption.Equals("Danh mục Loại Mặt hàng")) as DocumentPanel;
         if (getPanelProductType == null)
         {
             DocumentPanel panelProductType
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\ProductType.xaml", UriKind.Relative),
                 Caption = "Danh mục Loại Mặt hàng"
                 };
             documentGroup.Items.Add(panelProductType);
             dockLayoutManager.DockController.Activate(panelProductType);
         }
         else
         {
             dockLayoutManager.DockController.Activate(getPanelProductType);
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #3
0
        void addEmptyButton_Click(object sender, RoutedEventArgs e)
        {
            DocumentPanel panel = dockManager.DockController.AddDocumentPanel(documentContainer);

            panel.Caption = "Empty Panel " + (i++).ToString();
            dockManager.Activate(panel);
        }
        private void DocumentGroupItemAdd(DocumentPanelCaptionModel caption, Control content)
        {
            content.Margin = new Thickness(5);

            var items = DocumentGroupMain.Items;
            var singleOrDefaultPanel = items.SingleOrDefault(a => ((DocumentPanelCaptionModel)a.Caption).LeftMenuId == caption.LeftMenuId);

            if (singleOrDefaultPanel == null)
            {
                var documentPanel = new DocumentPanel
                {
                    Caption = caption,
                    CustomizationCaption = caption.ToString(),
                    AllowFloat           = false,
                    AllowHide            = false,
                    Content  = content,
                    IsActive = true
                };
                items.Add(documentPanel);
            }
            else
            {
                singleOrDefaultPanel.IsActive = true;
            }
        }
Exemple #5
0
        private void getResultDisplayUserControl(ResultDisplayType resultType)
        {
            var exsitedListernerTypeNameList = vm.listenerlist.Select(x => x.GetType().FullName);

            Assembly assembly  = Assembly.LoadFile(resultType.AssemblyPath);
            string   fullName  = resultType.ResultType.FullName;
            Type     modelType = assembly.GetType(fullName);
            object   resultObj = null;

            //if (exsitedListernerTypeNameList.Contains(fullName))
            //{
            //    resultObj = vm.listenerlist.Where(x => x.GetType().FullName == fullName).FirstOrDefault();
            //}
            //else
            //{
            resultObj = Activator.CreateInstance(modelType) as object;
            if (resultObj is IResultListerner)
            {
                IResultListerner listener = resultObj as IResultListerner;
                listener.TestPlan  = vm.TestPlan;
                listener.SpecIndex = vm.SelectedSpecIndex;
                vm.listenerlist.Add(listener);
            }


            if (resultObj is UserControl)
            {
                UserControl   uc    = resultObj as UserControl;
                DocumentPanel panel = new DocumentPanel();
                panel.Caption = resultType.Att.DisplayName;
                panel.Content = uc;
                documentGroup1.Insert(0, panel);
                documentGroup1.SelectedTabIndex = 0;
            }
        }
 public MainWindow()
 {
     InitializeComponent();
     MDIDocument   d  = new MDIDocument();
     DocumentPanel dp = new DocumentPanel();
     LayoutPanel   lp = new LayoutPanel();
 }
Exemple #7
0
 private void navAccount_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentPanel getPanelAccount = documentGroup.Items.SingleOrDefault(m => m.Caption.Equals("Quản lý Tài khoản")) as DocumentPanel;
         if (getPanelAccount == null)
         {
             DocumentPanel panelAccount
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\Account.xaml", UriKind.Relative),
                 Caption = "Quản lý Tài khoản"
                 };
             documentGroup.Items.Add(panelAccount);
             dockLayoutManager.DockController.Activate(panelAccount);
         }
         else
         {
             dockLayoutManager.DockController.Activate(getPanelAccount);
         }
     }
     catch (Exception)
     {
     }
 }
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="control"></param>
        internal void AddControl(string title, FrameworkElement control)
        {
            if (control == null)
            {
                MessageBox.Show("没有配置该插件", "提示");
            }
            else
            {
                if (control is Window)
                {
                    Window cur = control as Window;
                    cur.Show();
                }
                else
                {
                    Frame frame = new Frame
                    {
                        Margin = new Thickness(5, 5, 5, 5)
                    };
                    frame.Navigate(control);

                    var panel = new DocumentPanel()
                    {
                        Content = frame, Caption = title
                    };
                    documentGroup.Items.Add(panel);
                    documentGroup.SelectedTabIndex = documentGroup.Items.Count;
                }
            }
        }
        void OnViewsCollectionChanged(IRegion region, DocumentGroup regionTarget, object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                foreach (object view in e.NewItems)
                {
                    DockLayoutManager manager = regionTarget.GetDockLayoutManager();
                    DocumentPanel     panel   = manager.DockController.AddDocumentPanel(regionTarget);

                    IView viewInfo = panel.Content as IView;

                    if (viewInfo != null)
                    {
                        panel.Caption = viewInfo.Caption;
                    }
                    else
                    {
                        panel.Caption = "";
                    }

                    manager.DockController.Activate(panel);

                    this.logger.Log(String.Format("DocumentGroupAdapter: View '{0}' added to region '{1}'", view, region.Name), Category.Debug, Priority.None);
                }
            }
        }
        /// <summary>
        /// 添加界面
        /// </summary>
        /// <param name="control"></param>
        internal void AddControl(string title, WinForms.Control control)
        {
            if (control == null)
            {
                MessageBox.Show("没有配置该插件", "提示");
            }
            else
            {
                if (control is WinForms.Form)
                {
                    WinForms.Form frm = control as WinForms.Form;
                    if (frm.TopLevel)
                    {
                        frm.Show();
                        return;
                    }
                }
                //
                WindowsFormsHost formsHost = new WindowsFormsHost
                {
                    Child = control
                };

                control.Show();
                var panel = new DocumentPanel()
                {
                    Content = formsHost, Caption = title
                };
                documentGroup.Items.Add(panel);
                documentGroup.SelectedTabIndex = documentGroup.Items.Count;
            }
        }
Exemple #11
0
        public void MakeMaxSize(BaseLayoutItem item, bool isMax)
        {
            if (item == null)
            {
                return;
            }

            var panel = item as LayoutPanel;

            if (panel != null)
            {
                panel.ShowRestoreButton  = isMax;
                panel.ShowMaximizeButton = isMax;
            }

            if (isMax)
            {
                dockManager.DockController.Dock(item, documentGroup, DevExpress.Xpf.Layout.Core.DockType.Fill);
            }
            else
            {
                var parent        = dockManager.DockController.Float(item);
                var restoreBounds = new Rect(parent.FloatLocation, parent.FloatSize);
                var bounds        = WindowHelper.GetMaximizeBounds(dockManager, restoreBounds);
                DocumentPanel.SetRestoreBounds(parent, restoreBounds);
                parent.FloatLocation = new Point(bounds.X, bounds.Y);
                parent.FloatSize     = new Size(bounds.Width, bounds.Height);
            }
        }
Exemple #12
0
        DocumentPanel CreateNoteDocument(Note note)
        {
            DocumentPanel document = new DocumentPanel();

            document.HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled;
            document.VerticalScrollBarVisibility   = ScrollBarVisibility.Disabled;
            document.AllowFloat = false;
            document.AllowMove  = false;
            document.Name       = note.Caption;
            document.Caption    = note.Caption;

            Note.SetNote(document, note);
            LayoutGroup tabs = new LayoutGroup();

            tabs.Caption          = "Pages";
            tabs.ShowCaption      = true;
            tabs.GroupBorderStyle = GroupBorderStyle.Tabbed;
            tabs.CaptionLocation  = CaptionLocation.Bottom;
            tabs.AddRange(CreateNotePages(note));
            tabs.Add(CreateNewItemPage());
            LayoutGroup group = new LayoutGroup();

            group.Add(tabs);
            document.Content = group;
            return(document);
        }
Exemple #13
0
 private void _bbiadduser_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
 {
     try
     {
         DocumentPanel dcpanelKL = documentGr.Items.SingleOrDefault(m => m.Caption.Equals("Quản lý Người Dùng")) as DocumentPanel;
         if (dcpanelKL == null)
         {
             DocumentPanel panelKL
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\frmUser.xaml", UriKind.Relative),
                 Caption = "Quản lý Người Dùng"
                 };
             documentGr.Items.Add(panelKL);
             docklayout.DockController.Activate(panelKL);
         }
         else
         {
             docklayout.DockController.Activate(dcpanelKL);
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #14
0
        /*NOTES: RENDER DOCUMENTGROUP: WINDOWS_LOADED NOTWORK -> USED GRID_LOADED OF WINDOWS/GRID_LOADED USERCONTROL*/
        public void fRenderForm(string oMenuID, string oFormName, string oFormCaption)
        {
            try{
                if (MTGlobal.TAB_ARRAY == null)
                {
                    MTGlobal.TAB_ARRAY = new List <string>();
                }
                if (MTGlobal.TAB_ARRAY.Contains(oMenuID))
                {
                    return;
                }
                MTGlobal.TAB_ARRAY.Add(oMenuID);

                string        mFormPath = @"View\" + oFormName + ".xaml";
                DocumentPanel frmPanel  = null;
                frmPanel         = DLayOutMain.DockController.AddDocumentPanel(DocGrpMain, new Uri(mFormPath, UriKind.Relative));
                frmPanel.Name    = oMenuID;
                frmPanel.Caption = oFormCaption;
                DocumentPanel.SetMDISize(frmPanel, new Size(400, 300));
                DocumentPanel.SetMDILocation(frmPanel, new Point(200, 200));
                SetWindowActive(frmPanel);

                MTGlobal.MT_ACTIVE_MENUID  = oMenuID;
                MTGlobal.MT_ACTIVE_FORM    = oFormName;
                MTGlobal.MT_ACTIVE_CAPTION = oFormCaption;
            }
            catch { }
        }
Exemple #15
0
 private void _navnxb_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentPanel dcpanelTl = documentGr.Items.SingleOrDefault(m => m.Caption.Equals("Quản lý thông tin bên ngoài")) as DocumentPanel;
         if (dcpanelTl == null)
         {
             DocumentPanel panelTL
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\frmTheLoai.xaml", UriKind.Relative),
                 Caption = "Quản lý thông tin bên ngoài"
                 };
             documentGr.Items.Add(panelTL);
             docklayout.DockController.Activate(panelTL);
         }
         else
         {
             docklayout.DockController.Activate(dcpanelTl);
         }
     }
     catch (Exception)
     {
     }
 }
        void buttonTools_BtnClose(object sender, RoutedEventArgs e)
        {
            DocumentPanel dp = (DocumentPanel)(((Setting)((Grid)((ContentControl)this.Parent).Parent).Parent).Parent);
            DocumentGroup dg = (DocumentGroup)dp.Parent;

            dg.Remove(dp);
        }
Exemple #17
0
 private void navNewOrder_Click(object sender, EventArgs e)
 {
     try
     {
         DocumentPanel getPanelNewOrder = documentGroup.Items.SingleOrDefault(m => m.Caption.Equals("Hóa đơn mới")) as DocumentPanel;
         if (getPanelNewOrder == null)
         {
             DocumentPanel panelNewOrder
                 = new DocumentPanel()
                 {
                 Content = new Uri(@"Views\NewOrder.xaml", UriKind.Relative),
                 Caption = "Hóa đơn mới"
                 };
             documentGroup.Items.Add(panelNewOrder);
             dockLayoutManager.DockController.Activate(panelNewOrder);
         }
         else
         {
             dockLayoutManager.DockController.Activate(getPanelNewOrder);
         }
     }
     catch (Exception)
     {
     }
 }
Exemple #18
0
        void addPageUriButton_Click(object sender, RoutedEventArgs e)
        {
            DocumentPanel panel = dockManager.DockController.AddDocumentPanel(
                documentContainer, new Uri("/DockingDemo;component/Layouts/ChildPage.xaml", UriKind.Relative));

            panel.Caption = "Page " + (i++).ToString();
            dockManager.Activate(panel);
        }
        private void SimpleButton_Click(object sender, RoutedEventArgs e)
        {
            DocumentPanel newPanel = new DocumentPanel();

            newPanel.Caption = "Select a site";
            newPanel.Content = new InstanceControl();
            (newPanel.Content as InstanceControl).Rename += MainWindow_Rename;
            //mainTabs.Add(newPanel);
        }
Exemple #20
0
        public void ShowWindowReplace()
        {
            var tab = new DocumentPanel
            {
                Content = new ReplaceFileControl(new ReplaceControlLogic(_dataManagersFactory, _controllersFactory.GetController<IFilesController>())) { SettingsManager = new RegistrySettingsManager() },
                Caption = "Замена файла"
            };

            AddTabToMainDocGroup(tab);
        }
Exemple #21
0
        public void ShowWindowHistory()
        {
            var tab = new DocumentPanel
            {
                Content = new HistoryFileControl { SettingsManager = new RegistrySettingsManager() },
                Caption = "История"
            };

            AddTabToMainDocGroup(tab);
        }
        public void AddNew()
        {
            DocumentPanel newPanel = new DocumentPanel();

            newPanel.Name = "_" + Guid.NewGuid().ToString().Replace("-", "");
            AddNew(newPanel, true);

            mainTabs.Add(newPanel);
            mainTabs.Visibility = Visibility.Visible;
        }
Exemple #23
0
        private void btnAddDockPanel_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e)
        {
            panel1 = dockLayoutManager1.DockController.AddDocumentPanel(documentGroup1,
                                                                        new Uri(@"CustomWindows\UserControl1.xaml", UriKind.Relative));
            panel1.Caption = "Document " + (ctr++).ToString();

            DocumentPanel.SetMDISize(panel1, new Size(400, 300));
            DocumentPanel.SetMDILocation(panel1, new Point(200, 200));
            ActivateItem(panel1);
        }
        DocumentPanel CreateImageWindow(string caption, ImageSource source)
        {
            DocumentPanel panel = dockManager.DockController.AddDocumentPanel(mdiContainer);

            panel.Content = new Image()
            {
                Source = source, Margin = new System.Windows.Thickness(5)
            };
            panel.Caption = caption;
            return(panel);
        }
Exemple #25
0
        public void ShowWindowHistory(UppyFileInfo fileInfo)
        {
            var control = new HistoryFileControl
            {
                SettingsManager = new RegistrySettingsManager(),
                FileInfo = fileInfo
            };

            var tab = new DocumentPanel { Content = control, Caption = control.ControlName };
            AddTabToMainDocGroup(tab);
        }
Exemple #26
0
 private void PanelOnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if ((bool)e.OldValue != (bool)e.NewValue && (bool)e.NewValue)
     {
         _activeDocumentPanel = sender as DocumentPanel;
         if (_activeDocumentPanel.Content is UserControlPage userControlBase)
         {
             SetToolBar(userControlBase.ToolBarItems);
         }
     }
 }
        private void OpenDialogExecute()
        {
            var child = new DocumentPanel
            {
                Content         = new Dialog(),
                ClosingBehavior = ClosingBehavior.ImmediatelyRemove,
                Tag             = "DocumentHost"
            };

            ChildViews.Add(child);
        }
Exemple #28
0
        private void nbitop20W_Click(object sender, EventArgs e)
        {
            DevExpress.Xpf.NavBar.NavBarItem navBarItem = (DevExpress.Xpf.NavBar.NavBarItem)sender;
            DocumentPanel dp = new DocumentPanel();

            dp.Caption = navBarItem.Content.ToString() + DateTime.Now.ToShortTimeString();
            documentGroup1.Add(dp);
            UserControl uc = new View.UC_Top20W();

            dp.Content  = uc;
            dp.IsActive = true;
        }
 private void OpenHostView_OnItemClick(Object sender, ItemClickEventArgs e)
 {
     if (HostView == null)
     {
         var view = new HostView(ExternalHandle);
         HostView         = new DocumentPanel();
         HostView.Caption = "Host View";
         HostView.Content = view;
         DocumentGroup.Add(HostView);
     }
     DockLayoutManager.Activate(HostView);
 }
Exemple #30
0
        private void nbiSearchKeywordByItem_Click(object sender, EventArgs e)
        {//宝贝找词
            DevExpress.Xpf.NavBar.NavBarItem navBarItem = (DevExpress.Xpf.NavBar.NavBarItem)sender;
            DocumentPanel dp = new DocumentPanel();

            dp.Caption = navBarItem.Content.ToString() + DateTime.Now.ToShortTimeString();
            documentGroup1.Add(dp);
            UserControl uc = new View.UC_SearchKeywordByItem(waitIndicator);

            dp.Content  = uc;
            dp.IsActive = true;
        }
        void OnDockItemActivated(object sender, DockItemActivatedEventArgs ea)
        {
            DocumentPanel panel = ea.Item as DocumentPanel;

            if (panel != null)
            {
                bFileName.Content = Path.GetFileName(panel.Caption as string);
            }
            else
            {
                bFileName.Content = null;
            }
        }
Exemple #32
0
 void dockManager_DockItemActivating(object sender, ItemCancelEventArgs e)
 {
     if (e.Item.Name == "newNote")
     {
         DocumentPanel panel = CreateNewNote();
         e.Cancel = panel != null;
         if (panel != null)
         {
             ActivateDelegate activate = new ActivateDelegate(ActivateDockItem);
             Dispatcher.BeginInvoke(activate, new object[] { panel });
         }
     }
 }
 private void DockLayoutManager_OnDockItemClosed(Object sender, DockItemClosedEventArgs e)
 {
     foreach (var item in e.AffectedItems)
     {
         if (item == HostView)
         {
             HostView = null;
         }
         else if (item == MapView)
         {
             MapView = null;
         }
     }
 }
Exemple #34
0
        public void ShowWindowStructure()
        {
            var control = new StructureControl(this, new StructureControlLogic(_dataManagersFactory, _controllersFactory.GetController<IFilesController>()))
            {
                SettingsManager = new RegistrySettingsManager()
            };

            var tab = new DocumentPanel
            {
                Content = control,
                Caption = "Структура"
            };

            if (MainDocumentGroup.Items.Count == 0)
            {
                tab.AllowClose = false;
            }

            AddTabToMainDocGroup(tab);
        }
Exemple #35
0
        /// <summary>
        /// 添加选项卡
        /// </summary>
        private void AddTabs(MenuInfo menuInfo)
        {
            foreach (DocumentPanel item in docGroup.Items)
            {
                MenuInfo tmpMenuInfo = item.Caption as MenuInfo;
                if (tmpMenuInfo.ID == menuInfo.ID)
                {
                    docGroup.SelectedTabIndex = item.TabIndex;
                    return;
                }
            }

            DocumentPanel docPanel = new DocumentPanel();
            docPanel.Style = (Style)this.FindResource("homeDocumentPanel");
            System.Windows.Controls.UserControl control = (System.Windows.Controls.UserControl)Assembly.Load("BPMS.Views.Default").CreateInstance("BPMS.Views.Default." + menuInfo.FormName);
            docPanel.Content = control;
            docPanel.TabIndex = docGroup.Items.Count;
            docPanel.Caption = menuInfo;
            docGroup.Items.Add(docPanel);
            docGroup.SelectedTabIndex = docGroup.Items.Count -1;
        }
 public DocumentContainer()
 {
     DocumentPanel = new DocumentPanel();
     DocumentPanel.SetResourceReference(DocumentPanel.StyleProperty, "DocumentPanelStyle");
 }
Exemple #37
0
 private void AddTabToMainDocGroup(DocumentPanel tab)
 {
     MainDocumentGroup.Add(tab);
     MainDocumentGroup.SelectedTabIndex = MainDocumentGroup.Items.IndexOf(tab);
 }
        private void OpenOrActivateForm(string key, string caption, Control content, string toolTip, bool noScroll)
        {
            if (_openDocuments.ContainsKey(key))
            {
                dockLayoutManager1.DockController.Activate(_openDocuments[key]);
                return;
            }

            content.MaxHeight = 5000;
            content.MaxWidth = 10000;

            var panel = new DocumentPanel();
            panel.AllowClose = true;
            panel.Caption = caption;
            panel.ToolTip = toolTip ?? caption ?? "";

            panel.SizeChanged += (o, e) =>
            {
                Debug.WriteLine("Panel: W: {0}, H: {1}", panel.ActualWidth, panel.ActualHeight);
            };
            _openDocuments[key] = panel;

            if (noScroll)
            {
                panel.Content = content;
            }
            else
            {
                var scrollView = new ScrollViewer();
                scrollView.Content = content;
                content.HorizontalAlignment = HorizontalAlignment.Stretch;
                //content.VerticalAlignment = VerticalAlignment.Stretch;
                scrollView.SizeChanged += (o, e) =>
                {
                    Debug.WriteLine("Scroll: W: {0}, H: {1}", scrollView.ActualWidth, scrollView.ActualHeight);
                };

                panel.Content = scrollView;
            }

            if (_panelInfos.ContainsKey(key))
            {
                var i = _panelInfos[key];
                if (i.IsFloating)
                {
                    var g = new FloatGroup();
                    g.FloatLocation = i.FloatLocation;
                    g.FloatSize = i.FloatSize;
                    g.Add(panel);
                    dockLayoutManager1.FloatGroups.Add(g);
                }
                else
                {
                    dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                    //baseDocumentGroup.Add(panel);
                }
            }
            else
            {
                dockLayoutManager1.DockController.Dock(panel, baseDocumentGroup, DockType.Fill);
                //baseDocumentGroup.Add(panel);
            }
            dockLayoutManager1.DockController.Activate(panel);
        }