Ejemplo n.º 1
0
        public static CommandConfiguration SetFlag(this CommandConfiguration configuration, CommandConfigurationFlagTypes flag, bool isOn)
        {
            var hasFlag = configuration.HasFlag(flag);

            if (isOn && !hasFlag)
            {
                configuration.Flags |= flag;
            }
            else if (!isOn && hasFlag)
            {
                configuration.Flags &= flag;
            }

            return(configuration);
        }