Example #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="text">Text</param>
 /// <param name="colorCollection">Colors</param>
 /// <param name="referenceCollection">References</param>
 /// <param name="customDataDict">Custom data dictionary</param>
 internal DocumentViewerContent(string text, CachedTextColorsCollection colorCollection, SpanDataCollection <ReferenceInfo> referenceCollection, Dictionary <string, object> customDataDict)
 {
     if (text == null)
     {
         throw new ArgumentNullException(nameof(text));
     }
     if (colorCollection == null)
     {
         throw new ArgumentNullException(nameof(colorCollection));
     }
     if (referenceCollection == null)
     {
         throw new ArgumentNullException(nameof(referenceCollection));
     }
     if (customDataDict == null)
     {
         throw new ArgumentNullException(nameof(customDataDict));
     }
     colorCollection.Freeze();
     Text                = text;
     ColorCollection     = colorCollection;
     ReferenceCollection = referenceCollection;
     this.customDataDict = customDataDict;
     MethodDebugInfos    = GetCustomData <ReadOnlyCollection <MethodDebugInfo> >(DocumentViewerContentDataIds.DebugInfo) ?? emptyMethodDebugInfos;
 }
        static OffsetAndCachedColors()
        {
            var coll = new CachedTextColorsCollection();

            coll.Freeze();
            Default = new OffsetAndCachedColors(0, coll);
        }