当前位置: 首页>>代码示例>>C#>>正文


C# IXPathNavigable类代码示例

本文整理汇总了C#中IXPathNavigable的典型用法代码示例。如果您正苦于以下问题:C# IXPathNavigable类的具体用法?C# IXPathNavigable怎么用?C# IXPathNavigable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IXPathNavigable类属于命名空间,在下文中一共展示了IXPathNavigable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Property

        public Property(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // Key
            XPathNavigator navigatorKey = navigator.SelectSingleNode("Key");
            if (navigatorKey != null) {
                this._key = navigatorKey.Value;
            }

            // Type & Value
            XPathNavigator navigatorValue = navigator.SelectSingleNode("Value");
            if (navigatorValue == null) {
                // Set VALUE to null if the node does not exist
                this._value = null;
            }
            else {
                // Type
                this._type = navigatorValue.GetAttribute(Xml._TYPE, Xml.XMLSCHEMAINSTANCE);

                // Value
                if (this._type == "esri:XMLPersistedObject") {
                    XPathNavigator navigatorBytes = navigatorValue.SelectSingleNode("Bytes");
                    if (navigatorBytes != null) {
                        this._value = navigatorBytes.Value;
                    }
                }
                else {
                    this._value = navigatorValue.Value;
                }
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:32,代码来源:Property.cs

示例2: GeometricNetworkControllerMembership

        public GeometricNetworkControllerMembership(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <GeometricNetworkName>Empty_Net</GeometricNetworkName> 
            XPathNavigator navigatorGeometricNetworkName = navigator.SelectSingleNode("GeometricNetworkName");
            if (navigatorGeometricNetworkName != null) {
                this._geometricNetworkName = navigatorGeometricNetworkName.Value;
            }

            // <EnabledFieldName>Enabled</EnabledFieldName> 
            XPathNavigator navigatorEnabledFieldName = navigator.SelectSingleNode("EnabledFieldName");
            if (navigatorEnabledFieldName != null) {
                this._enabledFieldName = navigatorEnabledFieldName.Value;
            }

            // <AncillaryRoleFieldName /> 
            XPathNavigator navigatorAncillaryRoleFieldName = navigator.SelectSingleNode("AncillaryRoleFieldName");
            if (navigatorAncillaryRoleFieldName != null) {
                this._ancillaryRoleFieldName = navigatorAncillaryRoleFieldName.Value;
            }

            // <NetworkClassAncillaryRole>esriNCARNone</NetworkClassAncillaryRole> 
            XPathNavigator navigatorNetworkClassAncillaryRole = navigator.SelectSingleNode("NetworkClassAncillaryRole");
            if (navigatorNetworkClassAncillaryRole != null) {
                this._networkClassAncillaryRole = (esriNetworkClassAncillaryRole)Enum.Parse(typeof(esriNetworkClassAncillaryRole), navigatorNetworkClassAncillaryRole.Value, true);
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:GeometricNetworkControllerMembership.cs

示例3: SubtypeField

        public SubtypeField(IXPathNavigable path) : base(path) {
            XPathNavigator navigator = path.CreateNavigator();

            // <FieldName></FieldName>
            XPathNavigator navigatorFieldName = navigator.SelectSingleNode("FieldName");
            if (navigatorFieldName != null) {
                this._fieldName = navigatorFieldName.Value;
            }

            // <DomainName></DomainName>
            XPathNavigator navigatorDomainName = navigator.SelectSingleNode("DomainName");
            if (navigatorDomainName != null) {
                this._domainName = navigatorDomainName.Value;
            }

            // <DefaultValue></DefaultValue>
            XPathNavigator navigatorDefaultValue = navigator.SelectSingleNode("DefaultValue");
            if (navigatorDefaultValue != null) {
                this._defaultValue = navigatorDefaultValue.Value;
            }

            // Initialize
            this.UpdateText();

            // Set Element Properties
            this.Image = new Crainiate.ERM4.Image("Resource.publicfield.gif", "Crainiate.ERM4.Component");
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:27,代码来源:SubtypeField.cs

示例4: NetWeight

        public NetWeight(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <WeightID>0</WeightID> 
            XPathNavigator navigatorWeightID = navigator.SelectSingleNode("WeightID");
            if (navigatorWeightID != null) {
                this._weightID = navigatorWeightID.ValueAsInt;
            }

            // <WeightName>MMElectricTraceWeight</WeightName> 
            XPathNavigator navigatorWeightName = navigator.SelectSingleNode("WeightName");
            if (navigatorWeightName != null) {
                this._weightName = navigatorWeightName.Value;
            }

            // <WeightType>esriWTInteger</WeightType> 
            XPathNavigator navigatorWeightType = navigator.SelectSingleNode("WeightType");
            if (navigatorWeightType != null) {
                this._weightType = (esriWeightType)Enum.Parse(typeof(esriWeightType), navigatorWeightType.Value, true);
            }

            // <BitGateSize>0</BitGateSize> 
            XPathNavigator navigatorBitGateSize = navigator.SelectSingleNode("BitGateSize");
            if (navigatorBitGateSize != null) {
                this._bitGateSize = navigatorBitGateSize.ValueAsInt;
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:NetWeight.cs

示例5: EdgeFeatureSource

        //
        // CONSTRUCTOR
        //
        //public EdgeFeatureSource() : base() { }
        public EdgeFeatureSource(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <FromElevationFieldName>
            XPathNavigator navigatorFromElevationFieldName = navigator.SelectSingleNode("FromElevationFieldName");
            if (navigatorFromElevationFieldName != null) {
                this._fromElevationFieldName = navigatorFromElevationFieldName.Value;
            }

            // <ToElevationFieldName>
            XPathNavigator navigatorToElevationFieldName = navigator.SelectSingleNode("ToElevationFieldName");
            if (navigatorToElevationFieldName != null) {
                this._toElevationFieldName = navigatorToElevationFieldName.Value;
            }

            // <Connectivity><PropertyArray><PropertySetProperty>
            this._connectivity = new List<Property>();
            XPathNodeIterator interatorProperty = navigator.Select("Connectivity/PropertyArray/PropertySetProperty");
            while (interatorProperty.MoveNext()) {
                // Get <Property>
                XPathNavigator navigatorProperty = interatorProperty.Current;

                // Add Property
                Property property = new Property(navigatorProperty);
                this._connectivity.Add(property);
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:32,代码来源:EdgeFeatureSource.cs

示例6: SaveAsync

        /// <summary>
        /// The preferred way to save - this should be a <see cref="System.Xml.XmlDocument" /> straight from CCP.
        /// </summary>
        /// <param name="filename">The filename.</param>
        /// <param name="xdoc">The xml to save.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException"></exception>
        public static async Task SaveAsync(string filename, IXPathNavigable xdoc)
        {
            xdoc.ThrowIfNull(nameof(xdoc));

            EveMonClient.EnsureCacheDirInit();

            XmlDocument xmlDoc = (XmlDocument)xdoc;
            XmlNode characterNode = xmlDoc.SelectSingleNode("//name");
            filename = characterNode?.InnerText ?? filename;

            // Writes in the target file
            string fileName = Path.Combine(EveMonClient.EVEMonXmlCacheDir, $"{filename}.xml");
            string content = Util.GetXmlStringRepresentation(xdoc);
            await FileHelper.OverwriteOrWarnTheUserAsync(fileName,
                async fs =>
                {
                    using (StreamWriter writer = new StreamWriter(fs, Encoding.UTF8))
                    {
                        await writer.WriteAsync(content);
                        await writer.FlushAsync();
                        await fs.FlushAsync();
                    }
                    return true;
                });
        }
开发者ID:,项目名称:,代码行数:32,代码来源:

示例7: AreXmlEquivalent

		public static void AreXmlEquivalent(string expected, IXPathNavigable actual)
		{
			if (expected == null) throw new ArgumentNullException("expected");
			if (actual == null) throw new ArgumentNullException("actual");

			AreXmlEquivalent(GetElement(expected), GetElement(actual));
		}
开发者ID:jeremymeng,项目名称:Core,代码行数:7,代码来源:CustomAssert.cs

示例8: RasterDef

        public RasterDef(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <Description></Description>
            XPathNavigator navigatorDescription = navigator.SelectSingleNode("Description");
            if (navigatorDescription != null) {
                this._description = navigatorDescription.Value;
            }

            // <IsByRef></IsByRef>
            XPathNavigator navigatorIsByRef = navigator.SelectSingleNode("IsByRef");
            if (navigatorIsByRef != null) {
                this._isByRef = navigatorIsByRef.ValueAsBoolean;
            }

            // <SpatialReference></SpatialReference>
            XPathNavigator navigatorSpatialReference = navigator.SelectSingleNode("SpatialReference");
            if (navigatorSpatialReference != null) {
                this._spatialReference = new SpatialReference(navigatorSpatialReference);
            }
            else {
                this._spatialReference = new SpatialReference();
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:25,代码来源:RasterDef.cs

示例9: NetworkAttributeParameter

        public NetworkAttributeParameter(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <Name>
            XPathNavigator navigatorName = navigator.SelectSingleNode("Name");
            if (navigatorName != null) {
                this._name = navigatorName.Value;
            }

            // <VarType>
            XPathNavigator navigatorVarType = navigator.SelectSingleNode("VarType");
            if (navigatorVarType != null) {
                this._varType = navigatorVarType.ValueAsInt;
            }

            // <Value>
            XPathNavigator navigatorValue = navigator.SelectSingleNode("Value");
            if (navigatorValue != null) {
                this._value = navigatorValue.Value;
            }

            // <DefaultValue>
            XPathNavigator navigatorDefaultValue = navigator.SelectSingleNode("DefaultValue");
            if (navigatorDefaultValue != null) {
                this._defaultValue = navigatorDefaultValue.Value;
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:NetworkAttributeParameter.cs

示例10: NetworkSourceDirections

        //
        // CONSTRUCTOR
        //
        //public NetworkSourceDirections() : base() { }
        public NetworkSourceDirections(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <AdminAreaFieldName>
            XPathNavigator navigatorAdminAreaFieldName = navigator.SelectSingleNode("AdminAreaFieldName");
            if (navigatorAdminAreaFieldName != null) {
                this._adminAreaFieldName = navigatorAdminAreaFieldName.Value;
            }

            // <Shields>
            XPathNavigator navigatorShields = navigator.SelectSingleNode("Shields");
            if (navigatorShields != null) {
                this._shields = new Shields(navigatorShields);
            }
            else {
                this._shields = new Shields();
            }

            // <StreetNameFields><StreetNameFields>
            this._streetNameFields = new List<StreetNameFields>();
            XPathNodeIterator interatorStreetNameFields = navigator.Select("StreetNameFields/StreetNameFields");
            while (interatorStreetNameFields.MoveNext()) {
                // Get <StreetNameFields>
                XPathNavigator navigatorStreetNameFields = interatorStreetNameFields.Current;

                // Add StreetNameFields
                StreetNameFields streetNameFields = new StreetNameFields(navigatorStreetNameFields);
                this._streetNameFields.Add(streetNameFields);
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:35,代码来源:NetworkSourceDirections.cs

示例11: Index

        public Index(IXPathNavigable path): base(path) {
            // Suspend Events
            this.SuspendEvents = true;

            // Get Naviagator
            XPathNavigator navigator = path.CreateNavigator();

            // <Name></Name>
            XPathNavigator navigatorIndexName = navigator.SelectSingleNode("Name");
            if (navigatorIndexName != null) {
                this._name = navigatorIndexName.Value;
            }

            // <IsUnique></IsUnique>
            XPathNavigator navigatorIsUnique = navigator.SelectSingleNode("IsUnique");
            if (navigatorIsUnique != null) {
                this._isUnique = navigatorIsUnique.ValueAsBoolean;
            }

            // <IsAscending></IsAscending>
            XPathNavigator navigatorIsAscending = navigator.SelectSingleNode("IsAscending");
            if (navigatorIsAscending != null) {
                this._isAscending = navigatorIsAscending.ValueAsBoolean;
            }

            // Initialize Text
            this.UpdateText();

            // Collapse group
            this.Expanded = false;

            // Resume Events
            this.SuspendEvents = false;
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:34,代码来源:Index.cs

示例12: Validate

        public Domain.ErrorCode Validate(IXPathNavigable configSectionNode)
        {
            log.Debug("Validating the configuration");

            lock (syncLock)
            {
                try
                {
                    isValid = true;

                    //TODO: is there a better way to do this?
                    var navigator = configSectionNode.CreateNavigator();
                    var doc = new XmlDocument();
                    doc.LoadXml(navigator.OuterXml);
                    doc.Schemas.Add(Schema);
                    doc.Validate(ValidationCallback);

                    if (isValid)
                    {
                        log.Debug("The configuration is valid");
                    }
                    else
                    {
                        log.Error("The configuration is invalid");
                    }
                }
                catch (XmlException ex)
                {
                    log.Error("An error occurred when validating the configuration", ex);
                    isValid = false;
                }

                return isValid ? Domain.ErrorCode.Ok : Domain.ErrorCode.InvalidConfig;
            }
        }
开发者ID:binarymash,项目名称:DatabaseScripter,代码行数:35,代码来源:ConfigurationValidator.cs

示例13: TerrainPyramid

        public TerrainPyramid(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            //<PyramidLevelStatus>1</PyramidLevelStatus> 
            XPathNavigator navigatorPyramidLevelStatus = navigator.SelectSingleNode("PyramidLevelStatus");
            if (navigatorPyramidLevelStatus != null) {
                this._pyramidLevelStatus = (TerrainElementStatus)Enum.Parse(typeof(TerrainElementStatus), navigatorPyramidLevelStatus.Value, true);
            }

            //<PointCount>-1</PointCount> 
            XPathNavigator navigatorPointCount = navigator.SelectSingleNode("PointCount");
            if (navigatorPointCount != null) {
                this._pointCount = navigatorPointCount.ValueAsInt;
            }

            //<MaxScale>1000</MaxScale> 
            XPathNavigator navigatorMaxScale = navigator.SelectSingleNode("MaxScale");
            if (navigatorMaxScale != null) {
                this._maxScale = navigatorMaxScale.ValueAsInt;
            }

            //<Resolution>2</Resolution> 
            XPathNavigator navigatorSourceStatus = navigator.SelectSingleNode("Resolution");
            if (navigatorSourceStatus != null) {
                this._resolution = navigatorSourceStatus.ValueAsDouble;
            }
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:28,代码来源:TerrainPyramid.cs

示例14: Subtype

        //
        // CONSTRUCTOR
        //
        public Subtype(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <SubtypeName>
            XPathNavigator navigatorSubtypeName = navigator.SelectSingleNode("SubtypeName");
            if (navigatorSubtypeName != null) {
                this._subtypeName = navigatorSubtypeName.Value;
            }

            // <SubtypeCode>
            XPathNavigator navigatorSubtypeCode = navigator.SelectSingleNode("SubtypeCode");
            if (navigatorSubtypeCode != null) {
                this._subtypeCode = navigatorSubtypeCode.ValueAsInt;
            }

            // <FieldInfos><SubtypeFieldInfo>
            XPathNodeIterator interatorSubtypeFieldInfo = navigator.Select("FieldInfos/SubtypeFieldInfo");
            while (interatorSubtypeFieldInfo.MoveNext()) {
                // Create Field
                XPathNavigator navigatorSubtypeFieldInfo = interatorSubtypeFieldInfo.Current;
                SubtypeField subtypeField = new SubtypeField(navigatorSubtypeFieldInfo);

                // Add Field To Group
                this.Rows.Add(subtypeField);
            }

            // Refresh
            this.Refresh();
        }
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:33,代码来源:Subtype.cs

示例15: PolicyResponseSummary

        public PolicyResponseSummary(string xmlPath)
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlPath);

            m_xmlWrapper = xmlDoc as IXPathNavigable;
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:7,代码来源:PolicyResponseSummary.cs


注:本文中的IXPathNavigable类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。