コード例 #1
0
        List<MatrixRow> _Items;			// list of MatrixRow

		public MatrixRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
		{
			MatrixRow m;
            _Items = new List<MatrixRow>();
			// Loop thru all the child nodes
			foreach(XmlNode xNodeLoop in xNode.ChildNodes)
			{
				if (xNodeLoop.NodeType != XmlNodeType.Element)
					continue;
				switch (xNodeLoop.Name)
				{
					case "MatrixRow":
						m = new MatrixRow(r, this, xNodeLoop);
						break;
					default:	
						m=null;		// don't know what this is
						// don't know this element - log it
						OwnerReport.rl.LogError(4, "Unknown MatrixRows element '" + xNodeLoop.Name + "' ignored.");
						break;
				}
				if (m != null)
					_Items.Add(m);
			}
			if (_Items.Count == 0)
				OwnerReport.rl.LogError(8, "For MatrixRows at least one MatrixRow is required.");
			else
                _Items.TrimExcess();
		}
コード例 #2
0
        List <MatrixRow> _Items;                 // list of MatrixRow

        public MatrixRows(ReportDefn r, ReportLink p, XmlNode xNode) : base(r, p)
        {
            MatrixRow m;

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

                default:
                    m = null;                                   // don't know what this is
                    // don't know this element - log it
                    OwnerReport.rl.LogError(4, "Unknown MatrixRows element '" + xNodeLoop.Name + "' ignored.");
                    break;
                }
                if (m != null)
                {
                    _Items.Add(m);
                }
            }
            if (_Items.Count == 0)
            {
                OwnerReport.rl.LogError(8, "For MatrixRows at least one MatrixRow is required.");
            }
            else
            {
                _Items.TrimExcess();
            }
        }