/// <summary> /// Create object of option by specified node with settings of option /// </summary> /// <param name="command">reference to parent command</param> /// <param name="option">node with settings of option</param> internal DrCmdOption(DrCmdCommand command, DDNode option) { option.Type.ThrowIsNotExpectedNodeType(DrCmdConst.TypeOption); Option = option; Command = command; name = GetOptionName(); type = GetOptionType(); valueType = GetValueType(); }
/// <summary> /// Checks the current value of the two incongruous flags simultaneously. /// If the two flags are detected at the same time the <exception cref="FormatException">FormatException</exception> will be thrown. /// </summary> /// <param name="current">Current type of value</param> /// <param name="first">the first incongruous flag to detect</param> /// <param name="second">the second incongruous flag to detect</param> private static void CheckIncongruousTypeOfValue(DrCmdValueType current, DrCmdValueType first, DrCmdValueType second) { if (((current & first) == first) & ((current & second) == second)) { throw new FormatException(string.Format(Msg.OPTION_TYPE_HAS_INCONGRUOUS_TYPES, first.ToString(), second.ToString())); } }