/// <summary> /// Updates the tab with the contents of the specified list. /// </summary> /// <param name="source">The source.</param> /// <param name="tabIndex">Index of the tab.</param> /// <param name="list">The list.</param> public static void UpdateTab(this IMMAttributeEditor source, mmAETabIndex tabIndex, ID8List list) { var tab = source.GetTabContents(tabIndex); tab.Clear(); if (list.HasChildren) { ID8ListItem item; while ((item = list.Next(false)) != null) { tab.Add(item); } } }
/// <summary> /// Selects the item in the attribute editor when specified tab is visible. /// </summary> /// <param name="source">The source.</param> /// <param name="tabIndex">Index of the tab.</param> /// <param name="item">The item.</param> /// <returns> /// Returns <see cref="bool" /> representing <c>true</c> when the item was selected. /// </returns> public static bool SelectItem(this IMMAttributeEditor source, mmAETabIndex tabIndex, ID8ListItem item) { if (source == null) { return(false); } if (source.Show(tabIndex)) { var ui = source.UI as IMMAttributeEditorUI2; if (ui == null) { return(false); } ui.SelectItem((int)tabIndex, item); return(true); } return(false); }
/// <summary> /// Gets the <see cref="ID8List" /> of the tab. /// </summary> /// <param name="source">The source.</param> /// <param name="tabIndex">Index of the tab.</param> /// <returns> /// Returns a <see cref="ID8List" /> representing the list of the tab. /// </returns> public static ID8List GetTabContents(this IMMAttributeEditor source, mmAETabIndex tabIndex) { if (source == null) { return(null); } switch (tabIndex) { case mmAETabIndex.mmAEDesign: return(DesignerTopLevel.Instance as ID8List); case mmAETabIndex.mmAESelection: return(FeSelTopLevel.Instance as ID8List); case mmAETabIndex.mmAEQAQC: return(QAQCTopLevel.Instance as ID8List); default: return(CuSelTopLevel.Instance as ID8List); } }
/// <summary> /// Shows the specified tab index. /// </summary> /// <param name="source">The source.</param> /// <param name="tabIndex">Index of the tab.</param> /// <returns> /// Returns <see cref="bool" /> representing <c>true</c> when the tab is shown. /// </returns> public static bool Show(this IMMAttributeEditor source, mmAETabIndex tabIndex) { if (source == null) { return(false); } var ui = source.UI; if (ui == null) { return(false); } if (!ui.PageVisible[(int)tabIndex]) { return(false); } ui.ActivePage = (int)tabIndex; ui.Show(); return(true); }