Exemplo n.º 1
0
        private void RegisterCurrentTemplate(NDjangoSectionHandler nameValueSection)
        {
            //NDjangoSectionHandler section isn't exist
            if (nameValueSection == null)
            {
                return;
            }

            foreach (NameValueClassElement item in nameValueSection.NDJangoTagFilterSectionCollection)
            {
                CreateInstanceByAssemblyName(item.Name);
            }

            foreach (NameValueElementAssembly item in nameValueSection.NDJangoSectionCollection)
            {
                if (item.ImportCollection.Count == 0)
                {
                    //register all tag and filter
                    //RegisterGroupOfTemplates(item.Name);
                    LoadByAssemblyName(item.Name);
                }
                else
                {
                    //register only defined tag and filter
                    foreach (NameValueElementImport impItem in item.ImportCollection)
                    {
                        RegisterGroupOfTemplates(impItem.Name, item.Name);
                    }
                }
            }

            foreach (NameValueElement item in nameValueSection.NDJangoSettingsSectionCollection)
            {
                string name = item.Name;
                string value = item.Value;
                ValidateSettings(name, value);
            }

        }
Exemplo n.º 2
0
        private NDjangoSectionHandler GetCollectionOfSectionByPath(string path)
        {
            NDjangoSectionHandler nameValueSection = new NDjangoSectionHandler();
            try
            {
                nameValueSection = ConfigurationManager.GetSection(path) as NDjangoSectionHandler;
            }
            catch (ConfigurationException cfgEx)
            {
            }

            if (nameValueSection != null)
            {
                return nameValueSection;
            }
            return null;
        }