public OperationStatus(OperationStatusFlag flag, string reason) { Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort()); Flag = flag; Reasons = reason == null?SpecializedCollections.EmptyEnumerable <string>() : SpecializedCollections.SingletonEnumerable(reason); }
private OperationStatus(OperationStatusFlag flag, IEnumerable <string> reasons) { Contract.ThrowIfNull(reasons); Contract.ThrowIfTrue(flag.Succeeded() && flag.HasBestEffort()); Flag = flag; Reasons = reasons; }
public ExtractMethodResult( OperationStatusFlag status, IEnumerable <string> reasons, Document document, SyntaxToken invocationNameToken, SyntaxNode methodDeclarationNode) { this.Status = status; this.Succeeded = status.Succeeded() && !status.HasSuggestion(); this.SucceededWithSuggestion = status.Succeeded() && status.HasSuggestion(); this.Reasons = (reasons ?? SpecializedCollections.EmptyEnumerable <string>()).ToReadOnlyCollection(); this.Document = document; this.InvocationNameToken = invocationNameToken; this.MethodDeclarationNode = methodDeclarationNode; }
public ExtractMethodResult( OperationStatusFlag status, IEnumerable<string> reasons, Document document, SyntaxToken invocationNameToken, SyntaxNode methodDeclarationNode) { this.Status = status; this.Succeeded = status.Succeeded() && !status.HasSuggestion(); this.SucceededWithSuggestion = status.Succeeded() && status.HasSuggestion(); this.Reasons = (reasons ?? SpecializedCollections.EmptyEnumerable<string>()).ToReadOnlyCollection(); this.Document = document; this.InvocationNameToken = invocationNameToken; this.MethodDeclarationNode = methodDeclarationNode; }
internal ExtractMethodResult( OperationStatusFlag status, IEnumerable <string> reasons, Document?documentWithoutFinalFormatting, ImmutableArray <AbstractFormattingRule> formattingRules, SyntaxToken invocationNameToken, SyntaxNode?methodDeclarationNode) { Status = status; Succeeded = status.Succeeded() && !status.HasSuggestion(); SucceededWithSuggestion = status.Succeeded() && status.HasSuggestion(); Reasons = (reasons ?? SpecializedCollections.EmptyEnumerable <string>()).ToReadOnlyCollection(); DocumentWithoutFinalFormatting = documentWithoutFinalFormatting; FormattingRules = formattingRules; InvocationNameToken = invocationNameToken; MethodDeclarationNode = methodDeclarationNode; }
public static bool Failed(this OperationStatusFlag flag) { return(!flag.Succeeded()); }
public static bool Failed(this OperationStatusFlag flag) => !flag.Succeeded();