private string method_0(esriNetworkDatasetType esriNetworkDatasetType_0) { switch (esriNetworkDatasetType_0) { case esriNetworkDatasetType.esriNDTGeodatabase: return("Geodatabase-based network dataset"); case esriNetworkDatasetType.esriNDTShapefile: return("Shapefile-based network dataset"); case esriNetworkDatasetType.esriNDTSDC: return("SDC-based network dataset"); } return("The network dataset type is unknown"); }
public Network(SerializationInfo info, StreamingContext context) : base(info, context) { this._extent = (Extent)info.GetValue("extent", typeof(Extent)); this._spatialReference = (SpatialReference)info.GetValue("spatialReference", typeof(SpatialReference)); this._logicalNetworkName = info.GetString("logicalNetworkName"); this._networkType = (esriNetworkDatasetType)Enum.Parse(typeof(esriNetworkDatasetType), info.GetString("networkType"), true); this._buildable = info.GetBoolean("buildable"); this._supportsTurns = info.GetBoolean("supportsTurns"); this._networkDirections = (NetworkDirections)info.GetValue("networkDirections", typeof(NetworkDirections)); this._properties = (List <Property>)info.GetValue("properties", typeof(List <Property>)); this._userData = (List <Property>)info.GetValue("userData", typeof(List <Property>)); this._networkSources = (List <NetworkSource>)info.GetValue("networkSources", typeof(List <NetworkSource>)); this._networkAttributes = (List <NetworkAttribute>)info.GetValue("networkAttributes", typeof(List <NetworkAttribute>)); this._networkAssignments = (List <NetworkAssignment>)info.GetValue("networkAssignments", typeof(List <NetworkAssignment>)); this._configurationKeyword = info.GetString("configurationKeyword"); }
public Network(Network prototype) : base(prototype) { if (prototype.Extent != null) { this._extent = prototype.Extent.Clone() as Extent; } if (prototype.SpatialReference != null) { this._spatialReference = prototype.SpatialReference.Clone() as SpatialReference; } this._logicalNetworkName = prototype.LogicalNetworkName; this._networkType = prototype.NetworkType; this._buildable = prototype.Buildable; this._supportsTurns = prototype.SupportsTurns; this._networkDirections = (NetworkDirections)prototype.NetworkDirections.Clone(); this._properties = new List <Property>(); foreach (Property property in prototype.PropertyCollection) { this._properties.Add((Property)property.Clone()); } this._userData = new List <Property>(); foreach (Property property in prototype.UserDataCollection) { this._userData.Add((Property)property.Clone()); } this._networkSources = new List <NetworkSource>(); foreach (NetworkSource networkSource in prototype.NetworkSourceCollection) { this._networkSources.Add((NetworkSource)networkSource.Clone()); } this._networkAttributes = new List <NetworkAttribute>(); foreach (NetworkAttribute networkAttribute in prototype.NetworkAttributeCollection) { this._networkAttributes.Add((NetworkAttribute)networkAttribute.Clone()); } this._networkAssignments = new List <NetworkAssignment>(); foreach (NetworkAssignment networkAssignment in prototype.NetworkAssignmentCollection) { this._networkAssignments.Add((NetworkAssignment)networkAssignment.Clone()); } this._configurationKeyword = prototype.ConfigurationKeyword; }
// // CONSTRUCTOR // public Network(IXPathNavigable path) : base(path) { // Get Navigator XPathNavigator navigator = path.CreateNavigator(); // <Extent> XPathNavigator navigatorExtent = navigator.SelectSingleNode("Extent"); if (navigatorExtent != null) { this._extent = new Extent(navigatorExtent); } else { this._extent = new Extent(); } // <SpatialReference> XPathNavigator navigatorSpatialReference = navigator.SelectSingleNode("SpatialReference"); if (navigatorSpatialReference != null) { this._spatialReference = new SpatialReference(navigatorSpatialReference); } else { this._spatialReference = new SpatialReference(); } // <LogicalNetworkName> XPathNavigator navigatorLogicalNetworkName = navigator.SelectSingleNode("LogicalNetworkName"); if (navigatorLogicalNetworkName != null) { this._logicalNetworkName = navigatorLogicalNetworkName.Value; } // <NetworkType> XPathNavigator navigatorNetworkType = navigator.SelectSingleNode("NetworkType"); if (navigatorNetworkType != null) { this._networkType = (esriNetworkDatasetType)Enum.Parse(typeof(esriNetworkDatasetType), navigatorNetworkType.Value, true); } // <Buildable> XPathNavigator navigatorBuildable = navigator.SelectSingleNode("Buildable"); if (navigatorBuildable != null) { this._buildable = navigatorBuildable.ValueAsBoolean; } // <SupportsTurns> XPathNavigator navigatorSupportsTurns = navigator.SelectSingleNode("SupportsTurns"); if (navigatorSupportsTurns != null) { this._supportsTurns = navigatorSupportsTurns.ValueAsBoolean; } // <NetworkDirections> XPathNavigator navigatorNetworkDirections = navigator.SelectSingleNode("NetworkDirections"); if (navigatorNetworkDirections != null) { this._networkDirections = new NetworkDirections(navigatorNetworkDirections); } else { this._networkDirections = new NetworkDirections(); } // <Properties><PropertyArray><PropertySetProperty> this._properties = new List <Property>(); XPathNodeIterator interatorProperty = navigator.Select("Properties/PropertyArray/PropertySetProperty"); while (interatorProperty.MoveNext()) { // Get <Property> XPathNavigator navigatorProperty = interatorProperty.Current; // Add Property Property property = new Property(navigatorProperty); this._properties.Add(property); } // <UserData><PropertyArray><PropertySetProperty> this._userData = new List <Property>(); XPathNodeIterator interatorProperty2 = navigator.Select("UserData/PropertyArray/PropertySetProperty"); while (interatorProperty2.MoveNext()) { // Get <Property> XPathNavigator navigatorProperty = interatorProperty2.Current; // Add Property Property property = new Property(navigatorProperty); this._userData.Add(property); } // <EdgeFeatureSources><EdgeFeatureSource> // <JunctionFeatureSources><JunctionFeatureSource> // <SystemJunctionSources><SystemJunctionSource> // <TurnFeatureSources><TurnFeatureSource> this._networkSources = new List <NetworkSource>(); XPathNodeIterator interatorNetworkSource = navigator.Select( "EdgeFeatureSources/EdgeFeatureSource" + " | " + "JunctionFeatureSources/JunctionFeatureSource" + " | " + "SystemJunctionSources/SystemJunctionSource" + " | " + "TurnFeatureSources/TurnFeatureSource"); while (interatorNetworkSource.MoveNext()) { // XPathNavigator navigatorNetworkSource = interatorNetworkSource.Current; NetworkSource networkSource = null; switch (navigatorNetworkSource.Name) { case "EdgeFeatureSource": networkSource = new EdgeFeatureSource(navigatorNetworkSource); break; case "JunctionFeatureSource": networkSource = new JunctionFeatureSource(navigatorNetworkSource); break; case "SystemJunctionSource": networkSource = new SystemJunctionSource(navigatorNetworkSource); break; case "TurnFeatureSource": networkSource = new TurnFeatureSource(navigatorNetworkSource); break; } // Add EdgeFeatureSource if (networkSource != null) { this._networkSources.Add(networkSource); } } // <EvaluatedNetworkAttributes><EvaluatedNetworkAttribute> // <NetworkAttributes><NetworkAttribute> this._networkAttributes = new List <NetworkAttribute>(); XPathNodeIterator interatorNetworkAttribute = navigator.Select( "EvaluatedNetworkAttributes/EvaluatedNetworkAttribute" + " | " + "NetworkAttributes/NetworkAttribute"); while (interatorNetworkAttribute.MoveNext()) { // XPathNavigator navigatorNetworkAttribute = interatorNetworkAttribute.Current; NetworkAttribute networkAttribute = null; switch (navigatorNetworkAttribute.Name) { case "EvaluatedNetworkAttribute": networkAttribute = new EvaluatedNetworkAttribute(navigatorNetworkAttribute); break; case "NetworkAttribute": networkAttribute = new NetworkAttribute(navigatorNetworkAttribute); break; } // Add EdgeFeatureSource if (networkAttribute != null) { this._networkAttributes.Add(networkAttribute); } } // <NetworkAssignments><NetworkAssignment> this._networkAssignments = new List <NetworkAssignment>(); XPathNodeIterator interatorNetworkAssignment = navigator.Select("NetworkAssignments/NetworkAssignment"); while (interatorNetworkAssignment.MoveNext()) { // Get <NetworkAssignment> XPathNavigator navigatorNetworkAssignment = interatorNetworkAssignment.Current; // Add NetworkAssignment NetworkAssignment networkAssignment = new NetworkAssignment(navigatorNetworkAssignment); this._networkAssignments.Add(networkAssignment); } // <ConfigurationKeyword> XPathNavigator navigatorConfigurationKeyword = navigator.SelectSingleNode("ConfigurationKeyword"); if (navigatorConfigurationKeyword != null) { this._configurationKeyword = navigatorConfigurationKeyword.Value; } }
// // CONSTRUCTOR // public Network(IXPathNavigable path) : base(path) { // Get Navigator XPathNavigator navigator = path.CreateNavigator(); // <Extent> XPathNavigator navigatorExtent = navigator.SelectSingleNode("Extent"); if (navigatorExtent != null) { this._extent = new Extent(navigatorExtent); } else { this._extent = new Extent(); } // <SpatialReference> XPathNavigator navigatorSpatialReference = navigator.SelectSingleNode("SpatialReference"); if (navigatorSpatialReference != null) { this._spatialReference = new SpatialReference(navigatorSpatialReference); } else { this._spatialReference = new SpatialReference(); } // <LogicalNetworkName> XPathNavigator navigatorLogicalNetworkName = navigator.SelectSingleNode("LogicalNetworkName"); if (navigatorLogicalNetworkName != null) { this._logicalNetworkName = navigatorLogicalNetworkName.Value; } // <NetworkType> XPathNavigator navigatorNetworkType = navigator.SelectSingleNode("NetworkType"); if (navigatorNetworkType != null) { this._networkType = (esriNetworkDatasetType)Enum.Parse(typeof(esriNetworkDatasetType), navigatorNetworkType.Value, true); } // <Buildable> XPathNavigator navigatorBuildable = navigator.SelectSingleNode("Buildable"); if (navigatorBuildable != null) { this._buildable = navigatorBuildable.ValueAsBoolean; } // <SupportsTurns> XPathNavigator navigatorSupportsTurns = navigator.SelectSingleNode("SupportsTurns"); if (navigatorSupportsTurns != null) { this._supportsTurns = navigatorSupportsTurns.ValueAsBoolean; } // <NetworkDirections> XPathNavigator navigatorNetworkDirections = navigator.SelectSingleNode("NetworkDirections"); if (navigatorNetworkDirections != null) { this._networkDirections = new NetworkDirections(navigatorNetworkDirections); } else { this._networkDirections = new NetworkDirections(); } // <Properties><PropertyArray><PropertySetProperty> this._properties = new List<Property>(); XPathNodeIterator interatorProperty = navigator.Select("Properties/PropertyArray/PropertySetProperty"); while (interatorProperty.MoveNext()) { // Get <Property> XPathNavigator navigatorProperty = interatorProperty.Current; // Add Property Property property = new Property(navigatorProperty); this._properties.Add(property); } // <UserData><PropertyArray><PropertySetProperty> this._userData = new List<Property>(); XPathNodeIterator interatorProperty2 = navigator.Select("UserData/PropertyArray/PropertySetProperty"); while (interatorProperty2.MoveNext()) { // Get <Property> XPathNavigator navigatorProperty = interatorProperty2.Current; // Add Property Property property = new Property(navigatorProperty); this._userData.Add(property); } // <EdgeFeatureSources><EdgeFeatureSource> // <JunctionFeatureSources><JunctionFeatureSource> // <SystemJunctionSources><SystemJunctionSource> // <TurnFeatureSources><TurnFeatureSource> this._networkSources = new List<NetworkSource>(); XPathNodeIterator interatorNetworkSource = navigator.Select( "EdgeFeatureSources/EdgeFeatureSource" + " | " + "JunctionFeatureSources/JunctionFeatureSource" + " | " + "SystemJunctionSources/SystemJunctionSource" + " | " + "TurnFeatureSources/TurnFeatureSource"); while (interatorNetworkSource.MoveNext()) { // XPathNavigator navigatorNetworkSource = interatorNetworkSource.Current; NetworkSource networkSource = null; switch (navigatorNetworkSource.Name) { case "EdgeFeatureSource": networkSource = new EdgeFeatureSource(navigatorNetworkSource); break; case "JunctionFeatureSource": networkSource = new JunctionFeatureSource(navigatorNetworkSource); break; case "SystemJunctionSource": networkSource = new SystemJunctionSource(navigatorNetworkSource); break; case "TurnFeatureSource": networkSource = new TurnFeatureSource(navigatorNetworkSource); break; } // Add EdgeFeatureSource if (networkSource != null) { this._networkSources.Add(networkSource); } } // <EvaluatedNetworkAttributes><EvaluatedNetworkAttribute> // <NetworkAttributes><NetworkAttribute> this._networkAttributes = new List<NetworkAttribute>(); XPathNodeIterator interatorNetworkAttribute = navigator.Select( "EvaluatedNetworkAttributes/EvaluatedNetworkAttribute" + " | " + "NetworkAttributes/NetworkAttribute"); while (interatorNetworkAttribute.MoveNext()) { // XPathNavigator navigatorNetworkAttribute = interatorNetworkAttribute.Current; NetworkAttribute networkAttribute = null; switch (navigatorNetworkAttribute.Name) { case "EvaluatedNetworkAttribute": networkAttribute = new EvaluatedNetworkAttribute(navigatorNetworkAttribute); break; case "NetworkAttribute": networkAttribute = new NetworkAttribute(navigatorNetworkAttribute); break; } // Add EdgeFeatureSource if (networkAttribute != null) { this._networkAttributes.Add(networkAttribute); } } // <NetworkAssignments><NetworkAssignment> this._networkAssignments = new List<NetworkAssignment>(); XPathNodeIterator interatorNetworkAssignment = navigator.Select("NetworkAssignments/NetworkAssignment"); while (interatorNetworkAssignment.MoveNext()) { // Get <NetworkAssignment> XPathNavigator navigatorNetworkAssignment = interatorNetworkAssignment.Current; // Add NetworkAssignment NetworkAssignment networkAssignment = new NetworkAssignment(navigatorNetworkAssignment); this._networkAssignments.Add(networkAssignment); } // <ConfigurationKeyword> XPathNavigator navigatorConfigurationKeyword = navigator.SelectSingleNode("ConfigurationKeyword"); if (navigatorConfigurationKeyword != null) { this._configurationKeyword = navigatorConfigurationKeyword.Value; } }
public Network(Network prototype) : base(prototype) { if (prototype.Extent != null) { this._extent = prototype.Extent.Clone() as Extent; } if (prototype.SpatialReference != null) { this._spatialReference = prototype.SpatialReference.Clone() as SpatialReference; } this._logicalNetworkName = prototype.LogicalNetworkName; this._networkType = prototype.NetworkType; this._buildable = prototype.Buildable; this._supportsTurns = prototype.SupportsTurns; this._networkDirections = (NetworkDirections)prototype.NetworkDirections.Clone(); this._properties = new List<Property>(); foreach (Property property in prototype.PropertyCollection) { this._properties.Add((Property)property.Clone()); } this._userData = new List<Property>(); foreach (Property property in prototype.UserDataCollection) { this._userData.Add((Property)property.Clone()); } this._networkSources = new List<NetworkSource>(); foreach (NetworkSource networkSource in prototype.NetworkSourceCollection) { this._networkSources.Add((NetworkSource)networkSource.Clone()); } this._networkAttributes = new List<NetworkAttribute>(); foreach (NetworkAttribute networkAttribute in prototype.NetworkAttributeCollection) { this._networkAttributes.Add((NetworkAttribute)networkAttribute.Clone()); } this._networkAssignments = new List<NetworkAssignment>(); foreach (NetworkAssignment networkAssignment in prototype.NetworkAssignmentCollection) { this._networkAssignments.Add((NetworkAssignment)networkAssignment.Clone()); } this._configurationKeyword = prototype.ConfigurationKeyword; }
public Network(SerializationInfo info, StreamingContext context) : base(info, context) { this._extent = (Extent)info.GetValue("extent", typeof(Extent)); this._spatialReference = (SpatialReference)info.GetValue("spatialReference", typeof(SpatialReference)); this._logicalNetworkName = info.GetString("logicalNetworkName"); this._networkType = (esriNetworkDatasetType)Enum.Parse(typeof(esriNetworkDatasetType), info.GetString("networkType"), true); this._buildable = info.GetBoolean("buildable"); this._supportsTurns = info.GetBoolean("supportsTurns"); this._networkDirections = (NetworkDirections)info.GetValue("networkDirections", typeof(NetworkDirections)); this._properties = (List<Property>)info.GetValue("properties", typeof(List<Property>)); this._userData = (List<Property>)info.GetValue("userData", typeof(List<Property>)); this._networkSources = (List<NetworkSource>)info.GetValue("networkSources", typeof(List<NetworkSource>)); this._networkAttributes = (List<NetworkAttribute>)info.GetValue("networkAttributes", typeof(List<NetworkAttribute>)); this._networkAssignments = (List<NetworkAssignment>)info.GetValue("networkAssignments", typeof(List<NetworkAssignment>)); this._configurationKeyword = info.GetString("configurationKeyword"); }