void RegisterConfigControls()
        {
            PagesSection pages = WebConfigurationManager.GetSection("system.web/pages") as PagesSection;

            if (pages == null)
            {
                return;
            }

            TagPrefixCollection controls = pages.Controls;

            if (controls == null || controls.Count == 0)
            {
                return;
            }

            IList    appCode            = BuildManager.CodeAssemblies;
            bool     haveCodeAssemblies = appCode != null && appCode.Count > 0;
            Assembly asm;

            foreach (TagPrefixInfo tpi in controls)
            {
                if (!String.IsNullOrEmpty(tpi.TagName))
                {
                    RegisterFoundry(tpi.TagPrefix, tpi.TagName, tpi.Source, true);
                }
                else if (String.IsNullOrEmpty(tpi.Assembly))
                {
                    if (haveCodeAssemblies)
                    {
                        foreach (object o in appCode)
                        {
                            asm = o as Assembly;
                            if (asm == null)
                            {
                                continue;
                            }
                            RegisterFoundry(tpi.TagPrefix, asm, tpi.Namespace, true);
                        }
                    }
                }
                else if (!String.IsNullOrEmpty(tpi.Namespace))
                {
                    RegisterAssemblyFoundry(tpi.TagPrefix,
                                            tpi.Assembly,
                                            tpi.Namespace,
                                            true);
                }
            }
        }
Exemple #2
0
        internal static long GetRecompilationHash(PagesSection ps)
        {
            HashCodeCombiner combiner = new HashCodeCombiner();

            combiner.AddObject(ps.Buffer);
            combiner.AddObject(ps.EnableViewState);
            combiner.AddObject(ps.EnableViewStateMac);
            combiner.AddObject(ps.EnableEventValidation);
            combiner.AddObject(ps.SmartNavigation);
            combiner.AddObject(ps.ValidateRequest);
            combiner.AddObject(ps.AutoEventWireup);
            if (ps.PageBaseTypeInternal != null)
            {
                combiner.AddObject(ps.PageBaseTypeInternal.FullName);
            }
            if (ps.UserControlBaseTypeInternal != null)
            {
                combiner.AddObject(ps.UserControlBaseTypeInternal.FullName);
            }
            if (ps.PageParserFilterTypeInternal != null)
            {
                combiner.AddObject(ps.PageParserFilterTypeInternal.FullName);
            }
            combiner.AddObject(ps.MasterPageFile);
            combiner.AddObject(ps.Theme);
            combiner.AddObject(ps.StyleSheetTheme);
            combiner.AddObject(ps.EnableSessionState);
            combiner.AddObject(ps.CompilationMode);
            combiner.AddObject(ps.MaxPageStateFieldLength);
            combiner.AddObject(ps.ViewStateEncryptionMode);
            combiner.AddObject(ps.MaintainScrollPositionOnPostBack);
            NamespaceCollection namespaces = ps.Namespaces;

            combiner.AddObject(namespaces.AutoImportVBNamespace);
            if (namespaces.Count == 0)
            {
                combiner.AddObject("__clearnamespaces");
            }
            else
            {
                foreach (NamespaceInfo info in namespaces)
                {
                    combiner.AddObject(info.Namespace);
                }
            }
            TagPrefixCollection controls = ps.Controls;

            if (controls.Count == 0)
            {
                combiner.AddObject("__clearcontrols");
            }
            else
            {
                foreach (TagPrefixInfo info2 in controls)
                {
                    combiner.AddObject(info2.TagPrefix);
                    if ((info2.TagName != null) && (info2.TagName.Length != 0))
                    {
                        combiner.AddObject(info2.TagName);
                        combiner.AddObject(info2.Source);
                    }
                    else
                    {
                        combiner.AddObject(info2.Namespace);
                        combiner.AddObject(info2.Assembly);
                    }
                }
            }
            TagMapCollection tagMapping = ps.TagMapping;

            if (tagMapping.Count == 0)
            {
                combiner.AddObject("__cleartagmapping");
            }
            else
            {
                foreach (TagMapInfo info3 in tagMapping)
                {
                    combiner.AddObject(info3.TagType);
                    combiner.AddObject(info3.MappedTagType);
                }
            }
            return(combiner.CombinedHash);
        }