@@ -43,47 +43,64 @@ private OpenXmlPartReader(bool readMiscNodes)
43
43
{
44
44
}
45
45
46
+ /// <summary>
47
+ /// Initializes a new instance of the OpenXmlPartReader class using the supplied OpenXmlPart class.
48
+ /// </summary>
49
+ /// <param name="openXmlPart">The OpenXmlPart to read.</param>
50
+ public OpenXmlPartReader ( OpenXmlPart openXmlPart ) : this ( )
51
+ {
52
+ if ( openXmlPart is null )
53
+ {
54
+ throw new ArgumentNullException ( nameof ( openXmlPart ) ) ;
55
+ }
56
+
57
+ _xmlReader = CreateReader ( openXmlPart . GetStream ( FileMode . Open ) , true , openXmlPart . MaxCharactersInPart , ignoreWhitespace : false , out _standalone , out _encoding ) ;
58
+ }
59
+
46
60
/// <summary>
47
61
/// Initializes a new instance of the OpenXmlPartReader class using the supplied OpenXmlPart and Boolean values.
48
62
/// </summary>
49
63
/// <param name="openXmlPart">The OpenXmlPart to read.</param>
50
64
/// <param name="readMiscNodes">Specify false to indicate to the reader to skip all miscellaneous nodes. The default value is false.</param>
51
- /// <param name="ignoreWhitespace">Specify true to indicate to the reader to ignore insignificant white space. The default value is true.</param>
52
- public OpenXmlPartReader ( OpenXmlPart openXmlPart , bool readMiscNodes = false , bool ignoreWhitespace = true )
65
+ public OpenXmlPartReader ( OpenXmlPart openXmlPart , bool readMiscNodes )
53
66
: this ( readMiscNodes )
54
67
{
55
68
if ( openXmlPart is null )
56
69
{
57
70
throw new ArgumentNullException ( nameof ( openXmlPart ) ) ;
58
71
}
59
72
60
- _xmlReader = CreateReader ( openXmlPart . GetStream ( FileMode . Open ) , true , openXmlPart . MaxCharactersInPart , ignoreWhitespace , out _standalone , out _encoding ) ;
73
+ _xmlReader = CreateReader ( openXmlPart . GetStream ( FileMode . Open ) , true , openXmlPart . MaxCharactersInPart , ignoreWhitespace : false , out _standalone , out _encoding ) ;
61
74
}
62
75
63
76
/// <summary>
64
77
/// Initializes a new instance of the OpenXmlPartReader class using the supplied OpenXmlPart and Boolean values.
65
78
/// </summary>
66
79
/// <param name="openXmlPart">The OpenXmlPart to read.</param>
67
80
/// <param name="readMiscNodes">Specify false to indicate to the reader to skip all miscellaneous nodes. The default value is false.</param>
68
- public OpenXmlPartReader ( OpenXmlPart openXmlPart , bool readMiscNodes )
69
- : this ( openXmlPart , readMiscNodes , ignoreWhitespace : true )
81
+ /// <param name="ignoreWhitespace">Specify true to indicate to the reader to ignore insignificant white space. The default value is true.</param>
82
+ public OpenXmlPartReader ( OpenXmlPart openXmlPart , bool readMiscNodes , bool ignoreWhitespace )
83
+ : this ( readMiscNodes )
70
84
{
85
+ if ( openXmlPart is null ) {
86
+ throw new ArgumentNullException ( nameof ( openXmlPart ) ) ;
87
+ }
88
+
89
+ _xmlReader = CreateReader ( openXmlPart . GetStream ( FileMode . Open ) , true , openXmlPart . MaxCharactersInPart , ignoreWhitespace , out _standalone , out _encoding ) ;
71
90
}
72
91
73
92
/// <summary>
74
93
/// Initializes a new instance of the OpenXmlPartReader class using the supplied stream.
75
94
/// </summary>
76
95
/// <param name="partStream">The part stream of the OpenXmlPart to read.</param>
77
- /// <param name="readMiscNodes">Specify false to indicate to the reader to skip all miscellaneous nodes. The default value is false.</param>
78
- /// <param name="ignoreWhitespace">Specify true to indicate to the reader to ignore insignificant white space. The default value is true.</param>
79
- public OpenXmlPartReader ( Stream partStream , bool readMiscNodes = false , bool ignoreWhitespace = true ) : this ( readMiscNodes )
96
+ public OpenXmlPartReader ( Stream partStream ) : this ( )
80
97
{
81
98
if ( partStream is null )
82
99
{
83
100
throw new ArgumentNullException ( nameof ( partStream ) ) ;
84
101
}
85
102
86
- _xmlReader = CreateReader ( partStream , false , 0 , ignoreWhitespace , out _standalone , out _encoding ) ;
103
+ _xmlReader = CreateReader ( partStream , false , 0 , ignoreWhitespace : false , out _standalone , out _encoding ) ;
87
104
}
88
105
89
106
/// <summary>
@@ -92,8 +109,30 @@ public OpenXmlPartReader(Stream partStream, bool readMiscNodes = false, bool ign
92
109
/// <param name="partStream">The part stream of the OpenXmlPart to read.</param>
93
110
/// <param name="readMiscNodes">Specify false to indicate to the reader to skip all miscellaneous nodes. The default value is false.</param>
94
111
public OpenXmlPartReader ( Stream partStream , bool readMiscNodes )
95
- : this ( partStream , readMiscNodes , true )
112
+ : this ( readMiscNodes )
113
+ {
114
+ if ( partStream is null )
115
+ {
116
+ throw new ArgumentNullException ( nameof ( partStream ) ) ;
117
+ }
118
+
119
+ _xmlReader = CreateReader ( partStream , false , 0 , ignoreWhitespace : false , out _standalone , out _encoding ) ;
120
+ }
121
+
122
+ /// <summary>
123
+ /// Initializes a new instance of the OpenXmlPartReader class using the supplied stream and Boolean values.
124
+ /// </summary>
125
+ /// <param name="partStream">The part stream of the OpenXmlPart to read.</param>
126
+ /// <param name="readMiscNodes">Specify false to indicate to the reader to skip all miscellaneous nodes. The default value is false.</param>
127
+ /// <param name="ignoreWhitespace">Specify true to indicate to the reader to ignore insignificant white space. The default value is true.</param>
128
+ public OpenXmlPartReader ( Stream partStream , bool readMiscNodes , bool ignoreWhitespace )
129
+ : this ( readMiscNodes )
96
130
{
131
+ if ( partStream is null ) {
132
+ throw new ArgumentNullException ( nameof ( partStream ) ) ;
133
+ }
134
+
135
+ _xmlReader = CreateReader ( partStream , false , 0 , ignoreWhitespace , out _standalone , out _encoding ) ;
97
136
}
98
137
99
138
/// <summary>
0 commit comments