/// <summary> /// 格式化选择的控件 /// </summary> /// <param name="pCurrentCtl"></param> /// <param name="pType"></param> public override void ExecCommand(CommandID cmdID) { DIYReport.ReportModel.RptSingleObj rptObj = DesignEnviroment.CurrentRptObj as DIYReport.ReportModel.RptSingleObj; if (rptObj == null) { return; } if (cmdID.Equals(FormattingCommands.BackColor)) { System.Windows.Forms.ColorDialog backColor = new ColorDialog(); backColor.Color = rptObj.BackgroundColor; if (backColor.ShowDialog() == System.Windows.Forms.DialogResult.OK) { rptObj.BackgroundColor = backColor.Color; } } else if (cmdID.Equals(FormattingCommands.ForeColor)) { System.Windows.Forms.ColorDialog foreColor = new ColorDialog(); foreColor.Color = rptObj.ForeColor; if (foreColor.ShowDialog() == System.Windows.Forms.DialogResult.OK) { rptObj.ForeColor = foreColor.Color; } } else { //Debug.Assert(false,"该cmdID" + cmdID.ID.ToString() +"目前还没有处理。"); } }
public ExpressValue(DIYReport.ReportModel.RptSingleObj pObj) { _Name = pObj.Name; _RptObj = pObj; if (RptObj != null) { _FieldName = RptObj.FieldName; } else { _FieldName = ""; } }
private void createRptObj(DIYReport.ReportModel.RptSection pSection, XmlNodeList pSectionList) { foreach (XmlNode node in pSectionList) { DIYReport.ReportModel.RptSingleObj obj = new DIYReport.ReportModel.RptSingleObj(); int objType = PublicFun.ToInt(node.Attributes["Type"].Value); DIYReport.ReportModel.RptObjType type = (DIYReport.ReportModel.RptObjType)objType; string objName = node.Attributes["Name"].Value; DIYReport.Interface.IRptSingleObj singObj = RptObjectHelper.CreateObj(type); // switch(type){ // case DIYReport.ReportModel.RptObjType.Line: // singObj = new DIYReport.ReportModel.RptObj.RptLine(objName); // break; // case DIYReport.ReportModel.RptObjType.Rect: // singObj = new DIYReport.ReportModel.RptObj.RptRect(objName); // break; // case DIYReport.ReportModel.RptObjType.Text: // singObj = new DIYReport.ReportModel.RptObj.RptLable(objName); // break; // case DIYReport.ReportModel.RptObjType.Express: // singObj = new DIYReport.ReportModel.RptObj.RptExpressBox(objName); // break; // case DIYReport.ReportModel.RptObjType.Image: // singObj = new DIYReport.ReportModel.RptObj.RptPictureBox(objName); // break; // // default: // Debug.Assert("该对象类型" + type.ToString() + "目前还没有处理."); // break; // } fillInfoToRptObj(singObj, node); singObj.Section = pSection; //把控件增加到Section 中 pSection.RptObjList.Add(singObj); } }