public IType GetControlType(string tagPrefix, string tagName) { if (String.IsNullOrEmpty(tagPrefix)) { return(null); } IType type = null; if (0 == string.Compare(tagPrefix, "asp", StringComparison.OrdinalIgnoreCase)) { type = TypeCtx.SystemTypeLookup(tagName); if (type != null) { return(type); } } foreach (var rd in RegisteredTags) { if (string.Compare(rd.TagPrefix, tagPrefix, StringComparison.OrdinalIgnoreCase) != 0) { continue; } AssemblyRegisterDirective ard = rd as AssemblyRegisterDirective; if (ard != null) { string assembly = ard.Assembly; var dom = TypeCtx.ResolveAssembly(ard.Assembly); if (dom == null) { continue; } type = WebTypeContext.AssemblyTypeLookup(dom, ard.Namespace, tagName); if (type != null) { return(type); } continue; } var crd = rd as ControlRegisterDirective; if (crd != null && string.Compare(crd.TagName, tagName, StringComparison.OrdinalIgnoreCase) == 0) { return(TypeCtx.GetUserControlType(crd.Src, Doc.FileName)); } } //returns null if type not found return(TypeCtx.GetRegisteredType(DirectoryPath, tagPrefix, tagName)); }
public IType GetType(string tagPrefix, string tagName, string htmlTypeAttribute) { if (tagPrefix == null || tagPrefix.Length < 1) { return(TypeCtx.HtmlControlTypeLookup(tagName, htmlTypeAttribute)); } if (0 == string.Compare(tagPrefix, "asp", StringComparison.OrdinalIgnoreCase)) { var systemType = TypeCtx.SystemTypeLookup(tagName); if (systemType != null) { return(systemType); } } foreach (var rd in RegisteredTags) { if (string.Compare(rd.TagPrefix, tagPrefix, StringComparison.OrdinalIgnoreCase) != 0) { continue; } var ard = rd as AssemblyRegisterDirective; if (ard != null) { var dom = TypeCtx.ResolveAssembly(ard.Assembly); if (dom != null) { var type = WebTypeContext.AssemblyTypeLookup(dom, ard.Namespace, tagName); if (type != null) { return(type); } } continue; } var crd = rd as ControlRegisterDirective; if (crd != null && string.Compare(crd.TagName, tagName, StringComparison.OrdinalIgnoreCase) == 0) { var type = TypeCtx.GetUserControlType(crd.Src, Doc.FileName); if (type != null) { return(type); } } } //returns null if type not found return(TypeCtx.GetRegisteredType(DirectoryPath, tagPrefix, tagName)); }