public SetAttributeOperationChild(SetAttributeOperationModel setAttributeOperationModel, ScriptUserControl suc) : base(suc) { this.setAttributeOperationModel = setAttributeOperationModel; //构建对话框 foreach (var item in setAttributeOperationModel.AttributeOperationModels) { ComboBox cb = GetComboBox(new List <string> { "Time", "Position", "Color" }, null); TextBox tb = GetTexeBox(item.Value); tb.Width = 300; if (item.attributeType.Equals(SetAttributeOperationModel.AttributeOperationModel.AttributeType.TIME)) { //时间支持表达式 cb.SelectedIndex = 0; } else if (item.attributeType.Equals(SetAttributeOperationModel.AttributeOperationModel.AttributeType.POSITION)) { cb.SelectedIndex = 1; } else if (item.attributeType.Equals(SetAttributeOperationModel.AttributeOperationModel.AttributeType.COLOR)) { cb.SelectedIndex = 2; } AddUIElement(GetDockPanel(new List <FrameworkElement> { cb, tb, ViewBusiness.GetImage("check_gray.png", 25, IvCheck_MouseLeftButtonDown) })); } AddUIElement(GetDockPanel(new List <FrameworkElement> { ViewBusiness.GetButton("Add", IvAdd_MouseLeftButtonDown), ViewBusiness.GetButton("Delete", IvReduce_MouseLeftButtonDown), ViewBusiness.GetButton("Change", IvChange_Click) })); CreateDialog(); //TODO //AddTitleImage(new List<String>() { "add_white.png", "reduce.png" }, new List<System.Windows.Input.MouseButtonEventHandler>() { IvAdd_MouseLeftButtonDown, IvReduce_MouseLeftButtonDown }); }
public BaseStyle GetButton(String textName, RoutedEventHandler routedEventHandler, out Button btn) { btn = ViewBusiness.GetButton(textName, routedEventHandler); return(this); }
public ShapeColorOperationChild(ShapeColorOperationModel shapeColorOperationModel, ScriptUserControl suc) : base(suc) { this.shapeColorOperationModel = shapeColorOperationModel; ComboBox cb = GetComboBox(new List <string>() { "Square", "Vertical", "Horizontal" }, null); cb.IsEnabled = false; AddTitleAndControl("TypeColon", cb); mLaunchpad.SetLaunchpadBackground(new SolidColorBrush(Color.FromRgb(43, 43, 43))); mLaunchpad.Size = 300; textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[0] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[1] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[2] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[3] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[4] + "")); if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.SQUARE) { cb.SelectedIndex = 0; } else if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.RADIALVERTICAL) { cb.SelectedIndex = 1; textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[5] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[6] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[7] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[8] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[9] + "")); } else if (shapeColorOperationModel.MyShapeType == ShapeColorOperationModel.ShapeType.RADIALVERTICAL) { cb.SelectedIndex = 2; textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[5] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[6] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[7] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[8] + "")); textBoxs.Add(GetTexeBox(shapeColorOperationModel.Colors[9] + "")); } GetTexeBlock(shapeColorOperationModel.TopString); List <FrameworkElement> frameworkElements = new List <FrameworkElement>(); frameworkElements.Add(GetTexeBlock(shapeColorOperationModel.TopString)); frameworkElements.AddRange(textBoxs.ToArray()); frameworkElements.Add(GetTexeBlock(shapeColorOperationModel.BottomString)); AddUIElement(GetDockPanel(mLaunchpad, GetVerticalStackPanel(frameworkElements))). AddUIElement(GetHorizontalStackPanel(new List <FrameworkElement>() { ViewBusiness.GetButton("Preview", Preview), ViewBusiness.GetButton("PasteValue", PasteRangeListContent) })); GetButton("Save", ToSave, out Button btn); AddUIElement(btn); CreateDialog(); }
public ConditionJudgmentOperationChild(ConditionJudgmentOperationModel conditionJudgmentOperationModel, ScriptUserControl suc) : base(suc) { this.conditionJudgmentOperationModel = conditionJudgmentOperationModel; this.suc = suc; //构建对话框 cbOperator = GetComboBox(new List <String>() { "Replace", "Remove" }, CbOperator_SelectionChanged); AddTitleAndControl("OperationColon", cbOperator); AddUIElement(GetTexeBlockNoBorder("If", true)); tbIfTime = GetTexeBox(conditionJudgmentOperationModel.IfTime.ToString()); tbIfTime.Width = 270; AddTitleAndControl("TimeColon", new List <FrameworkElement>() { tbIfTime, ViewBusiness.GetImage("calc.png", 25) }); cbAction = GetComboBox(new List <String>() { "All", "Open", "Close" }, null); cbAction.SelectedIndex = conditionJudgmentOperationModel.IfAction; AddTitleAndControl("ActionColon", cbAction); StringBuilder sbPosition = new StringBuilder(); foreach (var item in conditionJudgmentOperationModel.IfPosition) { sbPosition.Append(item).Append(StaticConstant.mw.projectUserControl.suc.StrInputFormatDelimiter); } tbIfPosition = GetTexeBox(sbPosition.ToString().Length > 0 ? sbPosition.ToString().Substring(0, sbPosition.ToString().Length - 1): ""); tbIfPosition.Width = 270; DrawRangeClass drawRangeClass = new DrawRangeClass(tbIfPosition); ShowRangeClass showRangeClassPosition = new ShowRangeClass(tbIfPosition); AddTitleAndControl("PositionColon", new List <FrameworkElement>() { tbIfPosition, ViewBusiness.GetImage("draw.png", 25, drawRangeClass.DrawRange), ViewBusiness.GetImage("more_white.png", 25, showRangeClassPosition.ShowRangeList) }); StringBuilder sbColor = new StringBuilder(); foreach (var item in conditionJudgmentOperationModel.IfColor) { sbColor.Append(item).Append(StaticConstant.mw.projectUserControl.suc.StrInputFormatDelimiter); } tbIfColor = GetTexeBox(sbColor.ToString().Length > 0 ? sbColor.ToString().Substring(0, sbColor.ToString().Length - 1) : ""); tbIfColor.Width = 270; ShowRangeClass showRangeClassColor = new ShowRangeClass(tbIfColor); AddTitleAndControl("ColorColon", new List <FrameworkElement>() { tbIfColor, ViewBusiness.GetImage("more_white.png", 25, showRangeClassColor.ShowRangeList) }); AddUIElement(GetTexeBlockNoBorder("Then", true)); tbThenTime = GetTexeBox(conditionJudgmentOperationModel.ThenTime.ToString()); AddTitleAndControl("TimeColon", tbThenTime); tbThenPosition = GetTexeBox(conditionJudgmentOperationModel.ThenPosition.ToString()); AddTitleAndControl("PositionColon", tbThenPosition); tbThenColor = GetTexeBox(conditionJudgmentOperationModel.ThenColor.ToString()); AddTitleAndControl("ColorColon", tbThenColor); AddUIElement(ViewBusiness.GetButton("Change", IvChange_Click)); cbOperator.SelectedIndex = (int)conditionJudgmentOperationModel.MyOperator - 40; CreateDialog(); }