public void InsertSame()
        {
            HtmlDiv g = new HtmlDiv("");

            HtmlLabel l = new HtmlLabel("");

            g.Insert(0, l);
            g.Insert(0, l);

            Assert.AreSame(l.Container, g);
            Assert.IsTrue(g.Contents.Any(c => ReferenceEquals(c, l)));
            Assert.AreEqual(g.Contents.Count, 1);
        }
        public void InsertOutOfRange1()
        {
            HtmlDiv g = new HtmlDiv("");

            HtmlLabel l = new HtmlLabel("");

            g.Insert(1, l);
        }
        public void InsertOutOfRange2()
        {
            HtmlDiv g = new HtmlDiv("");

            g.Add(new HtmlLabel(""));
            g.Add(new HtmlLabel(""));
            g.Add(new HtmlLabel(""));

            g.Insert(4, new HtmlLabel(""));
        }
        public void InsertContained()
        {
            HtmlDiv g1 = new HtmlDiv("");
            HtmlDiv g2 = new HtmlDiv("");

            HtmlLabel l = new HtmlLabel("");

            g1.Add(l);
            g2.Insert(0, l);

            Assert.AreSame(l.Container, g2);
            Assert.IsFalse(g1.Contents.Any(c => ReferenceEquals(c, l)));
            Assert.IsTrue(g2.Contents.Any(c => ReferenceEquals(c, l)));
        }
        public virtual void Visit(FormDatePicker formDatePicker, HtmlContainer htmlContainer)
        {
            if (formDatePicker.Icon == FormIcon.NotSet)
            {
                return;
            }

            HtmlTextBox htmlTextBox = null;
            int         i;

            for (i = 0; i < htmlContainer.Contents.Count; i++)
            {
                if (htmlContainer.Contents[i] is HtmlTextBox)
                {
                    htmlTextBox = (HtmlTextBox)htmlContainer.Contents[i];
                    break;
                }
            }

            if (htmlTextBox == null)
            {
                return;
            }

            htmlContainer.Remove(htmlTextBox);

            HtmlItalic htmlItalic = new HtmlItalic();

            htmlItalic.Class.AddRange(IconClass(formDatePicker.Icon));

            HtmlDiv htmlDiv = new HtmlDiv();

            htmlDiv.Add(htmlTextBox);
            htmlDiv.Insert(prepend ? 0 : 1, htmlItalic);

            htmlContainer.Insert(i, htmlDiv);
        }
        public void InsertNull()
        {
            HtmlDiv g = new HtmlDiv("");

            g.Insert(0, null);
        }