internal AdjustSpacesOperation(int space, AdjustSpacesOption option) { Contract.ThrowIfFalse(space >= 0); this.Space = space; this.Option = option; }
internal AdjustSpacesOperation(int space, AdjustSpacesOption option) { Contract.ThrowIfFalse(space >= 0); this.Space = space; this.Option = option; }
/// <summary> /// instruct the engine to try to put the given spaces between two tokens /// </summary> public static AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) { if (space == 1 && option == AdjustSpacesOption.DefaultSpacesIfOnSingleLine) { return(s_defaultOneSpaceIfOnSingleLine); } else if (space == 0 && option == AdjustSpacesOption.ForceSpacesIfOnSingleLine) { return(s_forceZeroSpaceIfOnSingleLine); } else if (space == 1 && option == AdjustSpacesOption.ForceSpacesIfOnSingleLine) { return(s_forceOneSpaceIfOnSingleLine); } else if (space == 1 && option == AdjustSpacesOption.ForceSpaces) { return(s_forceZeroLineUsingSpaceForce); } return(new AdjustSpacesOperation(space, option)); }
private AdjustSpacesOperation AdjustSpacesOperationZeroOrOne(OptionSet optionSet, Option <bool> option, AdjustSpacesOption explicitOption = AdjustSpacesOption.ForceSpacesIfOnSingleLine) { if (optionSet.GetOption(option)) { return(CreateAdjustSpacesOperation(1, explicitOption)); } else { return(CreateAdjustSpacesOperation(0, explicitOption)); } }
protected AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) { return(FormattingOperations.CreateAdjustSpacesOperation(space, option)); }
private AdjustSpacesOperation AdjustSpacesOperationZeroOrOne(OptionSet optionSet, Option<bool> option, AdjustSpacesOption explicitOption = AdjustSpacesOption.ForceSpacesIfOnSingleLine) { if (optionSet.GetOption(option)) { return CreateAdjustSpacesOperation(1, explicitOption); } else { return CreateAdjustSpacesOperation(0, explicitOption); } }
protected AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) => FormattingOperations.CreateAdjustSpacesOperation(space, option);
/// <summary> /// instruct the engine to try to put the given spaces between two tokens /// </summary> public static AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) { if (space == 1 && option == AdjustSpacesOption.DefaultSpacesIfOnSingleLine) { return DefaultOneSpaceIfOnSingleLine; } else if (space == 0 && option == AdjustSpacesOption.ForceSpacesIfOnSingleLine) { return ForceZeroSpaceIfOnSingleLine; } else if (space == 1 && option == AdjustSpacesOption.ForceSpacesIfOnSingleLine) { return ForceOneSpaceIfOnSingleLine; } else if (space == 1 && option == AdjustSpacesOption.ForceSpaces) { return ForceZeroLineUsingSpaceForce; } return new AdjustSpacesOperation(space, option); }
protected AdjustSpacesOperation CreateAdjustSpacesOperation(int space, AdjustSpacesOption option) { return FormattingOperations.CreateAdjustSpacesOperation(space, option); }