public HomePanel() { InitializeComponent(); bookUserControl = new BookUserControl(); taskUserControl = new TaskUserControl(); mailUserControl = new MailUserControl(); }
public Home(string Login) { InitializeComponent(); GliderDataContext gliderDataContext = GliderDataContext.Instance; User user = gliderDataContext.Users.FirstOrDefault(u => u.Login == Login); string company = user.Company; request = new RequestUserControl(company); task = new TaskUserControl(Login); mailUser = new MailUserControl(Login); report = new ReportUserControl(company); supportUser = new SupportUserControl(); }
private void InitializeInterfaceComonents() { #region Menu Items MenuItemUserControl CreateMenuItem(ContentItemEnum itemButtonEnum, Image menuItemImage, string itemButtonText) { return(new MenuItemUserControl(itemButtonEnum, OnMenuItemButton_Click, menuItemImage, itemButtonText) { Size = new Size(280, 50) }); } //Image image = global::FinAndTime.Views.Properties.Resources.summary_icon; menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Summary, Properties.Resources.summary_icon, "Dashboard")); menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Passbook, Properties.Resources.Passbook_icon, "Passbook")); menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.TransactionParty, Properties.Resources.Transaction_party_icon, "Transaction Party")); menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Transaction, Properties.Resources.Transaction_icon, "Transactions")); menuFlowLayoutPanel.Controls.Add(CreateMenuItem(ContentItemEnum.Task, Properties.Resources.Tasks_icon, "Tasks")); #endregion #region Content section _summaryUserControl = new DashboardUserControl() { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _passbookUserControl = new PassbookUserControl() { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _transactionPartyUserControl = new TransactionPartyUserControl() { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _transactionUserControl = new TransactionUserControl(OnMenuItemButton_Click) { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _taskUserControl = new TaskUserControl() { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _logUserControl = new LogUserControl() { Dock = DockStyle.Fill, Visible = true, Padding = new Padding(0), Margin = new Padding(0) }; _selectedContentItemEnum = ContentItemEnum.Summary; mainContentPanel.Controls.Add(_summaryUserControl); #endregion }
private void FillForm() { this.scrollPanel1.Clear(); this.Text = _item.DisplayName; int y = 20; foreach (Property property in _item.Properties) { if (property.UIImportance != UIImportance.Hidden || MainForm.ShowHiddenProperties) { PropertyUserControl uc; if (property.TranslationId == "PropertyBasicUserSid") { ConfigurationItem[] users = _configApiClient.GetChildItems("/" + ItemTypes.BasicUserFolder); uc = new SidPropertyUserControl(property, users); } else { switch (property.ValueType) { case ValueTypes.IntType: uc = new IntPropertyUserControl(property); break; case ValueTypes.DoubleType: uc = new DoublePropertyUserControl(property); break; case ValueTypes.TickType: uc = new TickPropertyUserControl(property); break; case ValueTypes.EnumType: uc = new EnumPropertyUserControl(property); break; case ValueTypes.SliderType: uc = new SliderPropertyUserControl(property); break; case ValueTypes.ProgressType: ProgressPropertyUserControl progressuc = new ProgressPropertyUserControl(property); uc = progressuc; break; case ValueTypes.Path: uc = new PathPropertyUserControl(property, _configApiClient); break; case ValueTypes.PathList: uc = new PathListPropertyUserControl(property, _configApiClient); break; case ValueTypes.DateTimeType: case "Time": case "Date": if (property.IsSettable) { uc = new DateTimePickerPropertyUserControl(property); } else { uc = new DateTimeDisplayPropertyUserControl(property); } break; case ValueTypes.SeparatorType: uc = new SeperatorPropertyUserControl(property); break; case ValueTypes.StringType: default: uc = new StringPropertyUserControl(property); break; } } uc.Location = new Point(0, y); uc.Tag = property; uc.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right; uc.ValueChanged += new EventHandler(ValueChangedHandler); if (property.ToolTipTranslationId != null) { uc.ToolTip = _configApiClient.Translate(property.ToolTipTranslationId); } if (property.UIImportance == 3) { uc.Enabled = false; } if (property.Key == "SessionDataId") { SessionDataId = property.Value; } scrollPanel1.Add(uc); y += uc.Height; } } if (_item.Children != null && _item.Children.Any()) { if (_item.Children[0].ItemType == ItemTypes.Task) { UserControl folderUC = new TaskUserControl(_item, _item.Children, _configApiClient) { Location = new Point(0, y), Size = new Size(this.Width, this.Height - y) }; scrollPanel1.Add(folderUC); } else { UserControl folderUC = new FolderUserControl(_item, _item.Children) { Location = new Point(0, y), Size = new Size(this.Width, this.Height - y) }; scrollPanel1.Add(folderUC); } } panelMain.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom; int x = this.Width - 24; if (_item.MethodIds != null) { for (int i = _item.MethodIds.Length - 1; i > -1; i--) { MethodInfo mi = _configApiClient.AllMethodInfos[_item.MethodIds[i]]; if (mi == null) { MessageBox.Show("Method is missing:" + _item.MethodIds[i]); timer1.Stop(); this.Close(); } Button b = new Button() { Text = mi.DisplayName, Tag = mi, UseVisualStyleBackColor = true }; b.Size = new System.Drawing.Size(150, 24); x -= 150; b.Location = new Point(x, 6); x -= 24; b.Click += PerformAction; panelActions.Controls.Add(b); } } string text = _item.MethodIds == null || _item.MethodIds.Length == 0 ? "Close" : "Cancel"; Button cancel = new Button() { Text = text, UseVisualStyleBackColor = true }; cancel.Size = new System.Drawing.Size(100, 24); x -= 100; cancel.Location = new Point(x, 6); cancel.Click += PerformCancel; panelActions.Controls.Add(cancel); Property pathProperty = _item.Properties.FirstOrDefault <Property>(p => p.Key == InvokeInfoProperty.Path); if (pathProperty != null) { if (pathProperty.Value.StartsWith("Task")) { taskPath = pathProperty.Value; timer1.Start(); } } }