rdlcclass.cs

来自「微软报表解析器语言生成器。选择微软的报表之后可以把每个节点生成一个实体类」· CS 代码 · 共 64 行

CS
64
字号
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
namespace MSReport
{
    public class RDLCClass:RDLCElement,IRDLCElement
    {
        public RDLCClass()
        {
        }

        RDLCAttribute rAttribute = null;
        RDLCAddChildElement rAddChildElement = null;
        RDLCChildElementIsValid rChildElementIsValid = null;
        RDLCWriteChildElement rWriteChildElement = null;
        RDLCInitObject rInitObject = null;
        public override string Create(XmlNode xnode)
        {
            this.ActXNode = xnode;
            if (rAttribute == null)
            {
                rAttribute = new RDLCAttribute();
            }
            rAttribute.nsmgr = this.nsmgr;
            if (rAddChildElement == null)
            {
                rAddChildElement = new RDLCAddChildElement();
            }
            rAddChildElement.nsmgr = this.nsmgr;
            if (rChildElementIsValid == null)
            {
                rChildElementIsValid = new RDLCChildElementIsValid();
            }
            rChildElementIsValid.nsmgr = this.nsmgr;
            if (rWriteChildElement == null)
            {
                rWriteChildElement = new RDLCWriteChildElement();
            }
            rWriteChildElement.nsmgr = this.nsmgr;
            if (rInitObject == null)
            {
                rInitObject = new RDLCInitObject();
            }
            rInitObject.nsmgr = this.nsmgr;
            string ns = @"
    public class " + this.ActXNode.Name.Replace(":", "_") + @":XMLBase
    {
        public " + this.ActXNode.Name.Replace(":", "_") + @"()
        {
            this.TagName =" + this.cstr(xnode.Name) + @";
        }
        " + rAttribute.Create(xnode) + @"
        " + rAddChildElement.Create(xnode) + @"
        " + rChildElementIsValid.Create(xnode) + @"
        " + rWriteChildElement.Create(xnode) + @"
        " + rInitObject.Create(xnode) + @"
    }";
            return ns;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?