Ejemplo n.º 1
0
        public void ReadConfiguration(XPathNavigator nav)
        {
            name     = Helpers.GetRequiredNonEmptyAttribute(nav, "name");
            target   = Helpers.ConvertEnum <FeatureTarget> (Helpers.GetRequiredNonEmptyAttribute(nav, "target"), "target");
            fileName = Helpers.GetOptionalAttribute(nav, "fileName");

            if (String.IsNullOrEmpty(fileName))
            {
                fileName = name;
            }

            sections = new Section();
            Helpers.BuildSectionTree(nav.Select("./section[string-length (@name) > 0]"), sections);
        }
        public void ReadConfiguration(XPathNavigator nav)
        {
            name = Helpers.GetRequiredNonEmptyAttribute(nav, "name");

            requirements = new Section();
            Helpers.BuildSectionTree(nav.Select("requires/section[string-length(@name) > 0]"), requirements);

            XPathNodeIterator iter = nav.Select("contents/text()");
            StringBuilder     sb   = new StringBuilder();

            while (iter.MoveNext())
            {
                sb.Append(iter.Current.Value);
            }
            if (sb.Length > 0)
            {
                contents = sb.ToString();
            }
        }