示例#1
0
        internal void FillInRegisterEntries()
        {
            TagNamespaceRegisterEntryTable table = new TagNamespaceRegisterEntryTable();

            foreach (TagNamespaceRegisterEntry entry in DefaultTagNamespaceRegisterEntries)
            {
                table[entry.TagPrefix] = new ArrayList(new object[] { entry });
            }
            Hashtable hashtable = new Hashtable(StringComparer.OrdinalIgnoreCase);

            foreach (TagPrefixInfo info in this.Controls)
            {
                if (!string.IsNullOrEmpty(info.TagName))
                {
                    UserControlRegisterEntry entry2 = new UserControlRegisterEntry(info.TagPrefix, info.TagName)
                    {
                        ComesFromConfig = true
                    };
                    try
                    {
                        entry2.UserControlSource = VirtualPath.CreateNonRelative(info.Source);
                    }
                    catch (Exception exception)
                    {
                        throw new ConfigurationErrorsException(exception.Message, exception, info.ElementInformation.Properties["src"].Source, info.ElementInformation.Properties["src"].LineNumber);
                    }
                    hashtable[entry2.Key] = entry2;
                }
                else if (!string.IsNullOrEmpty(info.Namespace))
                {
                    TagNamespaceRegisterEntry entry3 = new TagNamespaceRegisterEntry(info.TagPrefix, info.Namespace, info.Assembly);
                    ArrayList list = null;
                    list = (ArrayList)table[info.TagPrefix];
                    if (list == null)
                    {
                        list = new ArrayList();
                        table[info.TagPrefix] = list;
                    }
                    list.Add(entry3);
                }
            }
            this._tagNamespaceRegisterEntries = table;
            this._userControlRegisterEntries  = hashtable;
        }