Exemple #1
0
        }       //	addNode

        /// <summary>
        /// Add node to Data Structure row
        /// </summary>
        /// <param name="node">node</param>
        public void AddNode(PrintDataElement node)
        {
            if (node == null)
            {
                throw new ArgumentException("Node cannot be null");
            }
            if (_nodes == null)
            {
                AddRow(false, 0);
            }
            _nodes.Add(node);
        }       //	addNode
        }   //  GetHashCode

        public override bool Equals(object compare)
        {
            if (compare.GetType() == typeof(PrintDataElement))
            {
                PrintDataElement pde = (PrintDataElement)compare;
                if (pde.GetColumnName().Equals(_columnName))
                {
                    if (pde.GetValue() != null && pde.GetValue().Equals(_value))
                    {
                        return(true);
                    }
                    if (pde.GetValue() == null && _value == null)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemple #3
0
        }       //	getNode

        /// <summary>
        /// Get Primary Key in row
        /// </summary>
        /// <returns>PK or null</returns>
        public PrintDataElement GetPKey()
        {
            if (_nodes == null)
            {
                return(null);
            }
            for (int i = 0; i < _nodes.Count; i++)
            {
                Object o = _nodes[i];
                if (o.GetType() == typeof(PrintDataElement))
                {
                    PrintDataElement pde = (PrintDataElement)o;
                    if (pde.IsPKey())
                    {
                        return(pde);
                    }
                }
            }
            return(null);
        }       //	getPKey
Exemple #4
0
        }       //	isFunctionRow

        /// <summary>
        /// Is the current Row a Function Row
        /// </summary>
        /// <returns>true if function row</returns>
        public bool IsPageBreak()
        {
            //	page break requires function and meta data
            if (IsFunctionRow() && _nodes != null)
            {
                for (int i = 0; i < _nodes.Count; i++)
                {
                    Object o = _nodes[i];
                    if (o.GetType() == typeof(PrintDataElement))
                    {
                        PrintDataElement pde = (PrintDataElement)o;
                        if (pde.IsPageBreak())
                        {
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }       //	isPageBreak
Exemple #5
0
        }       //	hasLevelNo

        /// <summary>
        /// Get Line Level Number for current row
        /// </summary>
        /// <returns>line level no 0 = default</returns>
        public int GetLineLevelNo()
        {
            if (_nodes == null || !_hasLevelNo)
            {
                return(0);
            }

            for (int i = 0; i < _nodes.Count; i++)
            {
                Object o = _nodes[i];
                if (o.GetType() == typeof(PrintDataElement))
                {
                    PrintDataElement pde = (PrintDataElement)o;
                    if (LEVEL_NO.Equals(pde.GetColumnName()))
                    {
                        int ii = (int)pde.GetValue();
                        return(ii);
                    }
                }
            }
            return(0);
        }       //	getLineLevel