/// <summary> /// Add a separator line in the menu. The separator is added at the end of the specified index in the list. /// </summary> /// <param name="subMenuPath">The submenu path where the separator is added. Path components are delimited by forward slashes ('/').</param> /// <param name="atIndex">Index where the separator should be inserted.</param> public void InsertSeparator(string subMenuPath, int atIndex) { if (atIndex > 0 && atIndex <= menuItems.Count && !(menuItems[atIndex - 1] is DropdownMenuSeparator)) { DropdownMenuSeparator separator = new DropdownMenuSeparator(subMenuPath ?? String.Empty); menuItems.Insert(atIndex, separator); } }
/// <summary> /// Add a separator line in the menu. The separator is added at the end of the current item list. /// </summary> /// <param name="subMenuPath">The submenu path where the separator will be added. Path components are delimited by forward slashes ('/').</param> public void AppendSeparator(string subMenuPath = null) { if (menuItems.Count > 0 && !(menuItems[menuItems.Count - 1] is DropdownMenuSeparator)) { DropdownMenuSeparator separator = new DropdownMenuSeparator(subMenuPath ?? String.Empty); menuItems.Add(separator); } }
public void InsertSeparator(string subMenuPath, int atIndex) { bool flag = atIndex > 0 && atIndex <= this.menuItems.Count && !(this.menuItems[atIndex - 1] is DropdownMenuSeparator); if (flag) { DropdownMenuSeparator item = new DropdownMenuSeparator(subMenuPath ?? string.Empty); this.menuItems.Insert(atIndex, item); } }
public void AppendSeparator(string subMenuPath = null) { bool flag = this.menuItems.Count > 0 && !(this.menuItems[this.menuItems.Count - 1] is DropdownMenuSeparator); if (flag) { DropdownMenuSeparator item = new DropdownMenuSeparator(subMenuPath ?? string.Empty); this.menuItems.Add(item); } }