/// <summary>
 /// Initializes the HTML safe list.
 /// </summary>
 private static void InitialiseSafeList()
 {
     AcquireWriteLock();
     try
     {
         if (characterValues == null)
         {
             characterValues = SafeList.Generate(65535, new SafeList.GenerateSafeValue(SafeList.HashThenValueGenerator));
             SafeList.PunchUnicodeThrough(ref characterValues, currentLowerCodeChartSettings, currentLowerMidCodeChartSettings, currentMidCodeChartSettings, currentUpperMidCodeChartSettings, currentUpperCodeChartSettings);
             ApplyHtmlSpecificValues();
         }
     }
     finally
     {
         ReleaseWriteLock();
     }
 }
 /// <summary>
 /// Marks characters from the specified languages as safe.
 /// </summary>
 /// <param name="lowerCodeCharts">The combination of lower code charts to use.</param>
 /// <param name="lowerMidCodeCharts">The combination of lower mid code charts to use.</param>
 /// <param name="midCodeCharts">The combination of mid code charts to use.</param>
 /// <param name="upperMidCodeCharts">The combination of upper mid code charts to use.</param>
 /// <param name="upperCodeCharts">The combination of upper code charts to use.</param>
 /// <remarks>The safe list affects all HTML and XML encoding functions.</remarks>
 public static void MarkAsSafe(LowerCodeCharts lowerCodeCharts, LowerMidCodeCharts lowerMidCodeCharts, MidCodeCharts midCodeCharts, UpperMidCodeCharts upperMidCodeCharts, UpperCodeCharts upperCodeCharts)
 {
     if (lowerCodeCharts == currentLowerCodeChartSettings && lowerMidCodeCharts == currentLowerMidCodeChartSettings && midCodeCharts == currentMidCodeChartSettings && upperMidCodeCharts == currentUpperMidCodeChartSettings && upperCodeCharts == currentUpperCodeChartSettings)
     {
         return;
     }
     AcquireWriteLock();
     try
     {
         characterValues = SafeList.Generate(65536, new SafeList.GenerateSafeValue(SafeList.HashThenValueGenerator));
         SafeList.PunchUnicodeThrough(ref characterValues, lowerCodeCharts, lowerMidCodeCharts, midCodeCharts, upperMidCodeCharts, upperCodeCharts);
         ApplyHtmlSpecificValues();
         currentLowerCodeChartSettings    = lowerCodeCharts;
         currentLowerMidCodeChartSettings = lowerMidCodeCharts;
         currentMidCodeChartSettings      = midCodeCharts;
         currentUpperMidCodeChartSettings = upperMidCodeCharts;
         currentUpperCodeChartSettings    = upperCodeCharts;
     }
     finally
     {
         ReleaseWriteLock();
     }
 }