Example #1
0
 internal static string ConstructHeaderValue(InternetExplorerCompatibiltyMode mode)
 {
     try
     {
         return($"IE={HeaderValues[mode]}");
     }
     catch (KeyNotFoundException)
     {
         throw new NotSupportedException($"Mode '{mode}' not supported.");
     }
 }
 public XUACompatibleAttribute(InternetExplorerCompatibiltyMode mode)
 {
     Mode = mode;
 }
Example #3
0
 public static void SetXUACompatible(this HttpContext context, InternetExplorerCompatibiltyMode mode)
 {
     context.Items[nameof(InternetExplorerCompatibiltyMode)] = mode;
 }
Example #4
0
 public static IServiceCollection AddXUACompatible(this IServiceCollection services, InternetExplorerCompatibiltyMode mode = InternetExplorerCompatibiltyMode.Edge)
 {
     return(services.AddXUACompatible(new XUACompatibleOptions(mode)));
 }