public void Show(IWorkspace parentWorkspace)
        {
            customerSummaryView = customerSummaryView ?? Items.AddNew <CustomerSummaryView>();

            AddMenuItems();

            var customer = (BankTellerCommon.Customer)State[WorkItemStates.Customer];

            OnStatusTextUpdate(string.Format("Editing {0}, {1}", customer.LastName, customer.FirstName));
            var smartPartInfo = new XtraWindowSmartPartInfo
            {
                Title = (customer.LastName + " " + customer.FirstName)
            };

            //customerSummaryView.Dock = DockStyle.Fill;
            parentWorkspace.Show(customerSummaryView, smartPartInfo);

            UpdateUserAddressLabel(customer);

            Activate();
            parentWorkspace.SmartPartActivated += new EventHandler <WorkspaceEventArgs>(parentWorkspace_SmartPartActivated);

            // When activating, force focus on the first tab in the view.
            // Extensions may have added stuff at the end of the tab.
            customerSummaryView.FocusFirstTab();
        }
        /// <summary>
        /// 编辑选定数据资料
        /// </summary>
        public override void Edit()
        {
            base.Edit();

            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
            {
                MaximizeBox     = false,
                MinimizeBox     = false,
                Modal           = true,
                ShowInTaskbar   = false,
                StartPosition   = System.Windows.Forms.FormStartPosition.CenterParent,
                FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog,
                Title           = "新建操作"
            };

            IWorkspace wp = WorkItem.Workspaces.Get(UIExtensionSiteNames.Shell_Workspace_Window);

            if (wp != null)
            {
                CommandView view = WorkItem.Items.Get <CommandView>(AuthCommandView);
                if (view == null)
                {
                    view = WorkItem.Items.AddNew <CommandView>(AuthCommandView);
                }

                view.AuthNode = CurrentAuthNode.Tag as AuthorizationNode;
                view.BindingCommand(View.TLCommands.Selection[0].Tag as AuthorizationCommand); // 绑定操作项
                wp.Show(view, spi);

                View.ListAuthorizationCommands(CurrentAuthNode.Tag as AuthorizationNode); // 刷新操作列表
                UpdateRoleAuthorization(view.AuthNode);
            }
        }
示例#3
0
        /// <summary>
        /// Shows the form as a child of the specified <see cref="ParentMdiForm"/>.
        /// </summary>
        /// <param name="smartPart">The <see cref="Control"/> to show in the workspace.</param>
        /// <param name="smartPartInfo">The information to use to show the smart part.</param>
        protected override void OnShow(Control smartPart, XtraWindowSmartPartInfo spi)
        {
            Form child = GetOrCreateForm(smartPart);

            child.MdiParent = parentMdiForm;

            SetWindowProperties(child, spi);
            child.Show();
            child.BringToFront();
        }
示例#4
0
 protected override void OnApplySmartPartInfo(Control smartPart, XtraWindowSmartPartInfo smartPartInfo)
 {
     if (mdiMode != MdiMode.Tabbed)
     {
         base.OnApplySmartPartInfo(smartPart, smartPartInfo);
     }
     if (smartPart.Parent != null)
     {
         DoMergeRibbon(smartPart.Parent);
     }
 }
示例#5
0
        public void ShowSavedQueryDetail(SavedQuery savedQuery)
        {
            var savedQueryDetailView = WorkItem.Items.AddNew <SavedQueryDetailView>();

            savedQueryDetailView.Bind(savedQuery);
            var info = new XtraWindowSmartPartInfo {
                StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = "View Design"
            };

            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(savedQueryDetailView, info);
            BindList();
            savedQueryDetailView.Dispose();
        }
示例#6
0
        /// <summary>
        /// Shows the form as a child of the specified <see cref="ParentMdiForm"/>.
        /// </summary>
        /// <param name="smartPart">The <see cref="Control"/> to show in the workspace.</param>
        /// <param name="smartPartInfo">The information to use to show the smart part.</param>
        protected override void OnShow(Control smartPart, XtraWindowSmartPartInfo smartPartInfo)
        {
            parentMdiForm.SuspendLayout();

            Form mdiChild = this.GetOrCreateForm(smartPart);

            SetWindowProperties(mdiChild, smartPartInfo);

            SetWindowLocation(mdiChild, smartPartInfo);
            mdiChild.Tag       = smartPartInfo;
            mdiChild.MdiParent = parentMdiForm;
            mdiChild.Show();
            mdiChild.BringToFront();
            parentMdiForm.ResumeLayout();
        }
示例#7
0
        private void xtraTabbedMdiManager_SelectedPageChanged(object sender, EventArgs e)
        {
            XtraMdiTabPage page = tabbedMdiManager.SelectedPage;

            if (page != null)
            {
                page.Image = page.MdiChild.Icon.ToBitmap();

                XtraWindowSmartPartInfo smartPartInfo = (XtraWindowSmartPartInfo)page.MdiChild.Tag;
                if (smartPartInfo != null)
                {
                    page.Tooltip = smartPartInfo.Description;
                }
            }
        }
示例#8
0
        /// <summary>
        /// 为角色选择成员
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void btnAdd_Click(object sender, EventArgs e)
        {
            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
            {
                MaximizeBox     = false,
                MinimizeBox     = false,
                Modal           = true,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                StartPosition   = FormStartPosition.CenterParent,
                Title           = "选择成员"
            };

            Presenter.ShowViewInWorkspace <MembershipUserChoiseView>(SmartPartNames.MembershipUserChoiseView,
                                                                     UIExtensionSiteNames.Shell_Workspace_Window, spi);
            RefreshCurrentRole((string)WorkItem.State[Constants.CurrentRole]); // 刷新当前角色下的成员
        }
        private void chooseColumnsButton_Click(object sender, EventArgs e)
        {
            var columnChooser = WorkItem.Items.AddNew <ViewColumnChooser>();

            columnChooser.Init(_savedQuery.ReturnedTypeId, viewGridView);
            var info = new XtraWindowSmartPartInfo
            {
                StartPosition = FormStartPosition.CenterParent,
                Icon          = Properties.Resources.ri_Katrin,
                Modal         = true,
                Title         = "Column Chooser"
            };

            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(columnChooser, info);
            columnChooser.Dispose();
        }
        private void ShowOptionSet(Guid optionSetId, EntityDetailWorkingMode workMode)
        {
            var optionView = WorkItem.Items.AddNew <OptionSetDetailView>();
            var presenter  = WorkItem.Items.AddNew <OptionSetDetailPresenter>();

            presenter.optionSetId = optionSetId;
            presenter.WorkingMode = workMode;
            optionView.Presenter  = presenter;
            var info = new XtraWindowSmartPartInfo {
                StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = "OptionSet"
            };

            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(optionView, info);
            if (optionView.IsSave && FreshOptionSet != null)
            {
                FreshOptionSet(this, new DataEventArgs <Guid>(optionSetId));
            }
        }
示例#11
0
        /// <summary>
        /// 编辑选定数据资料
        /// </summary>
        public override void Edit()
        {
            base.Edit();

            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
            {
                MaximizeBox     = false,
                MinimizeBox     = false,
                Modal           = true,
                ShowInTaskbar   = false,
                StartPosition   = FormStartPosition.CenterParent,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                Title           = "属性"
            };

            ShowViewInWorkspace <CommandView>(SmartPartNames.AuthorizationCommandView, UIExtensionSiteNames.Shell_Workspace_Window, spi);
            RefreshDataSource();
        }
示例#12
0
        /// <summary>
        /// 插入新的数据资料
        /// </summary>
        public override void Insert()
        {
            base.Insert();

            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
            {
                MaximizeBox     = false,
                MinimizeBox     = false,
                Modal           = true,
                ShowInTaskbar   = false,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                StartPosition   = FormStartPosition.CenterParent,
                Title           = "新建"
            };

            ShowViewInWorkspace <MembershipUserView>(SmartPartNames.MembershipUserView, UIExtensionSiteNames.Shell_Workspace_Window, spi);
            RefreshDataSource();
        }
示例#13
0
        /// <summary>
        /// Shows the form as a child of the specified <see cref="ParentMdiForm"/>.
        /// </summary>
        /// <param name="smartPart">The <see cref="Control"/> to show in the workspace.</param>
        /// <param name="smartPartInfo">The information to use to show the smart part.</param>
        protected override void OnShow(Control smartPart, XtraWindowSmartPartInfo smartPartInfo)
        {
            Form mdiChild = this.GetOrCreateForm(smartPart);

            SetWindowProperties(mdiChild, smartPartInfo);
            mdiChild.MdiParent  = parentMdiForm;
            mdiChild.Activated -= MdiChild_Activated;
            mdiChild.Activated += MdiChild_Activated;
            //mdiChild.Deactivate -= MdiChild_Deactivate;
            //mdiChild.Deactivate += MdiChild_Deactivate;
            mdiChild.Show();
            if (mdiMode != MdiMode.Tabbed)
            {
                SetWindowLocation(mdiChild, smartPartInfo);
            }

            mdiChild.BringToFront();
        }
示例#14
0
 /// <summary>
 /// 编辑选定数据资料
 /// </summary>
 public override void Edit()
 {
     if (View.RoleList.Selection.Count > 0)
     {
         XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
         {
             MaximizeBox     = false,
             MinimizeBox     = false,
             Modal           = true,
             FormBorderStyle = FormBorderStyle.FixedDialog,
             StartPosition   = FormStartPosition.CenterParent,
             ShowInTaskbar   = false,
             Title           = "属性"
         };
         WorkItem.State.Remove(Constants.CurrentRole);
         WorkItem.State[Constants.CurrentRole] = View.RoleList.FocusedNode.GetDisplayText(0);
         ShowViewInWorkspace <MembershipRoleView>(SmartPartNames.MembershipRoleView, UIExtensionSiteNames.Shell_Workspace_Window, spi);
     }
 }
示例#15
0
        /// <summary>
        /// 编辑选定数据资料
        /// </summary>
        public override void Edit()
        {
            base.Edit();

            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo()
            {
                MaximizeBox     = false,
                MinimizeBox     = false,
                Modal           = true,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                StartPosition   = FormStartPosition.CenterParent,
                Title           = "属性",
                ShowInTaskbar   = false
            };

            WorkItem.State.Remove(Constants.CurrentUser);
            WorkItem.State[Constants.CurrentUser] = View.UsersList.Selection[0].GetDisplayText(0); // 获取当前选定的用户名称
            ShowViewInWorkspace <MembershipUserEditView>(SmartPartNames.MembershipUserEditView, UIExtensionSiteNames.Shell_Workspace_Window, spi);
        }
示例#16
0
        void tabbedMdiManager_PageAdded(object sender, MdiTabPageEventArgs e)
        {
            XtraWindowSmartPartInfo smartPartInfo = (XtraWindowSmartPartInfo)e.Page.MdiChild.Tag;

            if (smartPartInfo != null &&
                string.IsNullOrEmpty(smartPartInfo.Description) == false)
            {
                e.Page.SuperTip = new DevExpress.Utils.SuperToolTip();
                e.Page.SuperTip.Items.AddTitle("提示");
                e.Page.SuperTip.Items.Add(smartPartInfo.Description);
            }
            if (this.PageAdded != null)
            {
                this.PageAdded(sender, e);
            }
            if (smartPartInfo.Title.Equals("邮件") || smartPartInfo.Title.Equals("Email"))
            {
                e.Page.ShowCloseButton = DevExpress.Utils.DefaultBoolean.False;
            }
        }
        private void ShowRelatedEntityList(string name, string title, CriteriaOperator filter)
        {
            title += GetLocalizedCaption(name);
            var listViewType = FindLoadedType(name + "ListView");

            var addNewMethod =
                Items.GetType().GetMethods(BindingFlags.Instance | BindingFlags.Public)
                .First(m => m.IsGenericMethod && m.Name == "AddNew").MakeGenericMethod(listViewType);

            var objectView     = addNewMethod.Invoke(Items, new object[] {});
            var entityListView = objectView as EntityListView;

            if (entityListView != null)
            {
                entityListView.FixedPredicate = filter;
                entityListView.InitEntityView(name);
                entityListView.Bind(name);
                var info = new XtraWindowSmartPartInfo {
                    StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = title
                };
                Workspaces[WorkspaceNames.ModalWindows].Show(entityListView, info);
            }
        }
示例#18
0
        public void OnUniframeworkSetting(object sender, EventArgs e)
        {
            SettingView view = WorkItem.SmartParts.Get <SettingView>(SmartPartNames.SmartPart_Shell_SettingView);

            if (view == null)
            {
                view = WorkItem.SmartParts.AddNew <SettingView>(SmartPartNames.SmartPart_Shell_SettingView);
            }

            XtraWindowSmartPartInfo spi = new XtraWindowSmartPartInfo
            {
                Title           = "选项",
                MaximizeBox     = false,
                MinimizeBox     = false,
                StartPosition   = FormStartPosition.CenterParent,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                Modal           = true,
                Icon            = ImageService.GetIcon("preferences", new System.Drawing.Size(16, 16))
            };
            IWorkspace wp = new XtraWindowWorkspace();

            wp.Show(view, spi);
        }
示例#19
0
        public void ShowAttributeDetail(Guid attributeId)
        {
            var attributeDetailView = WorkItem.Items.AddNew <AttributeDetailView>();
            var optionSetList       = metadataServiceClient.GetOptionSet();
            var attributePickList   = metadataServiceClient.GetAttributePicklistValue();
            FormatTypeDefind fd     = new FormatTypeDefind();
            var formatTypeList      = fd.GetFormatList();
            var entityList          = metadataServiceClient.GetMetaEntities();
            var relationList        = metadataServiceClient.GetEntityRelationshipRoles();

            attributeDetailView.InitOptionSetUpEdit(optionSetList, attributePickList, formatTypeList, entityList);
            EntityAttribute attribute = new EntityAttribute();

            attribute.IsNullable = true;
            if (attributeId != Guid.Empty)
            {
                attribute = metadataServiceClient.GetEntityAttribute(attributeId);
            }
            attributeDetailView.WorkItem = WorkItem;
            attributeDetailView.BindData(attribute, relationList);
            var info = new XtraWindowSmartPartInfo {
                StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = "Attrbute"
            };

            WorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(attributeDetailView, info);
            if (attributeDetailView.IsSave)
            {
                // ??
                bool isAdd = true;

                if (attributeId != Guid.Empty)
                {
                    isAdd = false;
                }
                SaveAttribute(attribute, attributeDetailView.RelationShip, isAdd);
            }
        }
        /// <summary>
        /// Usage sample for the CABDevExpress.Extension Kit XtraWindowWorkspace and XtraWindowSmartPartInfo
        /// the example shows an 'About Dialog'
        /// </summary>
        private void ShowHelpAbout()
        {
            if (!SmartParts.Contains(SmartPartNames.HelpAbout))
            {
                SmartParts.AddNew <AboutBankTellerView>(SmartPartNames.HelpAbout);
            }

            var smartPartInfo = new XtraWindowSmartPartInfo
            {
                Modal           = true,
                StartPosition   = FormStartPosition.CenterParent,
                FormBorderStyle = FormBorderStyle.FixedDialog,
                MinimizeBox     = false,
                MaximizeBox     = false,
                Height          = 150,
                Width           = 350,
                Title           = "About"
            };

            // the two properties added by CABDevExpress.ExtensionKit's XtraWindowSmartPartInfo
            var xtraWindow = new XtraWindowWorkspace();

            xtraWindow.Show(SmartParts[SmartPartNames.HelpAbout], smartPartInfo);
        }
        private void InitLoginUser(RibbonControl Ribbon)
        {
            //??CLEAR SET
            if (RootWorkItem.State["hasAddBarStaticItem"] == null)
            {
                RootWorkItem.State["hasAddBarStaticItem"] = true;
                var clearSettingButton = new BarButtonItem();
                clearSettingButton.Caption    = Resources.ClearSetting;
                clearSettingButton.Glyph      = (Bitmap)Resources.ResourceManager.GetObject("ri_clear");
                clearSettingButton.ItemClick += delegate
                {
                    string message = Resources.ClearSettingConfirm;
                    var    result  = XtraMessageBox.Show(message, Properties.Resources.Katrin, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    if (result == DialogResult.OK)
                    {
                        var stateFiles = Directory.GetFiles(Application.StartupPath, "*.state");
                        foreach (var stateFile in stateFiles)
                        {
                            File.Delete(stateFile);
                        }
                    }
                };
                Ribbon.Items.Add(clearSettingButton);
                ApplicationMenu pmAppMain = Ribbon.ApplicationButtonDropDownControl as ApplicationMenu;
                if (pmAppMain != null)
                {
                    pmAppMain.ItemLinks.Add(clearSettingButton);
                }

                //set logined user full name
                var _fullNameItem = new BarStaticItem();
                _fullNameItem.Caption = AuthorizationManager.FullName;
                Ribbon.Items.Add(_fullNameItem);
                _fullNameItem.ItemClick += (s, e) => ShowRelatedEntityDetail("User", AuthorizationManager.CurrentUserId);
                _fullNameItem.Glyph      = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("userinfo");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { _fullNameItem });

                var notificationItem = new BarStaticItem();
                notificationItem.Caption = Properties.Resources.Notification;
                Ribbon.Items.Add(notificationItem);
                notificationItem.ItemClick += (s, e) =>
                {
                    string notificationKey = "NotificationListView";
                    var    detailWorkItem  = Items.Get <WorkItem>(notificationKey);
                    if (detailWorkItem == null)
                    {
                        detailWorkItem = Items.AddNew <WorkItem>(notificationKey);
                    }
                    detailWorkItem.Run();
                    var notificationListView = detailWorkItem.Items.Get <NotificationList>(notificationKey);
                    if (notificationListView != null)
                    {
                        detailWorkItem.Items.Remove(notificationListView);
                    }
                    notificationListView = detailWorkItem.Items.AddNew <NotificationList>(notificationKey);
                    var info = new XtraWindowSmartPartInfo {
                        Size = new Size(850, 400), StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = Properties.Resources.Notification + "   "
                    };
                    detailWorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(notificationListView, info);
                };
                notificationItem.Glyph = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("notificationb");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { notificationItem });

                //send sys msg
                var sysMsgItem = new BarStaticItem();
                sysMsgItem.Caption = Properties.Resources.SendSysMessage;
                Ribbon.Items.Add(sysMsgItem);
                sysMsgItem.ItemClick += (s, e) =>
                {
                    string sysMsgKey      = "SendSysMsg";
                    var    detailWorkItem = Items.Get <WorkItem>(sysMsgKey);
                    if (detailWorkItem == null)
                    {
                        detailWorkItem = Items.AddNew <WorkItem>(sysMsgKey);
                    }
                    detailWorkItem.Run();
                    var sysMsgView = detailWorkItem.Items.Get <SendSysNotification>(sysMsgKey);
                    if (sysMsgView != null)
                    {
                        detailWorkItem.Items.Remove(sysMsgView);
                    }
                    sysMsgView = detailWorkItem.Items.AddNew <SendSysNotification>(sysMsgKey);
                    var info = new XtraWindowSmartPartInfo {
                        StartPosition = FormStartPosition.CenterParent, Icon = Properties.Resources.ri_Katrin, Modal = true, Title = Properties.Resources.SendSysMessage
                    };
                    detailWorkItem.Workspaces[WorkspaceNames.ModalWindows].Show(sysMsgView, info);
                };
                sysMsgItem.Glyph = (System.Drawing.Bitmap)Properties.Resources.ResourceManager.GetObject("sendsysmsg");
                Ribbon.PageHeaderItemLinks.AddRange(new BarItem[] { sysMsgItem });
            }
        }