Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        public void AddElement(Element element)
        {
            bool found = false;

            for (int i = 0; i < this._elementTable.Count; i++)
            {
                Element iterator = (Element)this._elementTable[i];
                if (iterator.ToString() == element.ToString())
                {
                    iterator.AddCount(1);
                    found = true;
                    i     = this._elementTable.Count;
                }
            }
            if (found == false)
            {
                this._elementTable.Add(element);
            }
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="groupElementTable"></param>
        /// <param name="elementTable"></param>
        /// <param name="report"></param>
        /// <returns></returns>
        public static PageReport Validate(GroupElementTable groupElementTable, ElementTable elementTable, PageReport report)
        {
            string badElementList = string.Empty;

            for (int i = 0; i < groupElementTable.GroupElement.Count; i++)
            {
                GroupElement groupElement  = (GroupElement)groupElementTable.GroupElement[i];
                int          expectedCount = groupElement.ExpectedCount;

                if (expectedCount < 0)
                {
                    badElementList += Environment.NewLine + "'" + groupElement.ToString() + "'";
                }
                else
                {
                    for (int n = 0; n < groupElement.Count; n++)
                    {
                        string elementName = groupElement.Element[n];
                        for (int l = 0; l < elementTable.Element.Count; l++)
                        {
                            Element element = (Element)elementTable.Element[l];
                            if (element.ToString() == elementName)
                            {
                                element.ReleaseCount(expectedCount);
                            }
                        }
                    }
                }
            }
            badElementList = string.Empty;

            for (int i = 0; i < elementTable.Element.Count; i++)
            {
                Element element = (Element)elementTable.Element[i];
                if (element.Count != 0)
                {
                    badElementList += Environment.NewLine + "'" + element.ToString() + "'";
                }
            }

            return(report);
        }
 /// <summary>
 /// 
 /// </summary>
 public void AddElement(Element element)
 {
     bool found=false;
     for(int i=0;i<this._elementTable.Count;i++)
     {
         Element iterator=(Element)this._elementTable[i];
         if(iterator.ToString()==element.ToString())
         {
             iterator.AddCount(1);
             found=true;
             i=this._elementTable.Count;
         }
     }
     if(found==false)
     {
         this._elementTable.Add(element);
     }
 }