@@ -39,7 +39,7 @@ namespace PdfSharpCore.Pdf
3939 /// <summary>
4040 /// Represents a collection of outlines.
4141 /// </summary>
42- public class PdfOutlineCollection : PdfObject , ICollection < PdfOutline > , IList < PdfOutline >
42+ public class PdfOutlineCollection : PdfObject , IList < PdfOutline >
4343 {
4444 /// <summary>
4545 /// Can only be created as part of PdfOutline.
@@ -66,26 +66,20 @@ public bool Remove(PdfOutline item)
6666 /// <summary>
6767 /// Gets the number of entries in this collection.
6868 /// </summary>
69- public int Count
70- {
71- get { return _outlines . Count ; }
72- }
69+ public int Count => _outlines . Count ;
7370
7471 /// <summary>
7572 /// Returns false.
7673 /// </summary>
77- public bool IsReadOnly
78- {
79- get { return false ; }
80- }
74+ public bool IsReadOnly => false ;
8175
8276 /// <summary>
8377 /// Adds the specified outline.
8478 /// </summary>
8579 public void Add ( PdfOutline outline )
8680 {
8781 if ( outline == null )
88- throw new ArgumentNullException ( " outline" ) ;
82+ throw new ArgumentNullException ( nameof ( outline ) ) ;
8983
9084 // DestinationPage is optional. PDFsharp does not yet support outlines with action ("/A") instead of destination page ("/DEST")
9185 if ( outline . DestinationPage != null && ! ReferenceEquals ( Owner , outline . DestinationPage . Owner ) )
@@ -209,9 +203,9 @@ public int IndexOf(PdfOutline item)
209203 public void Insert ( int index , PdfOutline outline )
210204 {
211205 if ( outline == null )
212- throw new ArgumentNullException ( " outline" ) ;
206+ throw new ArgumentNullException ( nameof ( outline ) ) ;
213207 if ( index < 0 || index >= _outlines . Count )
214- throw new ArgumentOutOfRangeException ( " index" , index , PSSR . OutlineIndexOutOfRange ) ;
208+ throw new ArgumentOutOfRangeException ( nameof ( index ) , index , PSSR . OutlineIndexOutOfRange ) ;
215209
216210 AddToOutlinesTree ( outline ) ;
217211 _outlines . Insert ( index , outline ) ;
@@ -235,15 +229,15 @@ public PdfOutline this[int index]
235229 get
236230 {
237231 if ( index < 0 || index >= _outlines . Count )
238- throw new ArgumentOutOfRangeException ( " index" , index , PSSR . OutlineIndexOutOfRange ) ;
232+ throw new ArgumentOutOfRangeException ( nameof ( index ) , index , PSSR . OutlineIndexOutOfRange ) ;
239233 return _outlines [ index ] ;
240234 }
241235 set
242236 {
243237 if ( index < 0 || index >= _outlines . Count )
244- throw new ArgumentOutOfRangeException ( " index" , index , PSSR . OutlineIndexOutOfRange ) ;
238+ throw new ArgumentOutOfRangeException ( nameof ( index ) , index , PSSR . OutlineIndexOutOfRange ) ;
245239 if ( value == null )
246- throw new ArgumentOutOfRangeException ( " value" , null , PSSR . SetValueMustNotBeNull ) ;
240+ throw new ArgumentOutOfRangeException ( nameof ( value ) , null , PSSR . SetValueMustNotBeNull ) ;
247241
248242 AddToOutlinesTree ( value ) ;
249243 _outlines [ index ] = value ;
@@ -274,7 +268,7 @@ internal int CountOpen()
274268 void AddToOutlinesTree ( PdfOutline outline )
275269 {
276270 if ( outline == null )
277- throw new ArgumentNullException ( " outline" ) ;
271+ throw new ArgumentNullException ( nameof ( outline ) ) ;
278272
279273 // DestinationPage is optional. PDFsharp does not yet support outlines with action ("/A") instead of destination page ("/DEST")
280274 if ( outline . DestinationPage != null && ! ReferenceEquals ( Owner , outline . DestinationPage . Owner ) )
@@ -287,10 +281,10 @@ void AddToOutlinesTree(PdfOutline outline)
287281 //_outlines.Add(outline);
288282 if ( ! Owner . _irefTable . Contains ( outline . ObjectID ) )
289283 Owner . _irefTable . Add ( outline ) ;
290- else
291- {
292- outline . GetType ( ) ;
293- }
284+ // else
285+ // {
286+ // outline.GetType();
287+ // }
294288
295289 //if (outline.Opened)
296290 //{
@@ -306,7 +300,7 @@ void AddToOutlinesTree(PdfOutline outline)
306300 void RemoveFromOutlinesTree ( PdfOutline outline )
307301 {
308302 if ( outline == null )
309- throw new ArgumentNullException ( " outline" ) ;
303+ throw new ArgumentNullException ( nameof ( outline ) ) ;
310304
311305 // TODO check the parent problems...
312306 //outline.Document = Owner;
@@ -316,7 +310,7 @@ void RemoveFromOutlinesTree(PdfOutline outline)
316310 }
317311
318312 /// <summary>
319- /// The parent outine of this collection.
313+ /// The parent outline of this collection.
320314 /// </summary>
321315 readonly PdfOutline _parent ;
322316
0 commit comments