/// <summary> /// Creates a new instance of <see cref="HotstringSelectedOptions"/> populated with the /// values in <paramref name="Options"/> /// </summary> /// <param name="Options">The Array of Enum Values use to populate the instance</param> /// <returns> /// Instance of <see cref="HotstringSelectedOptions"/>. If <paramref name="Options"/> is null /// then return instance will have no values. /// </returns> public new static HotstringSelectedOptions FromArray(HotStringOptionsEnum[] Options) { var so = SelectedOptionRule <HotStringOptionsEnum> .FromArray(Options); HotstringSelectedOptions hs = new HotstringSelectedOptions(); hs.Keys = so.Keys; hs.Options = so.Options; return(hs); }
/// <summary> /// Gets a Instance of <see cref="HotstringSelectedOptions"/> From a String value /// </summary> /// <param name="s">The String to parse for values</param> /// <returns> /// Instance of <see cref="HotstringSelectedOptions"/> if Parse succeeded; Otherwise, null. /// </returns> /// <exception cref="ArgumentNullException"></exception> public new static HotstringSelectedOptions Parse(string s) { if (string.IsNullOrEmpty(s)) { throw new ArgumentNullException(); } try { // all chars except for `n and `t are single chars var opt = new HotstringSelectedOptions(); var so = SelectedOptionRule <HotStringOptionsEnum> .Parse(s); opt.Keys = so.Keys; opt.Options = so.Options; opt.ExcludeRules = so.ExcludeRules; return(opt); } catch (Exception) { throw; } }