/// <summary> /// Default constructor. /// </summary> /// <param name="view">Associated embedded view.</param> /// <param name="virtualPath">Virtual path in question.</param> public AssemblyResourceFile(EmbeddedView view, string virtualPath) : base(virtualPath) { if(view == null) throw new ArgumentNullException("view", "EmbeddedView cannot be null."); embeddedView = view; }
/// <summary> /// Adds the view by name and Assembly name. /// </summary> /// <param name="viewName">Name of the view to add.</param> /// <param name="assemblyName">Name of the assembly to add.</param> public void AddView(string viewName, string assemblyName) { lock (_lock) { viewCache[viewName] = new EmbeddedView { Name = viewName, AssemblyFullName = assemblyName }; } }
/// <summary> /// Default constructor. /// </summary> /// <param name="view">Associated embedded view.</param> /// <param name="virtualPath">Virtual path in question.</param> public AssemblyResourceFile(EmbeddedView view, string virtualPath) : base(virtualPath) { if (view == null) { throw new ArgumentNullException("view", "EmbeddedView cannot be null."); } embeddedView = view; }
/// <summary> /// Gets the <see cref="VirtualFile"/> that's associated with the path. /// </summary> /// <param name="virtualPath">VirtualPath to check</param> /// <returns></returns> public override VirtualFile GetFile(string virtualPath) { if (IsEmbeddedView(virtualPath)) { EmbeddedView embeddedView = embeddedViews.FindEmbeddedView(virtualPath); return(new AssemblyResourceFile(embeddedView, virtualPath)); } return(base.GetFile(virtualPath)); }
/// <summary> /// Adds the view by name and Assembly name. /// </summary> /// <param name="viewName">Name of the view to add.</param> /// <param name="assemblyName">Name of the assembly to add.</param> public void AddView(string viewName, string assemblyName) { lock (_lock) { viewCache[viewName] = new EmbeddedView { Name = viewName, AssemblyFullName = assemblyName }; } }