예제 #1
0
 /// <summary>
 /// Adds an element to the collection of option elements for this select element.
 /// </summary>
 /// <param name="option">The element to be added.</param>
 /// <param name="before">An element of the collection, should be inserted before.</param>
 public void Add(HtmlOptionElement option, HtmlOptionElement before = null)
 {
     if (before == null)
     {
         AppendChild(option);
     }
     else
     {
         InsertBefore(option, before);
     }
 }
예제 #2
0
 /// <summary>
 /// Adds an element to the collection of option elements for this select element.
 /// </summary>
 /// <param name="option">The element to be added.</param>
 /// <param name="index">The index, representing the item should be inserted before.</param>
 public void Add(HtmlOptionElement option, long index) =>
 InsertBefore(option, Options[index]);