public static bool TryGetBinder(string prefix, out IPDFBindingExpressionFactory binder)
        {
            GenerationConfigurationSection section = GeneratorSection;

            if (null == section)
            {
                binder = null;
                return(false);
            }

            BindingFactoryElementCollection col = section.ExpressionBinders;
            BindingFactoryElement           ele = null;

            if (col == null || col.Count == 0)
            {
                binder = null;
                return(false);
            }
            else if (col.TryGetBindingElement(prefix, out ele))
            {
                binder = ele.GetFactory();
                return(null != binder);
            }
            else
            {
                binder = null;
                return(false);
            }
        }
        public static BindingFactoryElementCollection GetExplicitBindingFactories()
        {
            GenerationConfigurationSection gen = GeneratorSection;

            if (null != gen)
            {
                BindingFactoryElementCollection elements = gen.ExpressionBinders;
                return(elements);
            }
            return(null);
        }
        public static string GetXmlNamespaceForAssemblyNamespace(string ns, string assembly)
        {
            GenerationConfigurationSection section = GeneratorSection;

            if (null == section || null == section.Mappings || section.Mappings.Count == 0)
            {
                return(null);
            }
            foreach (SchemaMappingElement mapping in GeneratorSection.Mappings)
            {
                if (mapping.RuntimeNamespace.Equals(ns) && mapping.RuntimeAssembly.Equals(assembly))
                {
                    return(mapping.XmlNamespace);
                }
            }

            //not found
            return(null);
        }
        public static string GetAssemblyNamespaceForXmlNamesapce(string xmlNamesapce)
        {
            SchemaMappingElement           extension;
            GenerationConfigurationSection section = GeneratorSection;

            if (null == section)
            {
                return(null);
            }
            else
            {
                SchemaMappingCollection col = section.Mappings;
                if (null == col)
                {
                    return(null);
                }
                else if (col.TryGetMapping(xmlNamesapce, out extension))
                {
                    return(extension.RuntimeNamespace + ", " + extension.RuntimeAssembly);
                }
            }
            return(null);
        }