public CombinatorResource(ResourceType type, IHttpContextAccessor httpContextAccessor) { _type = type; _httpContext = httpContextAccessor.Current(); RequiredContext = new ResourceRequiredContext(); IsOriginal = false; }
public void FillRequiredContext(string name, string url, string culture = "", string condition = "", Dictionary <string, string> attributes = null) { var requiredContext = new ResourceRequiredContext(); var resourceManifest = new ResourceManifest(); requiredContext.Resource = resourceManifest.DefineResource(Type.ToStringType(), name); requiredContext.Resource.SetUrl(url); requiredContext.Settings = new RequireSettings(); requiredContext.Settings.Culture = culture; requiredContext.Settings.Condition = condition; requiredContext.Settings.Attributes = attributes != null ? new Dictionary <string, string>(attributes) : new Dictionary <string, string>(); RequiredContext = requiredContext; }
public void FillRequiredContext(string name, string url, string culture = "", string condition = "", Dictionary <string, string> attributes = null, IDictionary <string, string> tagAttributes = null) { var requiredContext = new ResourceRequiredContext(); var resourceManifest = new ResourceManifest(); requiredContext.Resource = resourceManifest.DefineResource(Type.ToStringType(), name); if (!string.IsNullOrEmpty(url)) { requiredContext.Resource.SetUrl(url); } requiredContext.Settings = new RequireSettings { Name = name, Culture = culture, Condition = condition, Attributes = attributes != null ? new Dictionary <string, string>(attributes) : new Dictionary <string, string>() }; RequiredContext = requiredContext; if (tagAttributes != null) { requiredContext.Resource.TagBuilder.MergeAttributes(tagAttributes); } }
public CombinatorResource GetResource(ResourceRequiredContext resource) { return((from r in Resources where r.Value.RequiredContext.Resource.Url == resource.Resource.Url select r.Value).First()); }