Example #1
0
        public Shields(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <TypeFieldName>
            XPathNavigator navigatorTypeFieldName = navigator.SelectSingleNode("TypeFieldName");
            if (navigatorTypeFieldName != null) {
                this._typeFieldName = navigatorTypeFieldName.Value;
            }

            // <NumberFieldName>
            XPathNavigator navigatorNumberFieldName = navigator.SelectSingleNode("NumberFieldName");
            if (navigatorNumberFieldName != null) {
                this._numberFieldName = navigatorNumberFieldName.Value;
            }

            // <CombinedFieldName>
            XPathNavigator navigatorCombinedFieldName = navigator.SelectSingleNode("CombinedFieldName");
            if (navigatorCombinedFieldName != null) {
                this._combinedFieldName = navigatorCombinedFieldName.Value;
            }

            // <UseCombinedField>
            XPathNavigator navigatorUseCombinedField = navigator.SelectSingleNode("UseCombinedField");
            if (navigatorUseCombinedField != null) {
                this._useCombinedField = navigatorUseCombinedField.ValueAsBoolean;
            }

            // <ArrayOfShield><Shield></Shield></ArrayOfShield>
            this._shields = new List<Shield>();
            XPathNodeIterator interatorShield = navigator.Select("ArrayOfShield/Shield");
            while (interatorShield.MoveNext()) {
                // Get <Shield>
                XPathNavigator navigatorShield = interatorShield.Current;

                // Add Shield
                Shield shield = new Shield(navigatorShield);
                this._shields.Add(shield);
            }
        }
Example #2
0
 public Shield(Shield prototype) : base(prototype) {
     this._shieldType = prototype.ShieldType;
     this._shieldDescription = prototype.ShieldDescription;
 }