Пример #1
0
        private void InitializeMainPanel()
        {
            m_mainPanel = new MetroPanel();
            MetroSkinManager.ApplyMetroStyle(m_mainPanel);
            m_mainPanel.Dock    = DockStyle.Fill;
            m_mainPanel.Padding = new Padding(20, 2, 20, 20);
            Controls.Add(m_mainPanel);

            // tabs.
            m_mainPanelTabs = new MetroTabControl();
            MetroSkinManager.ApplyMetroStyle(m_mainPanelTabs);
            m_mainPanelTabs.Left   = m_mainPanel.Padding.Left;
            m_mainPanelTabs.Top    = m_mainPanel.Padding.Top;
            m_mainPanelTabs.Width  = m_mainPanel.Width - m_mainPanel.Padding.Horizontal;
            m_mainPanelTabs.Height = m_mainPanel.Height - m_mainPanel.Padding.Vertical;
            m_mainPanelTabs.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom;
            m_mainPanel.Controls.Add(m_mainPanelTabs);

            // initial pages.
            InitializeWelcomePage();
            InitializeSettingsPage();
            InitializeProjectPage();

            // sub-panels.
            InitializeLeftPanel();
            InitializeRightPanel();
            InitializeBottomPanel();
        }
Пример #2
0
 //en/disabling all controls in tab
 public void EnableTab(MetroTabControl page, bool enable)
 {
     foreach (Control ctl in page.Controls)
     {
         ctl.Enabled = enable;
     }
 }
Пример #3
0
 internal AccountControl(MetroTabControl tabControl, int totalCount, int activeCount, int newSet,
                         MetroStyleManager styleManager, Account account)
 {
     _account = account;
     FixControls(newSet, styleManager, account);
     AddControlsToForm(tabControl, styleManager, activeCount, newSet);
     ID = totalCount;
     BindEvents();
 }
Пример #4
0
        public static void CerrarTab(Form form)
        {
            TabPage         tabPage    = (TabPage)form.Parent;
            MetroTabControl tabControl = (MetroTabControl)tabPage.Parent;

            form.Close();
            tabControl.TabPages.Remove(tabPage);
            tabPage.Dispose();
        }
Пример #5
0
        MetroMenuTabItem FindMainTabItem(MetroTabControl subTabControl)
        {
            var grid = subTabControl.Parent as FrameworkElement;

            if (grid != null)
            {
                var mainTabItem = grid.Parent as MetroMenuTabItem;
                return(mainTabItem);
            }
            return(null);
        }
Пример #6
0
        /// <summary>
        /// 各种空间的初始化函数
        /// </summary>
        protected void Init_userControls()
        {
            //刷新按钮
            button_refreshHostList          = new MetroButton();
            button_refreshHostList.Location = new Point(336, 60);
            button_refreshHostList.Text     = "刷新";
            button_refreshHostList.Size     = new System.Drawing.Size(61, 24);
            button_refreshHostList.KeyDown += new KeyEventHandler(this.mainForm_KeyDown);
            button_refreshHostList.Click   += new EventHandler(button_refreshHostList_Clicked);
            this.Controls.Add(button_refreshHostList);

            //浏览按钮
            button_exploreFile          = new MetroButton();
            button_exploreFile.Location = new Point(330 - 61, 390);
            button_exploreFile.Text     = "浏览";
            button_exploreFile.Visible  = false;
            button_exploreFile.Size     = new System.Drawing.Size(61, 24);
            button_exploreFile.KeyDown += new KeyEventHandler(this.mainForm_KeyDown);
            button_exploreFile.Click   += new EventHandler(this.button_exploreFile_Click);
            this.Controls.Add(button_exploreFile);

            //发送按钮
            button_SendFile          = new MetroButton();
            button_SendFile.Location = new Point(355, 390);
            button_SendFile.Text     = "发送";
            button_SendFile.Visible  = false;
            button_SendFile.Size     = new System.Drawing.Size(61, 24);
            button_SendFile.KeyDown += new KeyEventHandler(this.mainForm_KeyDown);
            button_SendFile.Click   += new EventHandler(this.button_sendFile_Click);
            this.Controls.Add(button_SendFile);

            //刷新文件列表按钮
            button_refreshFileList          = new MetroButton();
            button_refreshFileList.Location = new Point(342, 390);
            button_refreshFileList.Text     = "刷新文件";
            button_refreshFileList.Height   = 24;
            button_refreshFileList.Visible  = true;
            button_refreshFileList.KeyDown += new KeyEventHandler(this.mainForm_KeyDown);
            button_refreshFileList.Click   += new EventHandler(this.button_refreshFileList_Click);
            this.Controls.Add(button_refreshFileList);

            //TabControl
            tabCtr_sendRecv      = new MetroTabControl();
            tabCtr_sendRecv.Size = new Size(397, 306);
            tabCtr_sendRecv.TabPages.Add("接收");
            tabCtr_sendRecv.TabPages.Add("发送");
            tabCtr_sendRecv.TabPages[0].Controls.Add(listView_fileRecv);
            tabCtr_sendRecv.TabPages[1].Controls.Add(listView_fileSend);
            tabCtr_sendRecv.Location              = new Point(24, 390);
            tabCtr_sendRecv.SelectedIndexChanged += new EventHandler(tabCtr_sendRecv_SelectedIndexChanged);
            this.Controls.Add(tabCtr_sendRecv);
        }
        private void OnAddPage(object sender, EventArgs e)
        {
            MetroTabControl control = (MetroTabControl)this.Control;

            System.Windows.Forms.Control.ControlCollection controls = control.Controls;
            base.RaiseComponentChanging(TypeDescriptor.GetProperties(control)["TabPages"]);
            MetroTabPage name = (MetroTabPage)this.DesignerHost.CreateComponent(typeof(MetroTabPage));

            name.Text = name.Name;
            control.TabPages.Add(name);
            base.RaiseComponentChanged(TypeDescriptor.GetProperties(control)["TabPages"], controls, control.TabPages);
            control.SelectedTab = name;
            this.SetVerbs();
        }
        private MetroTabControl EnsureMainLayout()
        {
            if (_tabControl == null)
            {
                _tabControl      = new MetroTabControl();
                _tabControl.Dock = DockStyle.Fill;

                _tabControl.Selecting += _tabControl_Selecting;

                this.AppForm.Controls.Add(_tabControl);
            }

            return(_tabControl);
        }
Пример #9
0
        public SatisViewModel(IDialogCoordinator instance, MainWindow mw)
        {
            model             = new SatisModel();
            SatisListesi      = new TrulyObservableCollection <SatisUrun>();
            _satisListesiB    = new TrulyObservableCollection <SatisUrun>();
            _alinanNakitB     = 0m;
            dialogCoordinator = instance;
            tcontrol          = mw.tcTabs;
            mwindow           = mw;

            HizliEkle = new ObservableCollection <Urun>(UrunListesi.Urunler.Where((x) => x.HizliEkle == true));

            UrunListesi.Urunler.CollectionChanged += (s, e) => HizliEkle = new ObservableCollection <Urun>(UrunListesi.Urunler.Where((x) => x.HizliEkle == true));
        }
        private void OnRemovePage(object sender, EventArgs e)
        {
            MetroTabControl control = (MetroTabControl)this.Control;

            System.Windows.Forms.Control.ControlCollection controls = control.Controls;
            if (control.SelectedIndex < 0)
            {
                return;
            }
            base.RaiseComponentChanging(TypeDescriptor.GetProperties(control)["TabPages"]);
            this.DesignerHost.DestroyComponent(control.TabPages[control.SelectedIndex]);
            base.RaiseComponentChanged(TypeDescriptor.GetProperties(control)["TabPages"], controls, control.TabPages);
            this.SelectionService.SetSelectedComponents(new IComponent[] { control }, SelectionTypes.Auto);
            this.SetVerbs();
        }
Пример #11
0
        private void OnRemoveTab(object sender, EventArgs e)
        {
            MetroTabControl parentControl = Control as MetroTabControl;

            if (parentControl != null && parentControl.SelectedIndex < 0)
            {
                return;
            }

            TabControl.TabPageCollection oldTabs = parentControl?.TabPages;

            RaiseComponentChanging(TypeDescriptor.GetProperties(parentControl)["TabPages"]);
            _designerHost.DestroyComponent(parentControl?.SelectedTab);
            RaiseComponentChanged(TypeDescriptor.GetProperties(parentControl)["TabPages"], oldTabs, parentControl?.TabPages);
        }
Пример #12
0
        private void OnAddTab(object sender, EventArgs e)
        {
            MetroTabControl parentControl = Control as MetroTabControl;

            TabControl.TabPageCollection oldTabs = parentControl?.TabPages;

            RaiseComponentChanging(TypeDescriptor.GetProperties(parentControl)["TabPages"]);
            MetroTabPage newTab = (MetroTabPage)_designerHost.CreateComponent(typeof(MetroTabPage));

            newTab.Text = newTab.Name;
            parentControl?.TabPages.Add(newTab);
            if (parentControl == null)
            {
                return;
            }

            parentControl.SelectedTab = newTab;
            RaiseComponentChanged(TypeDescriptor.GetProperties(parentControl)["TabPages"], oldTabs, parentControl.TabPages);
        }
Пример #13
0
        public void AddSelectedCategory(MetroTabControl tabControl)
        {
            tabControl.Items.Clear();
            for (int i = 0; i < SelectedCategorySource.Rows.Count; i++)
            {
                MetroTabItem item = new MetroTabItem()
                {
                    CloseButtonEnabled = true,
                    Header             = SelectedCategorySource.Rows[i]["categoryname"].ToString(),
                    Tag             = SelectedCategorySource.Rows[i]["id"].ToString(),
                    Padding         = new Thickness(20, 3, 20, 3),
                    BorderThickness = new Thickness(1),
                    BorderBrush     = new SolidColorBrush(Colors.DeepSkyBlue),
                };
                ControlsHelper.SetHeaderFontSize(item, 14.0);

                tabControl.Items.Add(item);
            }
        }
Пример #14
0
        private void AddControlsToForm(MetroTabControl tabControl, MetroStyleManager styleManager, int activeCount,
                                       int newSet)
        {
            TabPage page    = tabControl.TabPages[tabControl.TabPages.Count - 1];
            var     newPage = new MetroTabPage
            {
                BackColor = Color.Transparent,
                Text      = string.Format("{0}-{1}", activeCount + 2, activeCount + 11),
            };

            if (newSet == 10 && tabControl.TabPages.Count < 10)
            {
                tabControl.TabPages.Add(newPage);
            }
            newPage.Controls.Add(new MetroLabel
            {
                FontWeight = MetroFontWeight.Bold,
                Text       = LanguageManager.Singleton.GetTranslation(ETranslations.AccountControlLoginName),
                Theme      = styleManager.Theme,
                Style      = styleManager.Style,
                Location   = new Point(3, 10),
                BackColor  = Color.Transparent,
            });
            newPage.Controls.Add(new MetroLabel
            {
                FontWeight = MetroFontWeight.Bold,
                Text       = LanguageManager.Singleton.GetTranslation(ETranslations.AccountControlStatus),
                Theme      = styleManager.Theme,
                Style      = styleManager.Style,
                Location   = new Point(490, 10),
                BackColor  = Color.Transparent,
            });

            page.Controls.Add(LblAccountName);
            page.Controls.Add(BtnStart);
            page.Controls.Add(BtnKill);
            page.Controls.Add(BtnManage);
            page.Controls.Add(LblStatus);
            page.Controls.Add(CmbSettings);
            page.Controls.Add(BtnSettings);
            page.Controls.Add(BtnResetTime);
        }
Пример #15
0
        // Wanneer een andere tabpage geselecteerd word de combobox toevoegen aan deze page
        private void metroTabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //add de combobox naar de huidige geselecteerde combobox..
            MetroTabControl tab = ((MetroTabControl)sender);
            int             i   = tab.SelectedIndex;

            metroTabControl1.TabPages[i].Controls.Add(comboBoxLocation1);
            metroTabControl1.TabPages[i].Controls.Add(comboBoxSaved);
            metroTabControl1.TabPages[i].Controls.Add(metroButtonExport);

            //if (metroTabControl1.SelectedTab.Name == "metroTabPageAlgemeen")
            //{
            //    Console.WriteLine("Algemeen geselecteerd");
            //    metroTabPageAlgemeen.Controls.Add(comboBoxLocation1);
            //}
            //else if (metroTabControl1.SelectedTab.Name == "metroTabPageVerwachting")
            //{
            //    Console.WriteLine("Verwachting geselecteerd");
            //    metroTabPageVerwachting.Controls.Add(comboBoxLocation1);
            //}
        }
Пример #16
0
        private void metroTabControlGlobal_SelectedIndexChanged(object sender, EventArgs e)
        {
            MetroTabControl mtc = sender as MetroTabControl;

            switch (mtc.SelectedIndex)
            {
            case 0:     // Lekari
            {
                //metroPanel1.Enabled = true;
                metroButtonSmenaLekara.Enabled = true; GetAllDoctors(dom_zdravlja_local);
                EmptyControls();
                if (metroGridData.Rows.Count != 0)
                {
                    metroGridData.Rows[0].Selected = true;
                    TransferDataFromGridToControl(metroGridData);
                }
                break;
            }

            case 1:     // Medicinsko osoblje
            {
                //metroPanel1.Enabled = true;
                metroButtonSmenaLekara.Enabled = false; GetMedicalStaffData(dom_zdravlja_local);
                EmptyControls();
                if (metroGridData.Rows.Count != 0)
                {
                    metroGridData.Rows[0].Selected = true;
                    TransferDataFromGridToControl(metroGridData);
                }
                break;
            }

            case 2:     // Zahtevi pacijenata
            {
                EmptyControls();
                //metroPanel1.Enabled = false;
                break;
            }
            }
        }
        public int txtKontrol(string[] txtBoxAdlar, MetroPanel pnl, MetroForm frm, MetroTabControl tb)
        {
            int i = 0;

            while (i < txtBoxAdlar.Length)
            {
                MetroTextBox txtBox = (MetroTextBox)tb.Controls.Find("txt" + txtBoxAdlar[i], true)[0];
                if (txtBox.Text == string.Empty)
                {
                    MetroMessageBox.Show(frm, "Hata !", " Alanların hepsi doldurulmalı !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    break;
                }
                else if (txtBox.Text != string.Empty)
                {
                    i++;
                }
            }
            if (txtBoxAdlar.Length == i)
            {
                return(1);
            }
            return(0);
        }
Пример #18
0
 public UIKeyNavigation(ListBox listBox, MetroTabControl metroTabControl)
 {
     _listBox         = listBox;
     _metroTabControl = metroTabControl;
     Subscribe();
 }
Пример #19
0
        private void InitializeComponent()
        {
            //IL_001c: Unknown result type (might be due to invalid IL or missing references)
            //IL_0026: Expected O, but got Unknown
            //IL_0027: Unknown result type (might be due to invalid IL or missing references)
            //IL_0031: Expected O, but got Unknown
            //IL_0032: Unknown result type (might be due to invalid IL or missing references)
            //IL_003c: Expected O, but got Unknown
            //IL_003d: Unknown result type (might be due to invalid IL or missing references)
            //IL_0047: Expected O, but got Unknown
            //IL_0048: Unknown result type (might be due to invalid IL or missing references)
            //IL_0052: Expected O, but got Unknown
            //IL_0053: Unknown result type (might be due to invalid IL or missing references)
            //IL_005d: Expected O, but got Unknown
            //IL_005e: Unknown result type (might be due to invalid IL or missing references)
            //IL_0068: Expected O, but got Unknown
            //IL_006f: Unknown result type (might be due to invalid IL or missing references)
            //IL_0079: Expected O, but got Unknown
            components = new Container();
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(RegisterForm));

            passwordTextBox   = new MetroTextBox();
            registerButton    = new MetroButton();
            usernameTextBox   = new MetroTextBox();
            licenseKeyTextBox = new MetroTextBox();
            mainTabControl    = new MetroTabControl();
            metroTabPage1     = new MetroTabPage();
            goBackLabel       = new MetroLabel();
            styleManager      = new MetroStyleManager(components);
            ((Control)(object)mainTabControl).SuspendLayout();
            ((Control)(object)metroTabPage1).SuspendLayout();
            ((ISupportInitialize)styleManager).BeginInit();
            ((Control)this).SuspendLayout();
            passwordTextBox.get_CustomButton().set_Image((Image)null);
            ((Control)(object)passwordTextBox.get_CustomButton()).Location = new Point(312, 2);
            ((Control)(object)passwordTextBox.get_CustomButton()).Name     = "";
            ((Control)(object)passwordTextBox.get_CustomButton()).Size     = new Size(17, 17);
            passwordTextBox.get_CustomButton().set_Style((MetroColorStyle)4);
            ((Control)(object)passwordTextBox.get_CustomButton()).TabIndex = 1;
            passwordTextBox.get_CustomButton().set_Theme((MetroThemeStyle)1);
            passwordTextBox.get_CustomButton().set_UseSelectable(true);
            ((Control)(object)passwordTextBox.get_CustomButton()).Visible = false;
            ((Control)(object)passwordTextBox).ForeColor = Color.White;
            passwordTextBox.set_Lines(new string[0]);
            ((Control)(object)passwordTextBox).Location = new Point(19, 44);
            passwordTextBox.set_MaxLength(32767);
            ((Control)(object)passwordTextBox).Name = "passwordTextBox";
            passwordTextBox.set_PasswordChar('●');
            passwordTextBox.set_PromptText("Password");
            passwordTextBox.set_ScrollBars(ScrollBars.None);
            passwordTextBox.set_SelectedText("");
            passwordTextBox.set_SelectionLength(0);
            passwordTextBox.set_SelectionStart(0);
            passwordTextBox.set_ShortcutsEnabled(true);
            ((Control)(object)passwordTextBox).Size     = new Size(332, 22);
            ((Control)(object)passwordTextBox).TabIndex = 29;
            passwordTextBox.set_Theme((MetroThemeStyle)2);
            passwordTextBox.set_UseSelectable(true);
            passwordTextBox.set_UseSystemPasswordChar(true);
            passwordTextBox.set_WaterMark("Password");
            passwordTextBox.set_WaterMarkColor(Color.FromArgb(109, 109, 109));
            passwordTextBox.set_WaterMarkFont(new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel));
            registerButton.set_Highlight(true);
            ((Control)(object)registerButton).Location = new Point(19, 100);
            ((Control)(object)registerButton).Name     = "registerButton";
            ((Control)(object)registerButton).Size     = new Size(332, 26);
            ((Control)(object)registerButton).TabIndex = 28;
            ((Control)(object)registerButton).Text     = "Register";
            registerButton.set_Theme((MetroThemeStyle)2);
            registerButton.set_UseSelectable(true);
            ((Control)(object)registerButton).Click += registerButton_Click;
            usernameTextBox.get_CustomButton().set_Image((Image)null);
            ((Control)(object)usernameTextBox.get_CustomButton()).Location = new Point(312, 2);
            ((Control)(object)usernameTextBox.get_CustomButton()).Name     = "";
            ((Control)(object)usernameTextBox.get_CustomButton()).Size     = new Size(17, 17);
            usernameTextBox.get_CustomButton().set_Style((MetroColorStyle)4);
            ((Control)(object)usernameTextBox.get_CustomButton()).TabIndex = 1;
            usernameTextBox.get_CustomButton().set_Theme((MetroThemeStyle)1);
            usernameTextBox.get_CustomButton().set_UseSelectable(true);
            ((Control)(object)usernameTextBox.get_CustomButton()).Visible = false;
            ((Control)(object)usernameTextBox).ForeColor = Color.White;
            usernameTextBox.set_Lines(new string[0]);
            ((Control)(object)usernameTextBox).Location = new Point(19, 16);
            usernameTextBox.set_MaxLength(32767);
            ((Control)(object)usernameTextBox).Name = "usernameTextBox";
            usernameTextBox.set_PasswordChar('\0');
            usernameTextBox.set_PromptText("Username");
            usernameTextBox.set_ScrollBars(ScrollBars.None);
            usernameTextBox.set_SelectedText("");
            usernameTextBox.set_SelectionLength(0);
            usernameTextBox.set_SelectionStart(0);
            usernameTextBox.set_ShortcutsEnabled(true);
            ((Control)(object)usernameTextBox).Size     = new Size(332, 22);
            ((Control)(object)usernameTextBox).TabIndex = 26;
            usernameTextBox.set_Theme((MetroThemeStyle)2);
            usernameTextBox.set_UseSelectable(true);
            usernameTextBox.set_WaterMark("Username");
            usernameTextBox.set_WaterMarkColor(Color.FromArgb(109, 109, 109));
            usernameTextBox.set_WaterMarkFont(new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel));
            licenseKeyTextBox.get_CustomButton().set_Image((Image)null);
            ((Control)(object)licenseKeyTextBox.get_CustomButton()).Location = new Point(312, 2);
            ((Control)(object)licenseKeyTextBox.get_CustomButton()).Name     = "";
            ((Control)(object)licenseKeyTextBox.get_CustomButton()).Size     = new Size(17, 17);
            licenseKeyTextBox.get_CustomButton().set_Style((MetroColorStyle)4);
            ((Control)(object)licenseKeyTextBox.get_CustomButton()).TabIndex = 1;
            licenseKeyTextBox.get_CustomButton().set_Theme((MetroThemeStyle)1);
            licenseKeyTextBox.get_CustomButton().set_UseSelectable(true);
            ((Control)(object)licenseKeyTextBox.get_CustomButton()).Visible = false;
            ((Control)(object)licenseKeyTextBox).ForeColor = Color.White;
            licenseKeyTextBox.set_Lines(new string[0]);
            ((Control)(object)licenseKeyTextBox).Location = new Point(19, 72);
            licenseKeyTextBox.set_MaxLength(32767);
            ((Control)(object)licenseKeyTextBox).Name = "licenseKeyTextBox";
            licenseKeyTextBox.set_PasswordChar('\0');
            licenseKeyTextBox.set_PromptText("License Key");
            licenseKeyTextBox.set_ScrollBars(ScrollBars.None);
            licenseKeyTextBox.set_SelectedText("");
            licenseKeyTextBox.set_SelectionLength(0);
            licenseKeyTextBox.set_SelectionStart(0);
            licenseKeyTextBox.set_ShortcutsEnabled(true);
            ((Control)(object)licenseKeyTextBox).Size     = new Size(332, 22);
            ((Control)(object)licenseKeyTextBox).TabIndex = 27;
            licenseKeyTextBox.set_Theme((MetroThemeStyle)2);
            licenseKeyTextBox.set_UseSelectable(true);
            licenseKeyTextBox.set_WaterMark("License Key");
            licenseKeyTextBox.set_WaterMarkColor(Color.FromArgb(109, 109, 109));
            licenseKeyTextBox.set_WaterMarkFont(new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel));
            ((Control)(object)mainTabControl).Controls.Add((Control)(object)metroTabPage1);
            ((Control)(object)mainTabControl).Location         = new Point(23, 63);
            ((Control)(object)mainTabControl).Name             = "mainTabControl";
            ((TabControl)(object)mainTabControl).SelectedIndex = 0;
            ((Control)(object)mainTabControl).Size             = new Size(378, 202);
            ((TabControl)(object)mainTabControl).SizeMode      = TabSizeMode.Fixed;
            ((Control)(object)mainTabControl).TabIndex         = 30;
            mainTabControl.set_Theme((MetroThemeStyle)2);
            mainTabControl.set_UseSelectable(true);
            ((Panel)(object)metroTabPage1).BorderStyle = BorderStyle.FixedSingle;
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)goBackLabel);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)passwordTextBox);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)registerButton);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)usernameTextBox);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)licenseKeyTextBox);
            metroTabPage1.set_HorizontalScrollbarBarColor(true);
            metroTabPage1.set_HorizontalScrollbarHighlightOnWheel(false);
            metroTabPage1.set_HorizontalScrollbarSize(10);
            ((TabPage)(object)metroTabPage1).Location = new Point(4, 38);
            ((Control)(object)metroTabPage1).Name     = "metroTabPage1";
            ((Control)(object)metroTabPage1).Size     = new Size(370, 160);
            ((TabPage)(object)metroTabPage1).TabIndex = 0;
            ((Control)(object)metroTabPage1).Text     = "Register";
            metroTabPage1.set_Theme((MetroThemeStyle)2);
            metroTabPage1.set_VerticalScrollbarBarColor(true);
            metroTabPage1.set_VerticalScrollbarHighlightOnWheel(false);
            metroTabPage1.set_VerticalScrollbarSize(10);
            ((Control)(object)goBackLabel).AutoSize = true;
            goBackLabel.set_FontWeight((MetroLabelWeight)1);
            ((Control)(object)goBackLabel).ForeColor = Color.Blue;
            ((Control)(object)goBackLabel).Location  = new Point(95, 130);
            ((Control)(object)goBackLabel).Name      = "goBackLabel";
            ((Control)(object)goBackLabel).Size      = new Size(165, 19);
            ((Control)(object)goBackLabel).TabIndex  = 30;
            ((Control)(object)goBackLabel).Text      = "Already have an account?";
            goBackLabel.set_Theme((MetroThemeStyle)2);
            goBackLabel.set_UseStyleColors(true);
            ((Control)(object)goBackLabel).Click += goBackLabel_Click;
            styleManager.set_Owner((ContainerControl)null);
            styleManager.set_Style((MetroColorStyle)13);
            ((ContainerControl)this).AutoScaleMode = AutoScaleMode.None;
            ((Form)this).ClientSize = new Size(427, 285);
            ((Control)this).Controls.Add((Control)(object)mainTabControl);
            ((Form)this).Icon    = (Icon)componentResourceManager.GetObject("$this.Icon");
            ((Control)this).Name = "RegisterForm";
            ((MetroForm)this).set_Resizable(false);
            ((MetroForm)this).set_Style((MetroColorStyle)0);
            ((Control)(object)this).Text = "Asteroid";
            ((MetroForm)this).set_Theme((MetroThemeStyle)2);
            ((Form)this).FormClosing += RegisterForm_FormClosing;
            ((Form)this).Load        += RegisterForm_Load;
            ((Control)(object)mainTabControl).ResumeLayout(performLayout: false);
            ((Control)(object)metroTabPage1).ResumeLayout(performLayout: false);
            ((Control)(object)metroTabPage1).PerformLayout();
            ((ISupportInitialize)styleManager).EndInit();
            ((Control)this).ResumeLayout(performLayout: false);
        }
Пример #20
0
        public void AggiungiSessione(TabControl tabControl, Form form, bool standard)
        {
            _tabControl = new MetroTabControl();
            _tabICD     = new MetroTabControl();

            _tabNomeSessione = new TabPage();
            _tabInfo         = new TabPage();
            _tabCripta       = new TabPage();
            _tabDecripta     = new TabPage();
            _tabEmail        = new TabPage();

            _btnCaricaCripta   = new MetroButton();
            _btnCaricaDecripta = new MetroButton();
            _btnCripta         = new MetroButton();
            _btnDecripta       = new MetroButton();
            _btnAllegato       = new MetroButton();
            _btnInviaEmail     = new MetroButton();

            _pnlToCript   = new Panel();
            _pnlToDecript = new Panel();
            _imgToCript   = new PictureBox();
            _imgToDecript = new PictureBox();

            _txtToDecript    = new TextBox();
            _txtToCript      = new TextBox();
            _txtCriptaE      = new TextBox();
            _txtCriptaN      = new TextBox();
            _txtDecriptaD    = new TextBox();
            _txtDecriptaN    = new TextBox();
            _txtDestinatario = new TextBox();

            _lblNomeSessione         = new Label();
            _lblChiavePrivata        = new Label();
            _lblChiavePubblica       = new Label();
            _lblProprietarioSessione = new Label();
            _lblEmail            = new Label();
            _lblTo               = new Label();
            _lblInfoAllegato     = new Label();
            _lblInfoAllegatoPath = new Label();

            #region NuovaTabellaSession

            tabControl.Controls.Add(_tabNomeSessione);

            if (standard)
            {
                _tabNomeSessione.Text = _nomeSessione + " (Standard)";
            }
            else
            {
                _tabNomeSessione.Text = _nomeSessione + " (Database)";
            }

            _tabNomeSessione.Controls.Add(_tabICD);

            _tabICD.Size = new Size(tabControl.Width, tabControl.Height - 50);

            _tabICD.Controls.Add(_tabInfo);
            _tabICD.Controls.Add(_tabCripta);
            if (standard)
            {
                _tabICD.Controls.Add(_tabDecripta);
            }
            else
            {
                _tabICD.Controls.Add(_tabEmail);
            }

            _tabInfo.Text     = "Info";
            _tabCripta.Text   = "Cripta";
            _tabDecripta.Text = "Decripta";
            _tabEmail.Text    = "Servizio e-mail";

            #endregion

            #region Info

            _lblNomeSessione.Text = "Nome Sessione: " + _nomeSessione;

            if (standard)
            {
                _lblChiavePrivata.Text = "Chiave Privata: (" + _dString + ", " + _nString + ")";
            }
            else
            {
                _lblChiavePrivata.Text = "Chiave Privata: ( )";
            }

            _lblChiavePubblica.Text       = "Chiave Pubblica: (" + _eString + ", " + _nString + ")";
            _lblProprietarioSessione.Text = "Proprietario Sessione: " + _utente;


            _lblEmail.Text = "e-mail: " + _eMail;

            _lblNomeSessione.AutoSize         = true;
            _lblChiavePrivata.AutoSize        = true;
            _lblChiavePubblica.AutoSize       = true;
            _lblProprietarioSessione.AutoSize = true;
            _lblEmail.AutoSize = true;

            _lblNomeSessione.Location         = new Point(20, 50);
            _lblChiavePrivata.Location        = new Point(20, 80);
            _lblChiavePubblica.Location       = new Point(20, 110);
            _lblProprietarioSessione.Location = new Point(20, 140);
            _lblEmail.Location = new Point(20, 170);

            _tabInfo.Controls.Add(_lblNomeSessione);
            _tabInfo.Controls.Add(_lblChiavePrivata);
            _tabInfo.Controls.Add(_lblChiavePubblica);
            _tabInfo.Controls.Add(_lblProprietarioSessione);
            _tabInfo.Controls.Add(_lblEmail);

            #endregion

            #region Cripta

            _tabCripta.Controls.Add(_btnCaricaCripta);
            _tabCripta.Controls.Add(_pnlToCript);
            _tabCripta.Controls.Add(_imgToCript);
            _tabCripta.Controls.Add(_txtToCript);
            _tabCripta.Controls.Add(_btnCripta);

            _btnCaricaCripta.Visible  = true;
            _btnCaricaCripta.Enabled  = true;
            _btnCaricaCripta.Location = new Point(10, 10);
            _btnCaricaCripta.Click   += new System.EventHandler(this.btnCaricaCripta_Click);
            _btnCaricaCripta.Text     = "Carica";

            _pnlToCript.Location   = new Point(100, 10);
            _pnlToCript.Size       = new Size(tabControl.Width - 150, tabControl.Height - 300);
            _pnlToCript.AutoScroll = true;
            _pnlToCript.Controls.Add(_imgToCript);

            _imgToCript.Visible  = true;
            _imgToCript.Enabled  = true;
            _imgToCript.Location = new Point(100, 10);
            _imgToCript.Size     = new Size(tabControl.Width - 150, tabControl.Height - 300);
            _imgToCript.SizeMode = PictureBoxSizeMode.AutoSize;

            _txtToCript.Visible      = true;
            _txtToCript.Enabled      = false;
            _txtToCript.Location     = new Point(100, 375);
            _txtToCript.Size         = new Size(tabControl.Width - 150, 60);
            _txtToCript.BorderStyle  = BorderStyle.Fixed3D;
            _txtToCript.Multiline    = true;
            _txtToCript.TextChanged += _txtToCript_TextChanged;

            _btnCripta.Visible  = true;
            _btnCripta.Enabled  = false;
            _btnCripta.Location = new Point(10, 375);
            _btnCripta.Click   += new System.EventHandler(this.Cripta_Click);
            _btnCripta.Text     = "Cripta";

            #endregion

            if (standard)
            {
                #region Decripta

                _tabDecripta.Controls.Add(_imgToDecript);
                _tabDecripta.Controls.Add(_pnlToDecript);
                _tabDecripta.Controls.Add(_btnCaricaDecripta);
                _tabDecripta.Controls.Add(_btnDecripta);
                _tabDecripta.Controls.Add(_txtToDecript);

                _btnCaricaDecripta.Visible  = true;
                _btnCaricaDecripta.Enabled  = true;
                _btnCaricaDecripta.Location = new Point(10, 10);
                _btnCaricaDecripta.Click   += new System.EventHandler(this.btnCaricaDecripta_Click);
                _btnCaricaDecripta.Text     = "Carica";

                _pnlToDecript.Location   = new Point(100, 10);
                _pnlToDecript.Size       = new Size(tabControl.Width - 150, tabControl.Height - 300);
                _pnlToDecript.AutoScroll = true;
                _pnlToDecript.Controls.Add(_imgToDecript);

                _imgToDecript.Visible  = true;
                _imgToDecript.Enabled  = true;
                _imgToDecript.Location = new Point(100, 10);
                _imgToDecript.Size     = new Size(tabControl.Width - 150, tabControl.Height - 300);
                _imgToDecript.SizeMode = PictureBoxSizeMode.AutoSize;
                //_imgToDecript.BorderStyle = BorderStyle.Fixed3D;
                //_imgToDecript.SizeMode = PictureBoxSizeMode.StretchImage;

                _txtToDecript.Visible     = true;
                _txtToDecript.Enabled     = false;
                _txtToDecript.Location    = new Point(100, 375);
                _txtToDecript.Size        = new Size(tabControl.Width - 150, 60);
                _txtToDecript.BorderStyle = BorderStyle.Fixed3D;
                _txtToDecript.Multiline   = true;
                _txtToDecript.Enabled     = false;

                _btnDecripta.Visible  = true;
                _btnDecripta.Enabled  = false;
                _btnDecripta.Location = new Point(10, 375);
                _btnDecripta.Click   += new System.EventHandler(this.Decripta_Click);
                _btnDecripta.Text     = "Decripta";

                #endregion
            }
            else
            {
                #region eMail

                _tabEmail.Controls.Add(_lblTo);
                _tabEmail.Controls.Add(_txtDestinatario);
                _tabEmail.Controls.Add(_btnAllegato);
                _tabEmail.Controls.Add(_btnInviaEmail);
                _tabEmail.Controls.Add(_lblInfoAllegato);
                _tabEmail.Controls.Add(_lblInfoAllegatoPath);

                _lblTo.Location = new Point(60, 78);
                _lblTo.AutoSize = true;
                _lblTo.Text     = "Destinatario:";

                _txtDestinatario.Location = new Point(140, 75);
                _txtDestinatario.Width    = 500;
                _txtDestinatario.Text     = this._eMail;

                _btnAllegato.Location              = new Point(650, 75);
                _btnAllegato.Size                  = new Size(20, 20);
                _btnAllegato.BackgroundImage       = Image.FromFile("paperclip.png");
                _btnAllegato.BackgroundImageLayout = ImageLayout.Center;
                _btnAllegato.Click                += _btnAllegato_Click;

                _btnInviaEmail.Location = new Point(62, 135);
                _btnInviaEmail.Width    = 610;
                _btnInviaEmail.Text     = "Invia e-mail";
                _btnInviaEmail.Click   += _btnInviaEmail_Click;

                _lblInfoAllegato.Location = new Point(60, 110);
                _lblInfoAllegato.AutoSize = true;
                _lblInfoAllegato.Text     = "Info Allegato: ";

                _lblInfoAllegatoPath.Location = new Point(138, 110);
                _lblInfoAllegatoPath.AutoSize = true;
                _lblInfoAllegatoPath.Text     = "";

                #endregion
            }
        }
Пример #21
0
        private void InitializeComponent()
        {
            components = new Container();
            ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(LoginForm));

            usernameTextBox = new MetroTextBox();
            loginButton     = new MetroButton();
            styleManager    = new MetroStyleManager(components);
            passwordTextBox = new MetroTextBox();
            mainTabControl  = new MetroTabControl();
            metroTabPage1   = new MetroTabPage();
            lblRegister     = new MetroLabel();
            ((ISupportInitialize)styleManager).BeginInit();
            ((Control)(object)mainTabControl).SuspendLayout();
            ((Control)(object)metroTabPage1).SuspendLayout();
            ((Control)this).SuspendLayout();
            usernameTextBox.get_CustomButton().set_Image((Image)null);
            ((Control)(object)usernameTextBox.get_CustomButton()).Location = new Point(313, 2);
            ((Control)(object)usernameTextBox.get_CustomButton()).Name     = "";
            ((Control)(object)usernameTextBox.get_CustomButton()).Size     = new Size(17, 17);
            usernameTextBox.get_CustomButton().set_Style((MetroColorStyle)4);
            ((Control)(object)usernameTextBox.get_CustomButton()).TabIndex = 1;
            usernameTextBox.get_CustomButton().set_Theme((MetroThemeStyle)1);
            usernameTextBox.get_CustomButton().set_UseSelectable(true);
            ((Control)(object)usernameTextBox.get_CustomButton()).Visible = false;
            ((Control)(object)usernameTextBox).ForeColor = Color.White;
            usernameTextBox.set_Lines(new string[0]);
            ((Control)(object)usernameTextBox).Location = new Point(19, 18);
            usernameTextBox.set_MaxLength(32767);
            ((Control)(object)usernameTextBox).Name = "usernameTextBox";
            usernameTextBox.set_PasswordChar('\0');
            usernameTextBox.set_PromptText("Username");
            usernameTextBox.set_ScrollBars(ScrollBars.None);
            usernameTextBox.set_SelectedText("");
            usernameTextBox.set_SelectionLength(0);
            usernameTextBox.set_SelectionStart(0);
            usernameTextBox.set_ShortcutsEnabled(true);
            ((Control)(object)usernameTextBox).Size     = new Size(333, 22);
            ((Control)(object)usernameTextBox).TabIndex = 3;
            usernameTextBox.set_Theme((MetroThemeStyle)2);
            usernameTextBox.set_UseSelectable(true);
            usernameTextBox.set_WaterMark("Username");
            usernameTextBox.set_WaterMarkColor(Color.FromArgb(109, 109, 109));
            usernameTextBox.set_WaterMarkFont(new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel));
            loginButton.set_Highlight(true);
            ((Control)(object)loginButton).Location = new Point(19, 74);
            ((Control)(object)loginButton).Name     = "loginButton";
            ((Control)(object)loginButton).Size     = new Size(333, 26);
            ((Control)(object)loginButton).TabIndex = 20;
            ((Control)(object)loginButton).Text     = "Login";
            loginButton.set_Theme((MetroThemeStyle)2);
            loginButton.set_UseSelectable(true);
            ((Control)(object)loginButton).Click += loginButton_Click;
            styleManager.set_Owner((ContainerControl)null);
            styleManager.set_Style((MetroColorStyle)13);
            passwordTextBox.get_CustomButton().set_Image((Image)null);
            ((Control)(object)passwordTextBox.get_CustomButton()).Location = new Point(313, 2);
            ((Control)(object)passwordTextBox.get_CustomButton()).Name     = "";
            ((Control)(object)passwordTextBox.get_CustomButton()).Size     = new Size(17, 17);
            passwordTextBox.get_CustomButton().set_Style((MetroColorStyle)4);
            ((Control)(object)passwordTextBox.get_CustomButton()).TabIndex = 1;
            passwordTextBox.get_CustomButton().set_Theme((MetroThemeStyle)1);
            passwordTextBox.get_CustomButton().set_UseSelectable(true);
            ((Control)(object)passwordTextBox.get_CustomButton()).Visible = false;
            ((Control)(object)passwordTextBox).ForeColor = Color.White;
            passwordTextBox.set_Lines(new string[0]);
            ((Control)(object)passwordTextBox).Location = new Point(19, 46);
            passwordTextBox.set_MaxLength(32767);
            ((Control)(object)passwordTextBox).Name = "passwordTextBox";
            passwordTextBox.set_PasswordChar('●');
            passwordTextBox.set_PromptText("Password");
            passwordTextBox.set_ScrollBars(ScrollBars.None);
            passwordTextBox.set_SelectedText("");
            passwordTextBox.set_SelectionLength(0);
            passwordTextBox.set_SelectionStart(0);
            passwordTextBox.set_ShortcutsEnabled(true);
            ((Control)(object)passwordTextBox).Size     = new Size(333, 22);
            ((Control)(object)passwordTextBox).TabIndex = 21;
            passwordTextBox.set_Theme((MetroThemeStyle)2);
            passwordTextBox.set_UseSelectable(true);
            passwordTextBox.set_UseSystemPasswordChar(true);
            passwordTextBox.set_WaterMark("Password");
            passwordTextBox.set_WaterMarkColor(Color.FromArgb(109, 109, 109));
            passwordTextBox.set_WaterMarkFont(new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel));
            ((Control)(object)mainTabControl).Controls.Add((Control)(object)metroTabPage1);
            ((Control)(object)mainTabControl).Location         = new Point(23, 63);
            ((Control)(object)mainTabControl).Name             = "mainTabControl";
            ((TabControl)(object)mainTabControl).SelectedIndex = 0;
            ((Control)(object)mainTabControl).Size             = new Size(380, 173);
            ((TabControl)(object)mainTabControl).SizeMode      = TabSizeMode.Fixed;
            ((Control)(object)mainTabControl).TabIndex         = 22;
            mainTabControl.set_Theme((MetroThemeStyle)2);
            mainTabControl.set_UseSelectable(true);
            ((Panel)(object)metroTabPage1).BorderStyle = BorderStyle.FixedSingle;
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)lblRegister);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)passwordTextBox);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)loginButton);
            ((Control)(object)metroTabPage1).Controls.Add((Control)(object)usernameTextBox);
            metroTabPage1.set_HorizontalScrollbarBarColor(true);
            metroTabPage1.set_HorizontalScrollbarHighlightOnWheel(false);
            metroTabPage1.set_HorizontalScrollbarSize(10);
            ((TabPage)(object)metroTabPage1).Location = new Point(4, 38);
            ((Control)(object)metroTabPage1).Name     = "metroTabPage1";
            ((Control)(object)metroTabPage1).Size     = new Size(372, 131);
            ((TabPage)(object)metroTabPage1).TabIndex = 0;
            ((Control)(object)metroTabPage1).Text     = "Login";
            metroTabPage1.set_Theme((MetroThemeStyle)2);
            metroTabPage1.set_VerticalScrollbarBarColor(true);
            metroTabPage1.set_VerticalScrollbarHighlightOnWheel(false);
            metroTabPage1.set_VerticalScrollbarSize(10);
            ((Control)(object)lblRegister).AutoSize = true;
            lblRegister.set_FontWeight((MetroLabelWeight)1);
            ((Control)(object)lblRegister).ForeColor = Color.Blue;
            ((Control)(object)lblRegister).Location  = new Point(108, 104);
            ((Control)(object)lblRegister).Name      = "lblRegister";
            ((Control)(object)lblRegister).Size      = new Size(153, 19);
            ((Control)(object)lblRegister).TabIndex  = 22;
            ((Control)(object)lblRegister).Text      = "Don't have an account?";
            lblRegister.set_Theme((MetroThemeStyle)2);
            lblRegister.set_UseStyleColors(true);
            ((Control)(object)lblRegister).Click  += registerLabel_Click;
            ((ContainerControl)this).AutoScaleMode = AutoScaleMode.None;
            ((Form)this).ClientSize = new Size(420, 257);
            ((Control)this).Controls.Add((Control)(object)mainTabControl);
            ((Form)this).Icon    = (Icon)componentResourceManager.GetObject("$this.Icon");
            ((Control)this).Name = "LoginForm";
            ((MetroForm)this).set_Resizable(false);
            ((MetroForm)this).set_ShadowType((MetroFormShadowType)0);
            ((MetroForm)this).set_Style((MetroColorStyle)0);
            ((Control)(object)this).Text = "Asteroid LLC";
            ((MetroForm)this).set_Theme((MetroThemeStyle)2);
            ((Form)this).FormClosing += LoginForm_FormClosing;
            ((Form)this).Load        += LoginForm_Load;
            ((ISupportInitialize)styleManager).EndInit();
            ((Control)(object)mainTabControl).ResumeLayout(performLayout: false);
            ((Control)(object)metroTabPage1).ResumeLayout(performLayout: false);
            ((Control)(object)metroTabPage1).PerformLayout();
            ((Control)this).ResumeLayout(performLayout: false);
        }
        /// <summary>
        /// Setting Tab Preferences for tabMetro and mTabPage Name
        /// </summary>
        /// <param name="ad">Notification<T>"/></param>
        /// <param name="mTabPage">Metro Tab Page Name</param>
        /// <param name="tabMetro">Metro Tab Name</param>
        /// <param name="browser">Web Browser Name for Help</param>
        /// <param name="pbname">Picture Box Name for Advert Image</param>
        public static void SetTabPreferences(out Notification ad, MetroTabPage mTabPage = null, MetroTabControl tabMetro = null)
        {
            bool internet = CheckInternet();

            ad = new Notification();
            if (mTabPage.Name.Contains("Home"))
            {
                tabMetro.SelectedTab = mTabPage;
                ad = null;
            }
            else if (mTabPage.Name == "tbNotifications")
            {
                string message = string.Empty;
                ad = ProcessNotificationsFile(out message);
            }
        }