internal MainTagNameToTypeMapper(BaseTemplateParser parser)
 {
     this._parser = parser;
     if (parser != null)
     {
         PagesSection pagesConfig = parser.PagesConfig;
         if (pagesConfig != null)
         {
             this._tagNamespaceRegisterEntries = pagesConfig.TagNamespaceRegisterEntriesInternal;
             if (this._tagNamespaceRegisterEntries != null)
             {
                 this._tagNamespaceRegisterEntries = (TagNamespaceRegisterEntryTable) this._tagNamespaceRegisterEntries.Clone();
             }
             this._userControlRegisterEntries = pagesConfig.UserControlRegisterEntriesInternal;
             if (this._userControlRegisterEntries != null)
             {
                 this._userControlRegisterEntries = (Hashtable) this._userControlRegisterEntries.Clone();
             }
         }
         if (parser.FInDesigner && (this._tagNamespaceRegisterEntries == null))
         {
             this._tagNamespaceRegisterEntries = new TagNamespaceRegisterEntryTable();
             foreach (TagNamespaceRegisterEntry entry in PagesSection.DefaultTagNamespaceRegisterEntries)
             {
                 this._tagNamespaceRegisterEntries[entry.TagPrefix] = new ArrayList(new object[] { entry });
             }
         }
     }
 }
 internal MainTagNameToTypeMapper(BaseTemplateParser parser)
 {
     this._parser = parser;
     if (parser != null)
     {
         PagesSection pagesConfig = parser.PagesConfig;
         if (pagesConfig != null)
         {
             this._tagNamespaceRegisterEntries = pagesConfig.TagNamespaceRegisterEntriesInternal;
             if (this._tagNamespaceRegisterEntries != null)
             {
                 this._tagNamespaceRegisterEntries = (TagNamespaceRegisterEntryTable)this._tagNamespaceRegisterEntries.Clone();
             }
             this._userControlRegisterEntries = pagesConfig.UserControlRegisterEntriesInternal;
             if (this._userControlRegisterEntries != null)
             {
                 this._userControlRegisterEntries = (Hashtable)this._userControlRegisterEntries.Clone();
             }
         }
         if (parser.FInDesigner && (this._tagNamespaceRegisterEntries == null))
         {
             this._tagNamespaceRegisterEntries = new TagNamespaceRegisterEntryTable();
             foreach (TagNamespaceRegisterEntry entry in PagesSection.DefaultTagNamespaceRegisterEntries)
             {
                 this._tagNamespaceRegisterEntries[entry.TagPrefix] = new ArrayList(new object[] { entry });
             }
         }
     }
 }
 public override object Clone()
 {
     TagNamespaceRegisterEntryTable table = new TagNamespaceRegisterEntryTable();
     foreach (DictionaryEntry entry in this)
     {
         table[entry.Key] = ((ArrayList) entry.Value).Clone();
     }
     return table;
 }
Esempio n. 4
0
        public override object Clone()
        {
            TagNamespaceRegisterEntryTable table = new TagNamespaceRegisterEntryTable();

            foreach (DictionaryEntry entry in this)
            {
                table[entry.Key] = ((ArrayList)entry.Value).Clone();
            }
            return(table);
        }
        public override object Clone()
        {
            // We override clone to perform a deep copy of the hashtable contents but a shallow copy of
            // the contained arraylist itself

            TagNamespaceRegisterEntryTable newTable = new TagNamespaceRegisterEntryTable();

            foreach (DictionaryEntry entry in this)
            {
                newTable[entry.Key] = ((ArrayList)entry.Value).Clone();
            }

            return(newTable);
        }
Esempio n. 6
0
        internal MainTagNameToTypeMapper(BaseTemplateParser parser)
        {
            _parser = parser;

            if (parser != null)
            {
                PagesSection pagesConfig = parser.PagesConfig;
                if (pagesConfig != null)
                {
                    // Clone it so we don't modify the config settings
                    _tagNamespaceRegisterEntries = pagesConfig.TagNamespaceRegisterEntriesInternal;
                    if (_tagNamespaceRegisterEntries != null)
                    {
                        _tagNamespaceRegisterEntries = (TagNamespaceRegisterEntryTable)_tagNamespaceRegisterEntries.Clone();
                    }

                    _userControlRegisterEntries = pagesConfig.UserControlRegisterEntriesInternal;
                    if (_userControlRegisterEntries != null)
                    {
                        _userControlRegisterEntries = (Hashtable)_userControlRegisterEntries.Clone();
                    }
                }

                //



                if (parser.FInDesigner && (_tagNamespaceRegisterEntries == null))
                {
                    _tagNamespaceRegisterEntries = new TagNamespaceRegisterEntryTable();

                    foreach (TagNamespaceRegisterEntry entry in PagesSection.DefaultTagNamespaceRegisterEntries)
                    {
                        _tagNamespaceRegisterEntries[entry.TagPrefix] = new ArrayList(new object[] { entry });
                    }
                }
            }
        }
 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;
 }
        internal MainTagNameToTypeMapper(BaseTemplateParser parser) {
            _parser = parser;
            
            if (parser != null) {
                PagesSection pagesConfig = parser.PagesConfig;
                if (pagesConfig != null) {
                    // Clone it so we don't modify the config settings
                    _tagNamespaceRegisterEntries = pagesConfig.TagNamespaceRegisterEntriesInternal;
                    if (_tagNamespaceRegisterEntries != null) {
                        _tagNamespaceRegisterEntries = (TagNamespaceRegisterEntryTable)_tagNamespaceRegisterEntries.Clone();
                    }

                    _userControlRegisterEntries = pagesConfig.UserControlRegisterEntriesInternal;
                    if (_userControlRegisterEntries != null) {
                        _userControlRegisterEntries = (Hashtable)_userControlRegisterEntries.Clone();
                    }
                }

                // 



                if (parser.FInDesigner && (_tagNamespaceRegisterEntries == null)) {
                    _tagNamespaceRegisterEntries = new TagNamespaceRegisterEntryTable();

                    foreach (TagNamespaceRegisterEntry entry in PagesSection.DefaultTagNamespaceRegisterEntries) {
                        _tagNamespaceRegisterEntries[entry.TagPrefix] = new ArrayList(new object[] { entry });
                    }
                }
            }
        }
        internal void FillInRegisterEntries() {
            // 





            TagNamespaceRegisterEntryTable tagNamespaceRegisterEntries = new TagNamespaceRegisterEntryTable();
            foreach (TagNamespaceRegisterEntry entry in DefaultTagNamespaceRegisterEntries) {
                tagNamespaceRegisterEntries[entry.TagPrefix] = new ArrayList(new object[] { entry });
            }

            Hashtable userControlRegisterEntries = new Hashtable(StringComparer.OrdinalIgnoreCase);

            // Fill in the collection
            foreach (TagPrefixInfo tpi in Controls) {
                if (!String.IsNullOrEmpty(tpi.TagName)) {
                    UserControlRegisterEntry ucRegisterEntry = new UserControlRegisterEntry(tpi.TagPrefix, tpi.TagName);
                    ucRegisterEntry.ComesFromConfig = true;
                    try {
                        ucRegisterEntry.UserControlSource = VirtualPath.CreateNonRelative(tpi.Source);
                    }
                    catch (Exception e) {
                        throw new ConfigurationErrorsException(e.Message, e,
                            tpi.ElementInformation.Properties["src"].Source,
                            tpi.ElementInformation.Properties["src"].LineNumber);
                    }

                    userControlRegisterEntries[ucRegisterEntry.Key] = ucRegisterEntry;
                }
                else if (!String.IsNullOrEmpty(tpi.Namespace)) {
                    TagNamespaceRegisterEntry nsRegisterEntry = new TagNamespaceRegisterEntry(tpi.TagPrefix, tpi.Namespace, tpi.Assembly);
                    ArrayList entries = null;

                    entries = (ArrayList)tagNamespaceRegisterEntries[tpi.TagPrefix];
                    if (entries == null) {
                        entries = new ArrayList();
                        tagNamespaceRegisterEntries[tpi.TagPrefix] = entries;
                    }

                    entries.Add(nsRegisterEntry);
                }
            }

            _tagNamespaceRegisterEntries = tagNamespaceRegisterEntries;
            _userControlRegisterEntries = userControlRegisterEntries;
        }
        public override object Clone() {
            // We override clone to perform a deep copy of the hashtable contents but a shallow copy of
            // the contained arraylist itself

            TagNamespaceRegisterEntryTable newTable = new TagNamespaceRegisterEntryTable();
            foreach (DictionaryEntry entry in this) {
                newTable[entry.Key] = ((ArrayList)entry.Value).Clone();
            }

            return newTable;
        }