private void method_0(IGeometricNetwork igeometricNetwork_1) { try { IFeatureClassContainer featureDataset = (IFeatureClassContainer)igeometricNetwork_1.FeatureDataset; IEnumRule rules = igeometricNetwork_1.Rules; rules.Reset(); for (IRule rule2 = rules.Next(); rule2 != null; rule2 = rules.Next()) { if (rule2 is IConnectivityRule) { IConnectivityRule rule3 = (IConnectivityRule)rule2; if (rule3.Category == -1) { IJunctionConnectivityRule2 rule4 = (IJunctionConnectivityRule2)rule3; featureDataset.get_ClassByID(rule4.EdgeClassID); featureDataset.get_ClassByID(rule4.JunctionClassID); } else if (rule3.Type == esriRuleType.esriRTEdgeConnectivity) { IEdgeConnectivityRule rule5 = (IEdgeConnectivityRule)rule3; featureDataset.get_ClassByID(rule5.FromEdgeClassID); featureDataset.get_ClassByID(rule5.ToEdgeClassID); featureDataset.get_ClassByID(rule5.DefaultJunctionClassID); for (int i = 0; i < rule5.JunctionCount; i++) { } } } } } catch { } }
public ZEdgeConnectivityRule(ZGeometricNetwork geometricNetwork, IEdgeConnectivityRule edgeConnectivityRule) : base(edgeConnectivityRule as IRule) { // Initialize collection this.Junctions = new ObservableCollection<ZSubtype>(); // Get From Edge ZSubtype zSubtypeEdge1 = geometricNetwork.FindSubtype(edgeConnectivityRule.FromEdgeClassID, edgeConnectivityRule.FromEdgeSubtypeCode); this.FromEdge = zSubtypeEdge1; // Get To Edge ZSubtype zSubtypeEdge2 = geometricNetwork.FindSubtype(edgeConnectivityRule.ToEdgeClassID, edgeConnectivityRule.ToEdgeSubtypeCode); this.ToEdge = zSubtypeEdge2; // Loop for each junction for (int i = 0; i < edgeConnectivityRule.JunctionCount; i++) { // Get junction feature class ZSubtype zSubtypeJunction = geometricNetwork.FindSubtype(edgeConnectivityRule.get_JunctionClassID(i), edgeConnectivityRule.get_JunctionSubtypeCode(i)); // Add junction this.Junctions.Add(zSubtypeJunction); } // Store default this.DefaultJunction = geometricNetwork.FindSubtype(edgeConnectivityRule.DefaultJunctionClassID, edgeConnectivityRule.DefaultJunctionSubtypeCode); }