本文整理汇总了C#中IViewDataContainer类的典型用法代码示例。如果您正苦于以下问题:C# IViewDataContainer类的具体用法?C# IViewDataContainer怎么用?C# IViewDataContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IViewDataContainer类属于命名空间,在下文中一共展示了IViewDataContainer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateHelper
public dynamic CreateHelper(ViewContext viewContext, IViewDataContainer viewDataContainer) {
return new DisplayHelper(
_displayManager,
_shapeFactory,
viewContext,
viewDataContainer);
}
示例2: BaseViewHelper
public BaseViewHelper(RequestContext requestContext, ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection)
{
ViewData = new ViewDataDictionary(viewDataContainer.ViewData);
RequestContext = requestContext;
ViewContext = viewContext;
RouteCollection = routeCollection;
}
示例3: BaseViewHelper
public BaseViewHelper(RequestContext requestContext, ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection)
{
if (requestContext == null)
{
throw new ArgumentNullException("requestContext");
}
if (viewContext == null)
{
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null)
{
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null)
{
throw new ArgumentNullException("routeCollection");
}
ViewData = new ViewDataDictionary(viewDataContainer.ViewData);
RequestContext = requestContext;
ViewContext = viewContext;
RouteCollection = routeCollection;
}
示例4: CreateHelper
public dynamic CreateHelper(ViewContext viewContext, IViewDataContainer viewDataContainer) {
return ClayActivator.CreateInstance<DisplayHelper>(
_behaviors,
_displayManager,
_shapeFactory,
viewContext,
viewDataContainer);
}
示例5: VehicleHelperFixture
public VehicleHelperFixture()
{
this.previousCultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture;
System.Threading.Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
_viewDataContainer = new Mock<IViewDataContainer>().Object;
_viewContext = new Mock<ViewContext>().Object;
_helper = new HtmlHelper(_viewContext, _viewDataContainer);
}
示例6: DisplayHelper
public DisplayHelper(
IDisplayManager displayManager,
IShapeFactory shapeFactory,
ViewContext viewContext,
IViewDataContainer viewDataContainer) {
_displayManager = displayManager;
_shapeFactory = shapeFactory;
ViewContext = viewContext;
ViewDataContainer = viewDataContainer;
}
示例7: SyncViewAction
public SyncViewAction(IView view, IViewDataContainer viewDataContainer)
{
if (view == null)
{
throw new InfrastructureException("The view cannot be null.");
}
this.view = view;
this.viewDataContainer = viewDataContainer;
}
示例8: ResourceRegister
public ResourceRegister(IViewDataContainer container, IResourceManager resourceManager, string resourceType) {
var templateControl = container as TemplateControl;
if (templateControl != null) {
_viewVirtualPath = templateControl.AppRelativeVirtualPath;
}
else {
var webPage = container as WebPageBase;
if (webPage != null) {
_viewVirtualPath = webPage.VirtualPath;
}
}
ResourceManager = resourceManager;
ResourceType = resourceType;
}
示例9: AjaxHelper
public AjaxHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection) {
if (viewContext == null) {
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null) {
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null) {
throw new ArgumentNullException("routeCollection");
}
ViewContext = viewContext;
ViewDataContainer = viewDataContainer;
RouteCollection = routeCollection;
}
示例10: Build
internal static MvcRenderingContext Build(ViewContext viewContext, IViewDataContainer viewDataContainer, TextWriter writer)
{
var context = GetFromViewContext(viewContext);
if (context != null)
return context;
MvcRenderingContext parentContext = null;
if (viewContext.ParentActionViewContext != null)
parentContext = GetFromViewContext(viewContext.ParentActionViewContext);
context = new MvcRenderingContext(viewContext, viewDataContainer, writer, parentContext);
viewContext.ViewData.Add(ContextKey, context);
return context;
}
示例11: HtmlHelper
public HtmlHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection) {
if (viewContext == null) {
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null) {
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null) {
throw new ArgumentNullException("routeCollection");
}
ViewContext = viewContext;
ViewDataContainer = viewDataContainer;
RouteCollection = routeCollection;
ClientValidationRuleFactory = (name, metadata) => ModelValidatorProviders.Providers.GetValidators(metadata ?? ModelMetadata.FromStringExpression(name, ViewData), ViewContext).SelectMany(v => v.GetClientValidationRules());
}
示例12: PluginHelper
public PluginHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection)
{
if (viewContext == null)
{
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null)
{
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null)
{
throw new ArgumentNullException("routeCollection");
}
this.ViewContext = viewContext;
this.ViewDataContainer = viewDataContainer;
this.Model = ViewContext.ViewData.Model as TemplateContentModel;
this.RouteCollection = routeCollection;
}
示例13: FileRegistrationContext
public FileRegistrationContext(ControllerContext viewContext, IViewDataContainer viewDataContainer, string tagName, string fileName, string position, string filePathAttributeName, TagRenderMode fileTagRenderMode)
: base(viewContext.HttpContext, viewContext.RouteData) {
_fileTagRenderMode = fileTagRenderMode;
Container = viewDataContainer as TemplateControl;
if (Container != null) {
ContainerVirtualPath = Container.AppRelativeVirtualPath.Substring(
0,
Container.AppRelativeVirtualPath.IndexOf(
"/Views",
StringComparison.InvariantCultureIgnoreCase
)
);
}
FileName = fileName;
Position = position;
FilePathAttributeName = filePathAttributeName;
_tagBuilder = new TagBuilder(tagName);
}
示例14: ThunderHelper
/// <summary>
/// Initialize new instance of class <see cref="ThunderHelper"/>.
/// </summary>
/// <param name="viewContext"><see cref="ViewContext"/></param>
/// <param name="viewDataContainer"><see cref="IViewDataContainer"/></param>
/// <param name="routeCollection"><see cref="RouteCollection"/></param>
/// <param name="htmlHelper"><see cref="HtmlHelper"/></param>
/// <exception cref="ArgumentNullException"></exception>
public ThunderHelper(ViewContext viewContext, IViewDataContainer viewDataContainer,
RouteCollection routeCollection, HtmlHelper htmlHelper)
{
if (viewContext == null)
{
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null)
{
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null)
{
throw new ArgumentNullException("routeCollection");
}
ViewContext = viewContext;
RouteCollection = routeCollection;
Html = htmlHelper;
ViewData = new ViewDataDictionary(viewDataContainer.ViewData);
}
示例15: SquishItHelper
public SquishItHelper(ViewContext viewContext, IViewDataContainer viewDataContainer, RouteCollection routeCollection)
{
#region Validation
if (viewContext == null)
{
throw new ArgumentNullException("viewContext");
}
if (viewDataContainer == null)
{
throw new ArgumentNullException("viewDataContainer");
}
if (routeCollection == null)
{
throw new ArgumentNullException("routeCollection");
}
#endregion
ViewContext = viewContext;
ViewDataContainer = viewDataContainer;
RouteCollection = routeCollection;
Css = new CssHelper();
JavaScript = new JavaScriptHelper();
}