Esempio n. 1
0
        public ApiFilter(XPathNavigator configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            // API filter nodes
            XPathNavigator apiFilterNode = configuration.SelectSingleNode("apiFilter");

            if (apiFilterNode != null)
            {
                XmlReader configurationReader = apiFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                apiFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }

            // Attribute filter nodes
            XPathNavigator attributeFilterNode = configuration.SelectSingleNode("attributeFilter");

            if (attributeFilterNode != null)
            {
                XmlReader configurationReader = attributeFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                attributeFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }
        }
Esempio n. 2
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="configuration">The XPath navigator from which to read the configuration</param>
        public ApiFilter(XPathNavigator configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            namespaceCache   = new Dictionary <string, bool>();
            typeExposedCache = new Dictionary <string, bool>();

            // Visibility settings
            this.IncludeAttributes = (bool)configuration.Evaluate("boolean(visibility/attributes[@expose='true'])");
            this.IncludeExplicitInterfaceImplementations = (bool)configuration.Evaluate("boolean(visibility/explicitInterfaceImplementations[@expose='true'])");
            this.IncludeInheritedMembers                  = (bool)configuration.Evaluate("boolean(visibility/inheritedMembers[@expose='true'])");
            this.IncludeInheritedFrameworkMembers         = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkMembers[@expose='true'])");
            this.IncludeInheritedFrameworkInternalMembers = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkInternalMembers[@expose='true'])");
            this.IncludeInheritedFrameworkPrivateMembers  = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkPrivateMembers[@expose='true'])");
            this.IncludeInternals       = (bool)configuration.Evaluate("boolean(visibility/internals[@expose='true'])");
            this.IncludePrivates        = (bool)configuration.Evaluate("boolean(visibility/privates[@expose='true'])");
            this.IncludePrivateFields   = (bool)configuration.Evaluate("boolean(visibility/privateFields[@expose='true'])");
            this.IncludeProtected       = (bool)configuration.Evaluate("boolean(visibility/protected[@expose='true'])");
            this.IncludeSealedProtected = (bool)configuration.Evaluate("boolean(visibility/sealedProtected[@expose='true'])");
            this.IncludeProtectedInternalAsProtected = (bool)configuration.Evaluate("boolean(visibility/protectedInternalAsProtected[@expose='true'])");
            this.IncludeNoPIATypes = (bool)configuration.Evaluate("boolean(visibility/noPIATypes[@expose='true'])");
            this.IncludePublicCompilerGenerated = (bool)configuration.Evaluate("boolean(visibility/publicCompilerGenerated[@expose='true'])");
            this.IncludeEditorBrowsableNever    = (bool)configuration.Evaluate("boolean(visibility/editorBrowsableNever[@expose='true'])");
            this.IncludeNonBrowsable            = (bool)configuration.Evaluate("boolean(visibility/nonBrowsable[@expose='true'])");

            // API filter
            XPathNavigator apiFilterNode = configuration.SelectSingleNode("apiFilter");

            if (apiFilterNode != null)
            {
                XmlReader configurationReader = apiFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                apiFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }
            else
            {
                apiFilter = new RootFilter();
            }

            // Attribute filter
            XPathNavigator attributeFilterNode = configuration.SelectSingleNode("attributeFilter");

            if (attributeFilterNode != null)
            {
                XmlReader configurationReader = attributeFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                attributeFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }
            else
            {
                attributeFilter = new RootFilter();
            }
        }
Esempio n. 3
0
        public ApiFilter(XPathNavigator configuration) {

            if (configuration == null) throw new ArgumentNullException("configuration");

            // API filter nodes
            XPathNavigator apiFilterNode = configuration.SelectSingleNode("apiFilter");
            if (apiFilterNode != null) {
                XmlReader configurationReader = apiFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                apiFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }

            // Attribute filter nodes
            XPathNavigator attributeFilterNode = configuration.SelectSingleNode("attributeFilter");
            if (attributeFilterNode != null) {
                XmlReader configurationReader = attributeFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                attributeFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }

        }
Esempio n. 4
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="configuration">The XPath navigator from which to read the configuration</param>
        public ApiFilter(XPathNavigator configuration)
        {
            if(configuration == null)
                throw new ArgumentNullException("configuration");

            namespaceCache = new Dictionary<string, bool>();
            typeExposedCache = new Dictionary<string, bool>();

            // Visibility settings
            this.IncludeAttributes = (bool)configuration.Evaluate("boolean(visibility/attributes[@expose='true'])");
            this.IncludeExplicitInterfaceImplementations = (bool)configuration.Evaluate("boolean(visibility/explicitInterfaceImplementations[@expose='true'])");
            this.IncludeInheritedMembers = (bool)configuration.Evaluate("boolean(visibility/inheritedMembers[@expose='true'])");
            this.IncludeInheritedFrameworkMembers = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkMembers[@expose='true'])");
            this.IncludeInheritedFrameworkInternalMembers = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkInternalMembers[@expose='true'])");
            this.IncludeInheritedFrameworkPrivateMembers = (bool)configuration.Evaluate("boolean(visibility/inheritedFrameworkPrivateMembers[@expose='true'])");
            this.IncludeInternals = (bool)configuration.Evaluate("boolean(visibility/internals[@expose='true'])");
            this.IncludePrivates = (bool)configuration.Evaluate("boolean(visibility/privates[@expose='true'])");
            this.IncludePrivateFields = (bool)configuration.Evaluate("boolean(visibility/privateFields[@expose='true'])");
            this.IncludeProtected = (bool)configuration.Evaluate("boolean(visibility/protected[@expose='true'])");
            this.IncludeSealedProtected = (bool)configuration.Evaluate("boolean(visibility/sealedProtected[@expose='true'])");
            this.IncludeProtectedInternalAsProtected = (bool)configuration.Evaluate("boolean(visibility/protectedInternalAsProtected[@expose='true'])");
            this.IncludeNoPIATypes = (bool)configuration.Evaluate("boolean(visibility/noPIATypes[@expose='true'])");
            this.IncludePublicCompilerGenerated = (bool)configuration.Evaluate("boolean(visibility/publicCompilerGenerated[@expose='true'])");

            // API filter
            XPathNavigator apiFilterNode = configuration.SelectSingleNode("apiFilter");

            if(apiFilterNode != null)
            {
                XmlReader configurationReader = apiFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                apiFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }
            else
                apiFilter = new RootFilter();

            // Attribute filter
            XPathNavigator attributeFilterNode = configuration.SelectSingleNode("attributeFilter");

            if(attributeFilterNode != null)
            {
                XmlReader configurationReader = attributeFilterNode.ReadSubtree();
                configurationReader.MoveToContent();
                attributeFilter = new RootFilter(configurationReader);
                configurationReader.Close();
            }
            else
                attributeFilter = new RootFilter();
        }