Exemplo n.º 1
0
 public AllLinesContentWriter(
     string input,
     ContentTextWriter writer,
     ContentWriterOptions options = null,
     IResultStorage storage       = null) : base(input, writer, options)
 {
     ResultStorage = storage;
 }
Exemplo n.º 2
0
 public UnmatchedLineWriter(
     string input,
     ContentTextWriter writer,
     ContentWriterOptions options = null,
     IResultStorage storage       = null) : base(input, writer, options)
 {
     ResultStorage     = storage;
     MatchingLineCount = 0;
 }
Exemplo n.º 3
0
 public ValueWriter(
     ContentTextWriter writer,
     string indent            = null,
     bool includeEndingIndent = true)
 {
     Writer = writer;
     Indent = indent;
     IncludeEndingIndent = includeEndingIndent;
 }
Exemplo n.º 4
0
 public ValueContentWriter(
     string input,
     ContentTextWriter writer,
     ContentWriterOptions options = null,
     IResultStorage storage       = null,
     MatchOutputInfo outputInfo   = null) : base(input, writer, options)
 {
     ResultStorage = storage;
     OutputInfo    = outputInfo;
 }
Exemplo n.º 5
0
 protected ContentWriter(
     string input,
     ContentTextWriter writer,
     ContentWriterOptions options)
 {
     Input             = input;
     Options           = options;
     MatchingLineCount = -1;
     Writer            = writer;
 }
Exemplo n.º 6
0
        public static ContentWriter CreateFind(
            ContentDisplayStyle contentDisplayStyle,
            string input,
            ContentWriterOptions options,
            IResultStorage storage,
            MatchOutputInfo outputInfo,
            ContentTextWriter writer,
            bool ask = false)
        {
            if (ask)
            {
                switch (contentDisplayStyle)
                {
                case ContentDisplayStyle.Value:
                case ContentDisplayStyle.ValueDetail:
                    return(new AskValueContentWriter(input, options, storage, outputInfo));

                case ContentDisplayStyle.Line:
                    return(new AskLineContentWriter(input, options, storage));

                case ContentDisplayStyle.UnmatchedLines:
                case ContentDisplayStyle.AllLines:
                    throw new InvalidOperationException();

                default:
                    throw new InvalidOperationException($"Unknown enum value '{contentDisplayStyle}'.");
                }
            }
            else
            {
                switch (contentDisplayStyle)
                {
                case ContentDisplayStyle.Value:
                case ContentDisplayStyle.ValueDetail:
                    return(new ValueContentWriter(input, writer, options, storage, outputInfo));

                case ContentDisplayStyle.Line:
                    return(new LineContentWriter(input, writer, options, storage));

                case ContentDisplayStyle.UnmatchedLines:
                    return(new UnmatchedLineWriter(input, writer, options, storage));

                case ContentDisplayStyle.AllLines:
                    return(new AllLinesContentWriter(input, writer, options, storage));

                default:
                    throw new InvalidOperationException($"Unknown enum value '{contentDisplayStyle}'.");
                }
            }
        }