private AnalyzerConfiguration createAnalyzerConfig(XmlNode analyzerNode)
        {
            var analyzerConfig = new AnalyzerConfiguration();

            setTypeActivationName(analyzerConfig, analyzerNode);
            setDisplayName(analyzerConfig, analyzerNode);
            setCtorArgs(analyzerConfig, analyzerNode);
            analyzerConfig.Enabled = true;
            return(analyzerConfig);
        }
        private void setCtorArgs(AnalyzerConfiguration analyzerConfig, XmlNode analyzerNode)
        {
            var ctorArgs = analyzerNode.SelectNodes("ctorArgs/ctorArg");

            foreach (XmlNode ctorArgNode in ctorArgs)
            {
                var ctorArgValueAttribute = ctorArgNode.Attributes["value"];
                if (ctorArgValueAttribute == null)
                {
                    throw new CtorValueAttributeNotFoundException();
                }

                var ctorArgNameAttribute = ctorArgNode.Attributes["name"];
                var ctorArgName          = ctorArgNameAttribute != null ? ctorArgNameAttribute.Value : Guid.NewGuid().ToString();

                if (analyzerConfig.ConstructorArgs.ContainsKey(ctorArgName))
                {
                    throw new DuplicateCtorArgNameException(ctorArgName);
                }
                analyzerConfig.ConstructorArgs.Add(ctorArgName, ctorArgValueAttribute.Value);
            }
        }
        private void setTypeActivationName(AnalyzerConfiguration analyzerConfig, XmlNode analyzerNode)
        {
            XmlNode typeNameNode = getChildNode(analyzerNode, "typeName", new TypeNameNodeNotFoundException());

            analyzerConfig.TypeActivationName = typeNameNode.InnerText;
        }
        private void setDisplayName(AnalyzerConfiguration analyzerConfig, XmlNode analyzerNode)
        {
            XmlNode typeNameNode = getChildNode(analyzerNode, "displayName");

            analyzerConfig.DisplayName = typeNameNode == null ? string.Empty : typeNameNode.InnerText;
        }