public ImmutableOptions(DeclarationHandling declarationHandling, TextNodeHandling textNodeHandling, AttributeHandling attributeHandling, CommentHandling commentHandling, ProcessingInstructionHandling processingInstructionHandling)
 {
     DeclarationHandling           = declarationHandling;
     TextNodeHandling              = textNodeHandling;
     AttributeHandling             = attributeHandling;
     CommentHandling               = commentHandling;
     ProcessingInstructionHandling = processingInstructionHandling;
 }
        private static void CompareComments(XComment a, XComment b, CommentHandling commentHandling)
        {
            switch (commentHandling)
            {
            case CommentHandling.Ignore:
                return;

            case CommentHandling.Compare:
                if (a.Value != b.Value)
                {
                    throw new UnequalityException(new UnequalityReason($"The comments ('{a.Value}' and '{b.Value}') are different", a, b));
                }
                return;

            default:
                throw new Exception("Reached unexpected point in code.");
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonLoadSettings"/> class.
 /// </summary>
 public JsonLoadSettings()
 {
     _lineInfoHandling = LineInfoHandling.Load;
     _commentHandling  = CommentHandling.Ignore;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonLoadSettings"/> class.
 /// </summary>
 public JsonLoadSettings()
 {
     _lineInfoHandling = LineInfoHandling.Load;
     _commentHandling  = CommentHandling.Ignore;
     _duplicatePropertyNameHandling = DuplicatePropertyNameHandling.Replace;
 }
Exemplo n.º 5
0
 public JsonReaderOptions(CommentHandling commentHandling)
 {
     _commentHandling = commentHandling;
 }
Exemplo n.º 6
0
 public DelimReader(char[] delimiter,
     string comment,
     CommentHandling commentHandling,
     ExceptionHandling exceptionHandling,
     WhitespaceHandling whitespaceHandling,
     bool ignoreBlankLines,
     bool ignoreBlankTokens,
     bool ignoreLinesStartingWithDelimiter,
     ICollection<char> stripChars
     )
 {
     m_delimiter = delimiter;
     m_comment = comment;
     m_commentHandling = commentHandling;
     m_exceptionHandling = exceptionHandling;
     m_whitespaceHandling = whitespaceHandling;
     m_ignoreBlankLines = ignoreBlankLines;
     IgnoreBlankTokens = ignoreBlankTokens;
     m_ignoreLinesStartingWithDelimiter = ignoreLinesStartingWithDelimiter;
     m_stripChars = stripChars;
 }