public void RegisterBodyScript(Type type, string key, string script) { if (type == null) { type = typeof(PortalView); } if (body == null) { body = new Dictionary <ClientIncludeKey, string>(); } if (bodyKeys == null) { bodyKeys = new List <ClientIncludeKey>(); } ClientIncludeKey clientIncludeKey = new ClientIncludeKey(type, key, true); if (body.ContainsKey(clientIncludeKey)) { return; } PortalTrace.Write("PortalScriptManager", "RegisterBodyScript", "type='{0}', key='{1}'", type.Name, key); body.Add(clientIncludeKey, script); bodyKeys.Add(clientIncludeKey); }
public void RegisterClientScriptHeadInclude(Type type, string key, string url) { if (type == null) { type = typeof(PortalView); } if (headIncludes == null) { headIncludes = new Dictionary <ClientIncludeKey, ScriptInclude>(); } if (headIncludeKeys == null) { headIncludeKeys = new List <ClientIncludeKey>(); } ClientIncludeKey clientIncludeKey = new ClientIncludeKey(type, key, true); if (headIncludes.ContainsKey(clientIncludeKey)) { return; } PortalTrace.Write("PortalScriptManager", "RegisterClientScriptInclude", "type='{0}', key='{1}', url='{2}'", type.Name, key, url); headIncludes.Add(clientIncludeKey, new ScriptInclude(url)); headIncludeKeys.Add(clientIncludeKey); }
public void RegisterCssInclude(Type type, string key, string url, string ifCondition = null) { if (type == null) { type = typeof(PortalView); } if (includes == null) { includes = new Dictionary <ClientIncludeKey, CssInclude>(); } if (includeKeys == null) { includeKeys = new List <ClientIncludeKey>(); } ClientIncludeKey clientIncludeKey = new ClientIncludeKey(type, key, true); if (includes.ContainsKey(clientIncludeKey)) { return; } PortalTrace.Write("PortalStyleManager", "RegisterCssInclude", "type='{0}', key='{1}', url='{2}'", type.Name, key, url); includes.Add(clientIncludeKey, new CssInclude(url) { Condition = ifCondition }); includeKeys.Add(clientIncludeKey); }
public void RegisterEmbeddedCss(Type type, string key, string script) { if (type == null) { type = typeof(PortalView); } if (embeddedBlocks == null) { embeddedBlocks = new Dictionary <ClientIncludeKey, string>(); } if (embeddedKeys == null) { embeddedKeys = new List <ClientIncludeKey>(); } ClientIncludeKey clientIncludeKey = new ClientIncludeKey(type, key, true); if (embeddedBlocks.ContainsKey(clientIncludeKey)) { return; } PortalTrace.Write("PortalStyleManager", "RegisterEmbeddedCss", "type='{0}', key='{1}'", type.Name, key); embeddedBlocks.Add(clientIncludeKey, script); embeddedKeys.Add(clientIncludeKey); }
public override bool Equals(object o) { ClientIncludeKey clientIncludeKey = (ClientIncludeKey)o; return(clientIncludeKey.type == type && clientIncludeKey.key == key && clientIncludeKey.isInclude == isInclude); }