/// <summary>Opens the specified Control Panel item.</summary> /// <param name="item">The Control Panel item.</param> /// <param name="page">Optional. The Control Panel page.</param> /// <returns> /// <see langword="true"/> if this item is supported and has been opened. <see langword="false"/> if an error prevented opening or /// the item or page was unsupported on this OS. /// </returns> /// <exception cref="ArgumentOutOfRangeException">page</exception> public static bool Open(ControlPanelItem item, string page = null) { if (page != null && Array.IndexOf(item.ValidPages(), page) == -1) { throw new ArgumentOutOfRangeException(nameof(page)); } return(CP.Open(item.CanonicalName(), page)); }
/// <summary>Opens the specified Control Panel item.</summary> /// <param name="item">The Control Panel item.</param> /// <param name="page">Optional. The Control Panel page.</param> /// <exception cref="ArgumentOutOfRangeException">page</exception> public static void Open(ControlPanelItem item, string page = null) { if (page != null && Array.IndexOf(item.ValidPages(), page) == -1) { throw new ArgumentOutOfRangeException(nameof(page)); } // TODO: handle minOsVer gracefully CP.Open(item.CanonicalName(), page, null); }