Пример #1
0
        public MyAccordionControl01()
        {
            InitializeComponent();
            this.accordionControl1.ExpandElementMode = DevExpress.XtraBars.Navigation.ExpandElementMode.Multiple;

            for (int x = 0; x < 20; x++)
            {
                DevExpress.XtraBars.Navigation.AccordionControlElement   accordionControlElement1   = new DevExpress.XtraBars.Navigation.AccordionControlElement();
                DevExpress.XtraBars.Navigation.AccordionContentContainer accordionContentContainer1 = new DevExpress.XtraBars.Navigation.AccordionContentContainer();
                ////accordionControlElement3.ContentContainer = this.accordionContentContainer2;
                accordionContentContainer1.Controls.Add(new DevExpress.XtraGrid.GridControl()
                {
                    Dock = System.Windows.Forms.DockStyle.Fill
                });
                //accordionControlElement1.Expanded = true;
                //accordionControlElement1.HeaderVisible = true;
                //accordionControlElement3.Name = "accordionControlElement3";
                accordionControlElement1.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                accordionControlElement1.Text  = "설비" + (x + 1);
                //accordionControlElement1.Appearance.Normal.BackColor = System.Drawing.Color.Red;
                //accordionControlElement1.Appearance.Hovered.BackColor = System.Drawing.Color.Salmon;
                accordionControlElement1.ContentContainer = accordionContentContainer1;
                accordionControl1.Elements.Add(accordionControlElement1);
                this.accordionControl1.Controls.Add(accordionContentContainer1);
            }
        }
Пример #2
0
        private void AddFavorite(DevExpress.XtraBars.Navigation.AccordionControlElement target, List <string> companyNames)
        {
            foreach (var companyName in companyNames)
            {
                var ace = new DevExpress.XtraBars.Navigation.AccordionControlElement();
                ace.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                ace.Text   = companyName;
                ace.Click += new EventHandler(AccordionControlElements_Click);

                target.Elements.Add(ace);
            }
        }
Пример #3
0
 public void BindAccordionItemTabpageClick(DevExpress.XtraBars.Navigation.AccordionControlElement ele, XtraTabControl xtraTabControl)
 {
     //添加点击后动态添加tabpage事件
     ele.Click += (s, e) =>
     {
         AddNewPageIfNotExist(ele.Text.Trim(), xtraTabControl);
         SelectPageByTitle(ele.Text.Trim(), xtraTabControl);
     };
     //添加点击后的第二个事件 tabpage上的tag字符串绑定的UserControl 反射实例化后绑定到tabpage上去
     ele.Click += (s, e) =>
     {
         AccordionControl_Load_TabpageControl_Click(s, e, xtraTabControl);
     };
 }
Пример #4
0
        public void AddQQManageAccordionItem(string name, string text, string tag)
        {
            text = AccordionControlUtil.Instance.GetThisGroupItemName(this.accordionHome_QQManageGroup.Elements, text, text);
            var ele = new DevExpress.XtraBars.Navigation.AccordionControlElement()
            {
                Name  = name,
                Text  = text,
                Tag   = tag,
                Style = DevExpress.XtraBars.Navigation.ElementStyle.Item
            };

            this.accordionHome_QQManageGroup.Elements.Add(ele);
            AccordionControlUtil.Instance.BindAccordionItemTabpageClick(ele, xtraTabControl);
        }
Пример #5
0
        private void FillCoinList()
        {
            var url      = "https://www.bithumb.com/trade/order/BTC";
            var coinList = WebController.controller.WebCrawler.GetCoinList(url);

            foreach (var coin in coinList)
            {
                var element = new DevExpress.XtraBars.Navigation.AccordionControlElement();

                element.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                element.Text   = coin;
                element.Click += new EventHandler(Elements_Click);

                CoinElement.Elements.Add(element);
            }
        }
Пример #6
0
        private Dictionary <string, List <string> > FillCoinList()
        {
            string url  = "https://www.bithumb.com/trade/order/BTC";
            var    data = DataController.Controller.WebCrawler.Url2Data(url);

            var names = data["names"];

            foreach (var name in names)
            {
                var ace = new DevExpress.XtraBars.Navigation.AccordionControlElement();
                ace.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                ace.Text   = name;
                ace.Click += new EventHandler(CoinTab_Click);

                aces.Add(ace);
                acgCoinList.Elements.Add(ace);
            }

            return(data);
        }
Пример #7
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     DevExpress.XtraBars.Navigation.AccordionControlElement btnSales;
     this.btnOrder                 = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnSaleOrderList         = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnPayment               = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.repositoryItemImageEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemImageEdit();
     this.sideRight                = new DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormContainer();
     this.sideLeft                 = new DevExpress.XtraBars.Navigation.AccordionControl();
     this.btnDashboard             = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnStock                 = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnImport                = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnProduct               = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnCustomer              = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnSupplier              = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnStaff                 = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnReport                = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnSaleReport            = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnSettings              = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnCompanyDetails        = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.btnGeneral               = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.barEditItem1             = new DevExpress.XtraBars.BarEditItem();
     this.btnName = new DevExpress.XtraBars.BarButtonItem();
     this.accordionControlElement1 = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     this.toolbarFormManager       = new DevExpress.XtraBars.ToolbarForm.ToolbarFormManager(this.components);
     this.barDockControlTop        = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlBottom     = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlLeft       = new DevExpress.XtraBars.BarDockControl();
     this.barDockControlRight      = new DevExpress.XtraBars.BarDockControl();
     this.fluentDesignFormControl1 = new DevExpress.XtraBars.FluentDesignSystem.FluentDesignFormControl();
     btnSales = new DevExpress.XtraBars.Navigation.AccordionControlElement();
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemImageEdit2)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.sideLeft)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.toolbarFormManager)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.fluentDesignFormControl1)).BeginInit();
     this.SuspendLayout();
     //
     // btnSales
     //
     btnSales.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     btnSales.Appearance.Hovered.Options.UseBackColor = true;
     btnSales.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] {
         this.btnOrder,
         this.btnSaleOrderList,
         this.btnPayment
     });
     btnSales.HeaderTemplate.AddRange(new DevExpress.XtraBars.Navigation.HeaderElementInfo[] {
         new DevExpress.XtraBars.Navigation.HeaderElementInfo(DevExpress.XtraBars.Navigation.HeaderElementType.Text),
         new DevExpress.XtraBars.Navigation.HeaderElementInfo(DevExpress.XtraBars.Navigation.HeaderElementType.Image),
         new DevExpress.XtraBars.Navigation.HeaderElementInfo(DevExpress.XtraBars.Navigation.HeaderElementType.HeaderControl),
         new DevExpress.XtraBars.Navigation.HeaderElementInfo(DevExpress.XtraBars.Navigation.HeaderElementType.ContextButtons)
     });
     btnSales.Name = "btnSales";
     btnSales.Text = "Sales";
     //
     // btnOrder
     //
     this.btnOrder.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnOrder.Appearance.Hovered.Options.UseBackColor = true;
     this.btnOrder.Name   = "btnOrder";
     this.btnOrder.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnOrder.Text   = "Order Product";
     this.btnOrder.Click += new System.EventHandler(this.BtnSale_Click);
     //
     // btnSaleOrderList
     //
     this.btnSaleOrderList.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnSaleOrderList.Appearance.Hovered.Options.UseBackColor = true;
     this.btnSaleOrderList.Name   = "btnSaleOrderList";
     this.btnSaleOrderList.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnSaleOrderList.Text   = "Sale Order List";
     this.btnSaleOrderList.Click += new System.EventHandler(this.btnSaleOrderList_Click);
     //
     // btnPayment
     //
     this.btnPayment.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnPayment.Appearance.Hovered.Options.UseBackColor = true;
     this.btnPayment.Name   = "btnPayment";
     this.btnPayment.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnPayment.Text   = "Payment";
     this.btnPayment.Click += new System.EventHandler(this.btnPayment_Click);
     //
     // repositoryItemImageEdit2
     //
     this.repositoryItemImageEdit2.AutoHeight = false;
     this.repositoryItemImageEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
         new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)
     });
     this.repositoryItemImageEdit2.Name = "repositoryItemImageEdit2";
     //
     // sideRight
     //
     this.sideRight.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.sideRight.Location = new System.Drawing.Point(260, 31);
     this.sideRight.Name     = "sideRight";
     this.sideRight.Size     = new System.Drawing.Size(790, 592);
     this.sideRight.TabIndex = 0;
     //
     // sideLeft
     //
     this.sideLeft.AnimationType = DevExpress.XtraBars.Navigation.AnimationType.Office2016;
     this.sideLeft.Appearance.Group.Hovered.BackColor            = System.Drawing.Color.White;
     this.sideLeft.Appearance.Group.Hovered.ForeColor            = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
     this.sideLeft.Appearance.Group.Hovered.Options.UseBackColor = true;
     this.sideLeft.Appearance.Group.Hovered.Options.UseForeColor = true;
     this.sideLeft.Appearance.Item.Hovered.ForeColor             = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
     this.sideLeft.Appearance.Item.Hovered.Options.UseForeColor  = true;
     this.sideLeft.Dock = System.Windows.Forms.DockStyle.Left;
     this.sideLeft.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] {
         this.btnDashboard,
         btnSales,
         this.btnStock,
         this.btnCustomer,
         this.btnSupplier,
         this.btnStaff,
         this.btnReport,
         this.btnSettings
     });
     this.sideLeft.Location          = new System.Drawing.Point(0, 31);
     this.sideLeft.Name              = "sideLeft";
     this.sideLeft.ScrollBarMode     = DevExpress.XtraBars.Navigation.ScrollBarMode.Hidden;
     this.sideLeft.ShowFilterControl = DevExpress.XtraBars.Navigation.ShowFilterControl.Always;
     this.sideLeft.Size              = new System.Drawing.Size(260, 592);
     this.sideLeft.TabIndex          = 1;
     this.sideLeft.ViewType          = DevExpress.XtraBars.Navigation.AccordionControlViewType.HamburgerMenu;
     //
     // btnDashboard
     //
     this.btnDashboard.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnDashboard.Appearance.Hovered.Options.UseBackColor = true;
     this.btnDashboard.Appearance.Normal.Font            = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnDashboard.Appearance.Normal.Options.UseFont = true;
     this.btnDashboard.Name   = "btnDashboard";
     this.btnDashboard.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnDashboard.Text   = "Dashboard";
     this.btnDashboard.Click += new System.EventHandler(this.BtnDashboard_Click);
     //
     // btnStock
     //
     this.btnStock.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnStock.Appearance.Hovered.Options.UseBackColor = true;
     this.btnStock.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] {
         this.btnImport,
         this.btnProduct
     });
     this.btnStock.Name = "btnStock";
     this.btnStock.Text = "Stock";
     //
     // btnImport
     //
     this.btnImport.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnImport.Appearance.Hovered.Options.UseBackColor = true;
     this.btnImport.Name   = "btnImport";
     this.btnImport.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnImport.Text   = "Import";
     this.btnImport.Click += new System.EventHandler(this.BtnImport_Click);
     //
     // btnProduct
     //
     this.btnProduct.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnProduct.Appearance.Hovered.Options.UseBackColor = true;
     this.btnProduct.Name   = "btnProduct";
     this.btnProduct.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnProduct.Text   = "Products";
     this.btnProduct.Click += new System.EventHandler(this.BtnProduct_Click);
     //
     // btnCustomer
     //
     this.btnCustomer.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnCustomer.Appearance.Hovered.Options.UseBackColor = true;
     this.btnCustomer.Appearance.Normal.Font            = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnCustomer.Appearance.Normal.Options.UseFont = true;
     this.btnCustomer.Name   = "btnCustomer";
     this.btnCustomer.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnCustomer.Text   = "Customers";
     this.btnCustomer.Click += new System.EventHandler(this.BtnCustomer_Click);
     //
     // btnSupplier
     //
     this.btnSupplier.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnSupplier.Appearance.Hovered.Options.UseBackColor = true;
     this.btnSupplier.Appearance.Normal.Font            = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnSupplier.Appearance.Normal.Options.UseFont = true;
     this.btnSupplier.Name   = "btnSupplier";
     this.btnSupplier.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnSupplier.Text   = "Supplier";
     this.btnSupplier.Click += new System.EventHandler(this.btnSupplier_Click);
     //
     // btnStaff
     //
     this.btnStaff.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnStaff.Appearance.Hovered.Options.UseBackColor = true;
     this.btnStaff.Appearance.Normal.Font            = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.btnStaff.Appearance.Normal.Options.UseFont = true;
     this.btnStaff.Name   = "btnStaff";
     this.btnStaff.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnStaff.Text   = "Staff";
     this.btnStaff.Click += new System.EventHandler(this.btnStaff_Click);
     //
     // btnReport
     //
     this.btnReport.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] {
         this.btnSaleReport
     });
     this.btnReport.Name = "btnReport";
     this.btnReport.Text = "Reports";
     //
     // btnSaleReport
     //
     this.btnSaleReport.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnSaleReport.Appearance.Hovered.Options.UseBackColor = true;
     this.btnSaleReport.Name  = "btnSaleReport";
     this.btnSaleReport.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnSaleReport.Text  = "Sale Report";
     //
     // btnSettings
     //
     this.btnSettings.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnSettings.Appearance.Hovered.Options.UseBackColor = true;
     this.btnSettings.Elements.AddRange(new DevExpress.XtraBars.Navigation.AccordionControlElement[] {
         this.btnCompanyDetails,
         this.btnGeneral
     });
     this.btnSettings.Name    = "btnSettings";
     this.btnSettings.Text    = "Settings";
     this.btnSettings.Visible = false;
     //
     // btnCompanyDetails
     //
     this.btnCompanyDetails.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnCompanyDetails.Appearance.Hovered.Options.UseBackColor = true;
     this.btnCompanyDetails.Name  = "btnCompanyDetails";
     this.btnCompanyDetails.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnCompanyDetails.Text  = "Company Details";
     //
     // btnGeneral
     //
     this.btnGeneral.Appearance.Hovered.BackColor            = System.Drawing.Color.White;
     this.btnGeneral.Appearance.Hovered.Options.UseBackColor = true;
     this.btnGeneral.Name  = "btnGeneral";
     this.btnGeneral.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.btnGeneral.Text  = "General";
     //
     // barEditItem1
     //
     this.barEditItem1.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
     this.barEditItem1.Caption   = "barEditItem1";
     this.barEditItem1.Edit      = this.repositoryItemImageEdit2;
     this.barEditItem1.Id        = 0;
     this.barEditItem1.Name      = "barEditItem1";
     //
     // btnName
     //
     this.btnName.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
     this.btnName.Border    = DevExpress.XtraEditors.Controls.BorderStyles.Flat;
     this.btnName.Caption   = "Name";
     this.btnName.Id        = 1;
     this.btnName.Name      = "btnName";
     //
     // accordionControlElement1
     //
     this.accordionControlElement1.Appearance.Normal.Font            = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.accordionControlElement1.Appearance.Normal.Options.UseFont = true;
     this.accordionControlElement1.Name  = "accordionControlElement1";
     this.accordionControlElement1.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
     this.accordionControlElement1.Text  = "Dashboard";
     //
     // toolbarFormManager
     //
     this.toolbarFormManager.DockControls.Add(this.barDockControlTop);
     this.toolbarFormManager.DockControls.Add(this.barDockControlBottom);
     this.toolbarFormManager.DockControls.Add(this.barDockControlLeft);
     this.toolbarFormManager.DockControls.Add(this.barDockControlRight);
     this.toolbarFormManager.Form = this;
     //
     // barDockControlTop
     //
     this.barDockControlTop.CausesValidation = false;
     this.barDockControlTop.Dock             = System.Windows.Forms.DockStyle.Top;
     this.barDockControlTop.Location         = new System.Drawing.Point(0, 31);
     this.barDockControlTop.Manager          = this.toolbarFormManager;
     this.barDockControlTop.Size             = new System.Drawing.Size(1050, 0);
     //
     // barDockControlBottom
     //
     this.barDockControlBottom.CausesValidation = false;
     this.barDockControlBottom.Dock             = System.Windows.Forms.DockStyle.Bottom;
     this.barDockControlBottom.Location         = new System.Drawing.Point(0, 623);
     this.barDockControlBottom.Manager          = this.toolbarFormManager;
     this.barDockControlBottom.Size             = new System.Drawing.Size(1050, 0);
     //
     // barDockControlLeft
     //
     this.barDockControlLeft.CausesValidation = false;
     this.barDockControlLeft.Dock             = System.Windows.Forms.DockStyle.Left;
     this.barDockControlLeft.Location         = new System.Drawing.Point(0, 31);
     this.barDockControlLeft.Manager          = this.toolbarFormManager;
     this.barDockControlLeft.Size             = new System.Drawing.Size(0, 592);
     //
     // barDockControlRight
     //
     this.barDockControlRight.CausesValidation = false;
     this.barDockControlRight.Dock             = System.Windows.Forms.DockStyle.Right;
     this.barDockControlRight.Location         = new System.Drawing.Point(1050, 31);
     this.barDockControlRight.Manager          = this.toolbarFormManager;
     this.barDockControlRight.Size             = new System.Drawing.Size(0, 592);
     //
     // fluentDesignFormControl1
     //
     this.fluentDesignFormControl1.FluentDesignForm = this;
     this.fluentDesignFormControl1.Location         = new System.Drawing.Point(0, 0);
     this.fluentDesignFormControl1.Name             = "fluentDesignFormControl1";
     this.fluentDesignFormControl1.Size             = new System.Drawing.Size(1050, 31);
     this.fluentDesignFormControl1.TabIndex         = 4;
     this.fluentDesignFormControl1.TabStop          = false;
     //
     // MainView
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
     this.ClientSize          = new System.Drawing.Size(1050, 623);
     this.ControlContainer    = this.sideRight;
     this.Controls.Add(this.sideRight);
     this.Controls.Add(this.sideLeft);
     this.Controls.Add(this.barDockControlLeft);
     this.Controls.Add(this.barDockControlRight);
     this.Controls.Add(this.barDockControlBottom);
     this.Controls.Add(this.barDockControlTop);
     this.Controls.Add(this.fluentDesignFormControl1);
     this.FluentDesignFormControl = this.fluentDesignFormControl1;
     this.FormBorderEffect        = DevExpress.XtraEditors.FormBorderEffect.Shadow;
     this.Name = "MainView";
     this.NavigationControl = this.sideLeft;
     this.StartPosition     = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text  = "MainView";
     this.Load += new System.EventHandler(this.MainView_Load);
     ((System.ComponentModel.ISupportInitialize)(this.repositoryItemImageEdit2)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.sideLeft)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.toolbarFormManager)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.fluentDesignFormControl1)).EndInit();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Пример #8
0
        private void Arranger(WindowsIdentity Identity)
        {
            var Person = worker.EmployeeService.Get(c => c.ComputerIdentity == Identity.Name);

            if (Person == null)
            {
                MessageBox.Show("Bilgisayar, programı kullanmaya yetkili değil.");

                return;
            }

            switch (Person.Authority)
            {
            case AuthorityTypes.Viewer:

                foreach (var Factory in worker.FactoryService.GetList(null))
                {
                    var ViewerButton = new DevExpress.XtraBars.Navigation.AccordionControlElement {
                        Text = Factory.FactoryName
                    };
                    foreach (var Machine in worker.MachineService.GetList(c => c.FactoryId == Factory.ID))
                    {
                        var Item = new DevExpress.XtraBars.Navigation.AccordionControlElement {
                            Text = Machine.Name
                        };
                        ViewerButton.Elements.Add(Item);
                        Item.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                        Item.Click += (object sender, EventArgs e) =>
                        {
                            var control = new DataMonitoringControl(Factory.FactoryName, worker)
                            {
                                Dock = DockStyle.Fill
                            };

                            fluentDesignFormContainer1.Controls.Add(control);
                            control.BringToFront();
                        };
                    }
                    DataMonitoring.Elements.Add(ViewerButton);
                }

                break;

            case AuthorityTypes.Manipulator:

                var Manipulator = (ManipulatorEmployee)Person;
                var MyFactory   = worker.FactoryService.Get(c => c.ID == Manipulator.FactoryId);
                var Button      = new DevExpress.XtraBars.Navigation.AccordionControlElement {
                    Text = MyFactory.FactoryName
                };
                Parallel.ForEach(worker.MachineService.GetList(c => c.FactoryId == Manipulator.RelatedFactory.ID), Machine =>
                {
                    var Item = new DevExpress.XtraBars.Navigation.AccordionControlElement {
                        Text = Machine.Name
                    };
                    Button.Elements.Add(Item);
                    Item.Style  = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                    Item.Click += (object sender, EventArgs e) =>
                    {
                        var control = new DataMonitoringControl(MyFactory.FactoryName, worker)
                        {
                            Dock = DockStyle.Fill
                        };

                        fluentDesignFormContainer1.Controls.Add(control);
                        control.BringToFront();
                    };
                }
                                 );

                //foreach (var Machine in worker.MachineService.GetList(c => c.FactoryId == Manipulator.RelatedFactory.ID))
                //{
                //    var Item = new DevExpress.XtraBars.Navigation.AccordionControlElement { Text = Machine.Name };
                //    Button.Elements.Add(Item);
                //    Item.Style = DevExpress.XtraBars.Navigation.ElementStyle.Item;
                //    Item.Click += (object sender, EventArgs e) =>
                //    {
                //        var control = new DataMonitoringControl()
                //        {
                //            Dock = DockStyle.Fill
                //        };

                //        fluentDesignFormContainer1.Controls.Add(control);
                //        control.BringToFront();
                //    };
                //}
                DataMonitoring.Elements.Add(Button);
                break;

            default:
                MessageBox.Show("Yanlışlık var !");
                break;
            }
        }