private void CreateRulesUI() { Expando groupPanel; foreach (ReplacementRulesGroup group in this.rules.RuleGroups) { groupPanel = new Expando(); groupPanel.CustomSettings.NormalBackColor = Color.FromArgb(255, 214, 223, 247); groupPanel.CustomSettings.NormalBorder.Bottom = 1; groupPanel.CustomSettings.NormalBorder.Left = 1; groupPanel.CustomSettings.NormalBorder.Right = 1; groupPanel.CustomSettings.NormalBorder.Top = 0; groupPanel.CustomSettings.NormalBorderColor = Color.White; groupPanel.CustomSettings.NormalPadding = new XPExplorerBar.Padding(0, 0, 0, 0); groupPanel.CustomSettings.SpecialBackColor = Color.FromArgb(255, 239, 243, 255); groupPanel.CustomSettings.SpecialBorder.Bottom = 1; groupPanel.CustomSettings.SpecialBorder.Left = 1; groupPanel.CustomSettings.SpecialBorder.Right = 1; groupPanel.CustomSettings.SpecialBorder.Top = 0; groupPanel.CustomSettings.SpecialBorderColor = Color.White; groupPanel.CustomSettings.SpecialPadding = new XPExplorerBar.Padding(12, 10, 12, 10); groupPanel.Padding.Left = 0; groupPanel.Padding.Top = 0; groupPanel.Padding.Right = 0; groupPanel.Padding.Bottom = 0; groupPanel.Margin = new Padding(0, 0, 0, 0); groupPanel.SystemSettings.TaskItem.FontDecoration = FontStyle.Underline; groupPanel.SystemSettings.TaskItem.HotLinkColor = Color.FromArgb(255, 66, 142, 255); groupPanel.SystemSettings.TaskItem.LinkColor = Color.FromArgb(255, 33, 93, 198); groupPanel.SystemSettings.TaskItem.Margin = new Margin(0, 0, 0, 0); groupPanel.SystemSettings.TaskItem.Padding = new XPExplorerBar.Padding(6, 0, 4, 0); groupPanel.CustomHeaderSettings.GradientOffset = (float)0.5; groupPanel.CustomHeaderSettings.Margin = 15; groupPanel.CustomHeaderSettings.NormalAlignment = ContentAlignment.MiddleLeft; groupPanel.CustomHeaderSettings.NormalBackColor = Color.Transparent; groupPanel.CustomHeaderSettings.NormalBorder.Bottom = 0; groupPanel.CustomHeaderSettings.NormalBorder.Top = 2; groupPanel.CustomHeaderSettings.NormalBorder.Left = 2; groupPanel.CustomHeaderSettings.NormalBorder.Right = 2; groupPanel.CustomHeaderSettings.NormalBorderColor = Color.FromArgb(255, 198, 211, 247); groupPanel.CustomHeaderSettings.NormalGradientEndColor = Color.FromArgb(255, 49, 106, 197); groupPanel.CustomHeaderSettings.NormalGradientStartColor = Color.White; groupPanel.CustomHeaderSettings.NormalPadding = new XPExplorerBar.Padding(10, 0, 1, 0); groupPanel.CustomHeaderSettings.NormalTitleColor = Color.FromArgb(255, 33, 93, 198); groupPanel.CustomHeaderSettings.NormalTitleHotColor = Color.FromArgb(255, 66, 142, 255); groupPanel.CustomHeaderSettings.SpecialBackColor = Color.Transparent; groupPanel.CustomHeaderSettings.SpecialBorder.Bottom = 0; groupPanel.CustomHeaderSettings.SpecialBorder.Top = 2; groupPanel.CustomHeaderSettings.SpecialBorder.Left = 2; groupPanel.CustomHeaderSettings.SpecialBorder.Right = 2; groupPanel.CustomHeaderSettings.SpecialGradientEndColor = Color.FromArgb(255, 49, 106, 197); groupPanel.CustomHeaderSettings.SpecialGradientStartColor = Color.White; groupPanel.CustomHeaderSettings.SpecialPadding = new XPExplorerBar.Padding(10, 0, 0, 0); groupPanel.CustomHeaderSettings.SpecialTitleColor = Color.White; groupPanel.CustomHeaderSettings.SpecialTitleHotColor = Color.FromArgb(255, 66, 142, 255); groupPanel.CustomHeaderSettings.TitleFont = new Font("Tahoma", 8); groupPanel.CustomHeaderSettings.TitleRadius = 5; groupPanel.CustomHeaderSettings.TitleGradient = true; groupPanel.AutoLayout = true; groupPanel.ContextMenuStrip = this.groupPanelContextMenu; groupPanel.AllowDrop = true; groupPanel.DragEnter += this.GroupPanel_DragEnter; groupPanel.DragDrop += this.GroupPanel_DragDrop; ReplacementRuleUI rulePanel; for (int rulePos = 0; rulePos < group.Rules.Count; rulePos++) { rulePanel = new ReplacementRuleUI(group.Rules[rulePos], this.TagNames, groupPanel); Button deleteRule = new Button { Location = new Point(763, 3), Name = "deleteRule", Size = new Size(80, 20), AutoSizeMode = AutoSizeMode.GrowOnly, AutoSize = true, TabIndex = 6, Text = "Delete rule" }; deleteRule.Click += this.DeleteRule_Click; rulePanel.Width = rulePanel.Width + deleteRule.Bounds.Width + rulePanel.Margin.Horizontal; rulePanel.Controls.Add(deleteRule); groupPanel.Items.Add(rulePanel); } this.taskPane1.Expandos.Add(groupPanel); } }
private ReplacementRule GetRuleFromRuleUI(ReplacementRuleUI ruleUI, ReplacementRulesGroup rulesGroup) { int ruleIndex = ruleUI.Owner.Items.IndexOf(ruleUI); return rulesGroup.Rules[ruleIndex]; }