本文整理汇总了C#中ViewEngineCollection.Clear方法的典型用法代码示例。如果您正苦于以下问题:C# ViewEngineCollection.Clear方法的具体用法?C# ViewEngineCollection.Clear怎么用?C# ViewEngineCollection.Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewEngineCollection
的用法示例。
在下文中一共展示了ViewEngineCollection.Clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterViewEngines
public static void RegisterViewEngines(ViewEngineCollection viewEngines)
{
viewEngines.Clear();
var lightweightRazorViewEngine = new LightweightRazorViewEngine();
viewEngines.Add(lightweightRazorViewEngine);
}
示例2: RegisterViewEngines
public static void RegisterViewEngines(ViewEngineCollection viewEngines)
{
// 清除所有 View Engine
viewEngines.Clear();
// 重新註冊 RazorViewEngine,如果你使用的是 WebForm ViewEngine 則是加入 WebFormViewEngine
viewEngines.Add(new RazorViewEngine());
}
示例3: RegisterViewEngine
public static void RegisterViewEngine(ViewEngineCollection viewEngines)
{
viewEngines.Clear();
var PMIViewEngine = new PMIViewEngine();
viewEngines.Add(PMIViewEngine);
}
示例4: RegisterEngines
public static void RegisterEngines(ViewEngineCollection viewEngines)
{
// Removes WebForms view engine - optimization
viewEngines.Clear();
// viewEngines.Add(new CustomViewLocationRazorViewEngine());
viewEngines.Add(new RazorViewEngine());
}
示例5: RegisterViewEngines
public static void RegisterViewEngines(ViewEngineCollection viewEngines)
{
viewEngines.Clear();
viewEngines.Add(new RazorViewEngine());
viewEngines.Add(new LoggingViewEngine.LoggingViewEngine());
viewEngines.Add(new PdfViewEngine.PdfViewEngine());
viewEngines.Add(new MailerViewEngine.MailerViewEngine());
}
示例6: RegisterViewEngine
public static void RegisterViewEngine(ViewEngineCollection viewEngines)
{
// We do not need the default view engine
viewEngines.Clear();
var templateableRazorViewEngine = new TemplateWebformViewEngine {
CurrentTemplate = httpContext => httpContext.Request["template"] as string ?? string.Empty
};
viewEngines.Add(templateableRazorViewEngine);
}
示例7: Install
public static void Install(ViewEngineCollection engines)
{
if (engines == null)
throw new ApplicationException("ViewEngines.Engines Found");
var sparkSettings = GetSparkSettings(Assembly.GetCallingAssembly());
var sparkViewFactory = new SparkViewFactory(sparkSettings);
engines.Clear();
engines.Add(sparkViewFactory);
}
示例8: RegisterViewEngines
public static void RegisterViewEngines(ViewEngineCollection engines)
{
var engine = new MobileCapableWebFormViewEngine();
engine.DeviceFolders.Clear();
engine.DeviceFolders.Add("Mozilla", "iPhone");
engine.DeviceFolders.Add("Safari", "iPhone");
engine.DeviceFolders.Add("Chrome", "iPhone");
engines.Clear();
engines.Add(engine);
}
示例9: RegisterViewEngine
public static void RegisterViewEngine(ViewEngineCollection viewEngines)
{
// We do not need the default view engine
viewEngines.Clear();
var themeableRazorViewEngine = new ThemeableRazorViewEngine
{
CurrentTheme = httpContext => httpContext.Session["theme"] as string ?? string.Empty
};
viewEngines.Add(themeableRazorViewEngine);
}
示例10: RegisterViewEngine
public static void RegisterViewEngine(ViewEngineCollection viewEngines)
{
// We do not need the default view engine
viewEngines.Clear();
var basePath = ConfigurationManager.AppSettings["ThemeBasePath"];
var themeName = ConfigurationManager.AppSettings["ThemeName"];
var theme = new Theme(basePath,themeName);
var themeableRazorViewEngine = new ThemedRazorViewEngine(theme);
viewEngines.Add(themeableRazorViewEngine);
}
示例11: RegisterViewEngine
public static void RegisterViewEngine(ViewEngineCollection viewEngines)
{
//// We do not need the default view engine
viewEngines.Clear();
//var adminTemplateRazorViewEngine = new AdminTemplateRazorViewEngine {
// CurrentTemplate = httpContext => httpContext.Session["theme"] as string
//};
//viewEngines.Add(adminTemplateRazorViewEngine);
var templateRazorViewEngine = new TemplateRazorViewEngine {
CurrentTemplate = httpContext => httpContext.Session["theme"] as string
};
viewEngines.Add(templateRazorViewEngine);
}
示例12: Register
public static void Register(ViewEngineCollection engines)
{
engines.Clear();
engines.Add(new RazorViewEngine());
}
示例13: RegisterViewEngines
internal static void RegisterViewEngines(ViewEngineCollection viewEngineCollection)
{
viewEngineCollection.Clear();
viewEngineCollection.Add(new RazorViewEngine());
}
示例14: RegisterViewEngines
private void RegisterViewEngines(ViewEngineCollection viewEngineCollection)
{
viewEngineCollection.Clear();
viewEngineCollection.Add(new RazorViewEngine());
}
示例15: AddFeatureViewViewEngine
private static void AddFeatureViewViewEngine(ViewEngineCollection views)
{
views.Clear();
views.Add(new FeatureViewLocationRazorViewEngine());
}