コード例 #1
0
ファイル: SelectElement.cs プロジェクト: polytronicgr/netrix
        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);
            }
        }
コード例 #2
0
 ISelectElement IContentModel<ISelectElement, IOptionElement>.this[IOptionElement child]
 {
     get { return this[child]; }
 }
コード例 #3
0
 IOptgroupElement IContentModel<IOptgroupElement, IOptionElement>.this[IOptionElement child]
 {
     get { return this[child]; }
 }
コード例 #4
0
 ISelectElement IContentModel <ISelectElement, IOptionElement> .this[IOptionElement child]
 {
     get { return(this[child]); }
 }