コード例 #1
0
        ActionList OnConditional(XPathNavigator nav)
        {
            var name = nav.GetAttribute("feature");

            if (name == null || !nav.GetBoolAttribute("enabled", out var enabled))
            {
                throw ThrowError("<conditional> needs both `feature` and `enabled` arguments.");
            }

            OptimizerOptions.FeatureByName(name);

            var conditional = new ActionList(name, enabled);

            nav.ProcessChildren("namespace", conditional.Children, OnNamespaceEntry);
            nav.ProcessChildren("type", (Type)null, conditional.Children, OnTypeEntry);
            nav.ProcessChildren("method", (Type)null, conditional.Children, OnMethodEntry);

            return(conditional);
        }