コード例 #1
0
        StaticCategories _StaticCategories;             // Category headings for this grouping

        internal CategoryGrouping(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            _DynamicCategories = null;
            _StaticCategories  = null;

            // Loop thru all the child nodes
            foreach (XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                {
                    continue;
                }
                switch (xNodeLoop.Name)
                {
                case "DynamicCategories":
                    _DynamicCategories = new DynamicCategories(r, this, xNodeLoop);
                    break;

                case "StaticCategories":
                    _StaticCategories = new StaticCategories(r, this, xNodeLoop);
                    break;

                default:
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown CategoryGrouping element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
            }
            if ((_DynamicCategories == null && _StaticCategories == null) ||
                (_DynamicCategories != null && _StaticCategories != null))
            {
                OwnerReport.rl.LogError(8, "CategoryGrouping requires either DynamicCategories element or StaticCategories element, but not both.");
            }
        }
コード例 #2
0
        StaticCategories _StaticCategories; // Category headings for this grouping

        #endregion Fields

        #region Constructors

        internal CategoryGrouping(ReportDefn r, ReportLink p, XmlNode xNode)
            : base(r, p)
        {
            _DynamicCategories=null;
            _StaticCategories=null;

            // Loop thru all the child nodes
            foreach(XmlNode xNodeLoop in xNode.ChildNodes)
            {
                if (xNodeLoop.NodeType != XmlNodeType.Element)
                    continue;
                switch (xNodeLoop.Name)
                {
                    case "DynamicCategories":
                        _DynamicCategories = new DynamicCategories(r, this, xNodeLoop);
                        break;
                    case "StaticCategories":
                        _StaticCategories = new StaticCategories(r, this, xNodeLoop);
                        break;
                    default:
                        // don't know this element - log it
                        OwnerReport.rl.LogError(4, "Unknown CategoryGrouping element '" + xNodeLoop.Name + "' ignored.");
                        break;
                }
            }
            if ((_DynamicCategories == null && _StaticCategories == null) ||
                (_DynamicCategories != null && _StaticCategories != null))
                OwnerReport.rl.LogError(8, "CategoryGrouping requires either DynamicCategories element or StaticCategories element, but not both.");
        }