Exemple #1
0
 /// <summary>
 /// Adds a <see cref="IParagraphIdGeneratorFeature"/> if not already available.
 /// </summary>
 /// <param name="doc">Document to add generator to.</param>
 public static void AddParagraphIdGeneratorFeature(this WordprocessingDocument doc)
 {
     if (doc.Features.Get <IParagraphIdGeneratorFeature>() is null)
     {
         doc.AddRandomNumberGeneratorFeature();
         doc.Features.Set <IParagraphIdGeneratorFeature>(new ParagraphIdGeneratorFeature(doc.Features, doc.Features.GetRequired <IRandomNumberGeneratorFeature>()));
     }
 }