Example #1
0
 public void Remove(OptionElement o)
 {
     if (o == null)
     {
         return;
     }
     base.InnerList.Remove(o);
 }
Example #2
0
 public bool Contains(OptionElement o)
 {
     if (o == null)
     {
         return(false);
     }
     return(InnerList.Contains(o));
 }
Example #3
0
 public void Add(OptionElement o)
 {
     if (o == null)
     {
         return;
     }
     base.InnerList.Add(o);
 }
Example #4
0
 internal OptionOnlyElementsCollection(Interop.IHTMLElement optGroup, IHtmlEditor editor) : base()
 {
     this.editor = editor;
     Interop.IHTMLElementCollection options = (Interop.IHTMLElementCollection)optGroup.GetChildren();
     for (int i = 0; i < options.GetLength(); i++)
     {
         Interop.IHTMLElement el = (Interop.IHTMLElement)options.Item(i, i);
         OptionElement        oe = null;
         oe = new OptionElement(el, editor);
         if (oe != null)
         {
             InnerList.Add(oe);
         }
     }
 }
Example #5
0
        private void CreateOptionList(Interop.IHTMLSelectElement s)
        {
            if (_options == null)
            {
                _options = new OptionElementsCollection(s, base.HtmlEditor);
                _options.OnInsertHandler += new CollectionInsertHandler(_options_OnInsertHandler);
                _options.OnClearHandler  += new CollectionClearHandler(_options_OnClearHandler);
            }
            else
            {
                Debug.WriteLine("Recreate List");
                _options.OnInsertHandler -= new CollectionInsertHandler(_options_OnInsertHandler);
                _options.OnClearHandler  -= new CollectionClearHandler(_options_OnClearHandler);
                _options.Clear();
                Interop.IHTMLElement           selectElement = (Interop.IHTMLElement)s;
                Interop.IHTMLElementCollection options       = (Interop.IHTMLElementCollection)selectElement.GetChildren();
                for (int i = 0; i < options.GetLength(); i++)
                {
                    Interop.IHTMLElement el = (Interop.IHTMLElement)options.Item(i, i);
                    IOptionElement       oe = null;
                    switch (el.GetTagName())
                    {
                    case "OPTION":
                        oe = new OptionElement(el, base.HtmlEditor);
                        break;

                    case "OPTGROUP":
                        oe = new OptGroupElement(el, base.HtmlEditor);
                        break;
                    }
                    if (oe != null)
                    {
                        _options.Add(oe);
                    }
                }
                _options.OnInsertHandler += new CollectionInsertHandler(_options_OnInsertHandler);
                _options.OnClearHandler  += new CollectionClearHandler(_options_OnClearHandler);
            }
        }
        internal OptionElementsCollection(Interop.IHTMLSelectElement s, IHtmlEditor editor) : base()
        {
            selectElement = (Interop.IHTMLElement)s;
            Interop.IHTMLElementCollection options = (Interop.IHTMLElementCollection)selectElement.GetChildren();
            for (int i = 0; i < options.GetLength(); i++)
            {
                Interop.IHTMLElement el = (Interop.IHTMLElement)options.Item(i, i);
                object oe = null;
                switch (el.GetTagName())
                {
                case "OPTION":
                    oe = new OptionElement(el, editor);
                    break;

                case "OPTGROUP":
                    oe = new OptGroupElement(el, editor);
                    break;
                }
                if (oe != null)
                {
                    InnerList.Add(oe);
                }
            }
        }