Exemplo n.º 1
0
 private void InitializeComponent()
 {
     this.referenceButton1 = new LTR.UI.Management.Dispatchering.ReferenceButton();
     this.SuspendLayout();
     //
     // referenceButton1
     //
     this.referenceButton1.ActiveColor                = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(200)))), ((int)(((byte)(40)))));
     this.referenceButton1.BackColor                  = System.Drawing.Color.White;
     this.referenceButton1.CurrentBorderColor         = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(148)))), ((int)(((byte)(148)))));
     this.referenceButton1.CurrentColor               = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(223)))), ((int)(((byte)(254)))));
     this.referenceButton1.Cursor                     = System.Windows.Forms.Cursors.Hand;
     this.referenceButton1.Displayer                  = null;
     this.referenceButton1.DisplayerText              = null;
     this.referenceButton1.Entity                     = null;
     this.referenceButton1.ExtendedColor              = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
     this.referenceButton1.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(148)))), ((int)(((byte)(148)))), ((int)(((byte)(148)))));
     this.referenceButton1.FlatAppearance.BorderSize  = 2;
     this.referenceButton1.FlatStyle                  = System.Windows.Forms.FlatStyle.Flat;
     this.referenceButton1.Font                    = new System.Drawing.Font("Tahoma", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
     this.referenceButton1.Hoverable               = true;
     this.referenceButton1.InactiveColor           = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(219)))), ((int)(((byte)(219)))));
     this.referenceButton1.Location                = new System.Drawing.Point(4, 219);
     this.referenceButton1.Name                    = "referenceButton1";
     this.referenceButton1.NormalColor             = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(223)))), ((int)(((byte)(254)))));
     this.referenceButton1.Padding                 = new System.Windows.Forms.Padding(2);
     this.referenceButton1.ReflectionType          = LTR.UI.Management.Dispatchering.ReflectionTypes.DisplayInNew;
     this.referenceButton1.Selected                = false;
     this.referenceButton1.Size                    = new System.Drawing.Size(194, 54);
     this.referenceButton1.TabIndex                = 8;
     this.referenceButton1.Text                    = "referenceButton1";
     this.referenceButton1.TextAlign               = System.Drawing.ContentAlignment.MiddleLeft;
     this.referenceButton1.TextImageRelation       = System.Windows.Forms.TextImageRelation.ImageBeforeText;
     this.referenceButton1.UseVisualStyleBackColor = true;
     this.referenceButton1.Click                  += new System.EventHandler(this.referenceButton1_Click);
     //
     // DispatcheredUIOperators
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 16F);
     this.Controls.Add(this.referenceButton1);
     this.Name = "DispatcheredUIOperators";
     this.Controls.SetChildIndex(this.referenceButton1, 0);
     this.ResumeLayout(false);
 }
        public UIDictionaryTypeCollection()
        {
            Width  = MIN_CONTROL_WIDTH;
            Height = MIN_CONTROL_HEIGHT;

            titleControl          = new UITitleControl("Dictionaries");
            copyrightControl      = new UICopyrightControl();
            listViewControl       = new ListView();
            buttonAdd             = new ReferenceButton();
            buttonReload          = new AvButton();
            buttonDelete          = new AvButton();
            buttonEdit            = new ReferenceButton();
            buttonHelp            = new HelpRequestingButton("Some page");//todo
            buttonClose           = new ReferenceButton();
            columnHeaderID        = new ListViewHeader(COLUMN_ID_TEXT, COLUMN_ID_WIDTH);
            columnHeaderSmallName = new ListViewHeader(COLUMN_SMALL_NAME_TEXT, COLUMN_SMALL_NAME_WIDTH);
            columnHeaderFullName  = new ListViewHeader(COLUMN_FULL_NAME_TEXT, COLUMN_FULL_NAME_WIDTH);
            icons = new Icons();

            titleControl.Dock     = DockStyle.Top;
            copyrightControl.Dock = DockStyle.Bottom;
            //
            // buttonAdd
            //
            buttonAdd.Location            = new Point(Width - buttonAdd.Width - BUTTONS_MARGIN, titleControl.Height + BUTTONS_MARGIN);
            buttonAdd.Image               = icons.Add;
            buttonAdd.Text                = "Add";
            buttonAdd.DisplayerText       = "Add";//todo
            buttonAdd.ReflectionType      = ReflectionTypes.DisplayInNew;
            buttonAdd.DisplayerRequested += buttonAdd_DisplayerRequested;
            //
            // buttonReload
            //
            buttonReload.Location = new Point(Width - buttonReload.Width - BUTTONS_MARGIN,
                                              titleControl.Height + BUTTONS_MARGIN + BUTTONS_INTERVAL + buttonDelete.Height);
            buttonReload.Image  = icons.Reload;
            buttonReload.Text   = "Reload";
            buttonReload.Click += buttonReload_Click;
            //
            // buttonDelete
            //
            buttonDelete.Location = new Point(Width - buttonDelete.Width - BUTTONS_MARGIN,
                                              titleControl.Height + BUTTONS_MARGIN + 2 * (BUTTONS_INTERVAL + buttonReload.Height));
            buttonDelete.Enabled = false;
            buttonDelete.Image   = icons.Delete;
            buttonDelete.Text    = "Delete";
            buttonDelete.Click  += buttonDelete_Click;
            //
            // buttonEdit
            //
            buttonEdit.Location = new Point(Width - buttonEdit.Width - BUTTONS_MARGIN,
                                            titleControl.Height + BUTTONS_MARGIN + 3 * (BUTTONS_INTERVAL + buttonEdit.Height));
            buttonEdit.Enabled             = false;
            buttonEdit.Image               = icons.Edit;
            buttonEdit.Text                = "Edit";
            buttonEdit.DisplayerText       = "Edit";
            buttonEdit.ReflectionType      = ReflectionTypes.DisplayInCurrent;
            buttonEdit.DisplayerRequested += buttonEdit_DisplayerRequested;
            //
            // buttonHelp
            //
            buttonHelp.Location = new Point(Width - buttonHelp.Width - BUTTONS_MARGIN,
                                            titleControl.Height + BUTTONS_MARGIN + 4 * (BUTTONS_INTERVAL + buttonHelp.Height));
            buttonHelp.Image = icons.Help;
            buttonHelp.Text  = "Help";
            //
            // buttonClose
            //
            buttonClose.Location = new Point(Width - buttonClose.Width - BUTTONS_MARGIN,
                                             titleControl.Height + BUTTONS_MARGIN + 5 * (BUTTONS_INTERVAL + buttonClose.Height));
            buttonClose.Image          = icons.Close;
            buttonClose.Text           = "Close";
            buttonClose.ReflectionType = ReflectionTypes.CloseSelected;
            //
            // listViewControl
            //
            listViewControl.Location              = new Point(BUTTONS_MARGIN, titleControl.Height + BUTTONS_MARGIN);
            listViewControl.Size                  = new Size(Width - buttonAdd.Width - 3 * BUTTONS_MARGIN, Height - titleControl.Height - copyrightControl.Height - 2 * BUTTONS_MARGIN);
            listViewControl.View                  = View.Details;
            listViewControl.SizeChanged          += listViewControl_SizeChanged;
            listViewControl.FullRowSelect         = true;
            listViewControl.ItemSelectionChanged += listViewControl_ItemSelectionChanged;

            listViewHeaders.CollectionChanged += listViewHeaders_CollectionChanged;

            Controls.Add(titleControl);
            Controls.Add(copyrightControl);
            Controls.Add(listViewControl);
            Controls.Add(buttonAdd);
            Controls.Add(buttonReload);
            Controls.Add(buttonDelete);
            Controls.Add(buttonEdit);
            Controls.Add(buttonHelp);
            Controls.Add(buttonClose);

            listViewHeaders.Add(columnHeaderID);
            listViewHeaders.Add(columnHeaderSmallName);
            listViewHeaders.Add(columnHeaderFullName);


            if (!(Users.CurrentUser.Role == UserRole.Administrator))
            {
                buttonDelete.Enabled = true;
                buttonEdit.Enabled   = true;
            }
            else
            {
                buttonDelete.Enabled = false;
                buttonEdit.Enabled   = false;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Создает элемент управления для отображеия списка эксплуатантов
        /// </summary>
        public UIOperatorCollection()
        {
            titleControl      = new UITitleControl("Operators");
            copyrightControl  = new UICopyrightControl();
            buttonMenu        = new ReferenceButton();
            buttonReload      = new AvButton();
            buttonAddOperator = new ReferenceButton();
            buttonViewLog     = new ReferenceButton();
            buttonHelp        = new HelpRequestingButton("Some page");//todo
            buttonClose       = new ReferenceButton();
            displayerControl  = new UIDisplayerControl((buttonMenu.Width + BUTTONS_MARGIN * 2) * 2,
                                                       buttonMenu.Height * 6 + BUTTONS_INTERVAL * 5 + 2 * BUTTONS_MARGIN);
            icons   = new Icons();
            buttons = new List <ReferenceOperatorListItem>();

            Width                 = displayerControl.Width;
            Height                = titleControl.Height + displayerControl.Height + copyrightControl.Height;
            titleControl.Dock     = DockStyle.Top;
            copyrightControl.Dock = DockStyle.Bottom;
            displayerControl.DisplayerPanel.Padding = new Padding(BUTTONS_MARGIN - BUTTONS_INTERVAL);
            //
            // displayerControl
            //
            displayerControl.Top    = titleControl.Height;
            displayerControl.Left   = Left;
            displayerControl.Height = Height - titleControl.Height - copyrightControl.Height;
            displayerControl.Width  = Width;
            //
            // buttonMenu
            //
            buttonMenu.Location            = new Point(Width - buttonMenu.Width - BUTTONS_MARGIN, BUTTONS_MARGIN);
            buttonMenu.Image               = icons.Menu;
            buttonMenu.Text                = "Menu";
            buttonMenu.DisplayerText       = "StartPage";//todo
            buttonMenu.DisplayerRequested += buttonMenu_DisplayerRequested;
            buttonMenu.ReflectionType      = ReflectionTypes.DisplayInNew;
            //
            // buttonReload
            //
            buttonReload.Location = new Point(Width - buttonReload.Width - BUTTONS_MARGIN,
                                              BUTTONS_MARGIN + BUTTONS_INTERVAL + buttonReload.Height);
            buttonReload.Image  = icons.Reload;
            buttonReload.Text   = "Reload";
            buttonReload.Click += buttonReload_Click;
            //
            // buttonAddOperator
            //
            buttonAddOperator.Location = new Point(Width - buttonAddOperator.Width - BUTTONS_MARGIN,
                                                   BUTTONS_MARGIN + 2 * (BUTTONS_INTERVAL + buttonAddOperator.Height));
            buttonAddOperator.Image               = icons.Add;
            buttonAddOperator.Text                = "Add Operator";
            buttonAddOperator.DisplayerText       = "Add Operator";
            buttonAddOperator.DisplayerRequested += buttonAddOperator_DisplayerRequested;
            buttonAddOperator.ReflectionType      = ReflectionTypes.DisplayInNew;
            //
            // buttonViewLog
            //
            buttonViewLog.Location = new Point(Width - buttonViewLog.Width - BUTTONS_MARGIN,
                                               BUTTONS_MARGIN + 3 * (BUTTONS_INTERVAL + buttonViewLog.Height));
            buttonViewLog.Image               = icons.ViewLog;
            buttonViewLog.Text                = "View Log";
            buttonViewLog.DisplayerText       = "View Log";
            buttonViewLog.DisplayerRequested += buttonViewLog_DisplayerRequested;
            buttonViewLog.ReflectionType      = ReflectionTypes.DisplayInNew;
            //
            // buttonHelp
            //
            buttonHelp.Location = new Point(Width - buttonHelp.Width - BUTTONS_MARGIN,
                                            BUTTONS_MARGIN + 4 * (BUTTONS_INTERVAL + buttonHelp.Height));
            buttonHelp.Image = icons.Help;
            buttonHelp.Text  = "Help";
            //
            // buttonClose
            //
            buttonClose.Location = new Point(Width - buttonClose.Width - BUTTONS_MARGIN,
                                             BUTTONS_MARGIN + 5 * (BUTTONS_INTERVAL + buttonClose.Height));
            buttonClose.Image          = icons.Close;
            buttonClose.Text           = "Close";
            buttonClose.ReflectionType = ReflectionTypes.CloseSelected;

            Initialize();

            Controls.Add(titleControl);
            Controls.Add(copyrightControl);
            Controls.Add(displayerControl);

            displayerControl.Controls.Add(buttonMenu);
            displayerControl.Controls.Add(buttonReload);
            displayerControl.Controls.Add(buttonAddOperator);
            displayerControl.Controls.Add(buttonViewLog);
            displayerControl.Controls.Add(buttonHelp);
            displayerControl.Controls.Add(buttonClose);

            //WaitingControlReload.Start();
            //WaitingControlReload.Left = Width / 2 - WaitingControlReload.Width / 2;
            //WaitingControlReload.Height = Height / 2 - WaitingControlReload.Height / 2;
            //WaitingControlReload.Visible = false;//todo

            if (!(Users.CurrentUser.Role == UserRole.Administrator) && !(Users.CurrentUser.Role == UserRole.Technician))
            {
                buttonAddOperator.Enabled = false;
            }

            //MessageBox.Show("Ы-ы-ы!");
        }