예제 #1
0
        private void Model_ElementRemoved(object sender, ElementsEventArgs e)
        {
            // Check Topology
            if (this._topology == null)
            {
                return;
            }

            // Get Element
            Element element = e.Value;

            if (element == null)
            {
                return;
            }
            EsriLine <TopologyControllerMembership> line = element as EsriLine <TopologyControllerMembership>;

            if (line == null)
            {
                return;
            }

            // Get Rule
            TopologyControllerMembership controller = line.Parent;

            //
            DiagrammerEnvironment diagrammerEnvironment = DiagrammerEnvironment.Default;
            SchemaModel           schemaModel           = diagrammerEnvironment.SchemaModel;
            ObjectClass           objectClass           = schemaModel.FindParent(controller);

            if (objectClass != null)
            {
                objectClass.ControllerMemberships.Remove(controller);
            }
        }
 public TopologyControllerMembership(TopologyControllerMembership prototype) : base(prototype)
 {
     this._topologyName = prototype.TopologyName;
     this._weight       = prototype.Weight;
     this._xyRank       = prototype.XYRank;
     this._zRank        = prototype.ZRank;
     this._eventNotificationOnValidate = prototype.EventNotificationOnValidate;
 }
예제 #3
0
        //
        // PROTECTED
        //
        protected override void WriteInnerXml(XmlWriter writer)
        {
            // Write Base Xml
            base.WriteInnerXml(writer);

            // <Extent></Extent>
            if (this._extent != null)
            {
                this._extent.WriteXml(writer);
            }

            // <SpatialReference></SpatialReference>
            if (this._spatialReference != null)
            {
                this._spatialReference.WriteXml(writer);
            }

            // <ClusterTolerance></ClusterTolerance>
            writer.WriteStartElement(Xml.CLUSTERTOLERANCE);
            writer.WriteValue(this._clusterTolerance);
            writer.WriteEndElement();

            // <ZClusterTolerance></ZClusterTolerance>
            writer.WriteStartElement(Xml.ZCLUSTERTOLERANCE);
            writer.WriteValue(this._zClusterTolerance);
            writer.WriteEndElement();

            // <MaxGeneratedErrorCount></MaxGeneratedErrorCount>
            writer.WriteStartElement(Xml.MAXGENERATEDERRORCOUNT);
            writer.WriteValue(this._maxGeneratedErrorCount);
            writer.WriteEndElement();

            // <FeatureClassNames>
            writer.WriteStartElement(Xml.FEATURECLASSNAMES);
            writer.WriteAttributeString(Xml._XSI, Xml._TYPE, null, Xml._NAMES);

            Dataset dataset = this.GetParent();

            if (dataset != null)
            {
                if (dataset.GetType() == typeof(FeatureDataset))
                {
                    FeatureDataset featureDataset = (FeatureDataset)dataset;
                    List <Dataset> datasets       = featureDataset.GetChildren();
                    foreach (Dataset dataset2 in datasets)
                    {
                        if (dataset2.GetType() == typeof(FeatureClass))
                        {
                            FeatureClass featureClass = (FeatureClass)dataset2;
                            List <ControllerMembership> controllers = featureClass.ControllerMemberships;
                            foreach (ControllerMembership controller in controllers)
                            {
                                if (controller is TopologyControllerMembership)
                                {
                                    TopologyControllerMembership topologyControllerMembership = (TopologyControllerMembership)controller;
                                    if (topologyControllerMembership.TopologyName == this.Name)
                                    {
                                        // <Name></Name>
                                        writer.WriteStartElement(Xml.NAME);
                                        writer.WriteValue(featureClass.Name);
                                        writer.WriteEndElement();
                                    }
                                }
                            }
                        }
                    }
                }
            }

            // </FeatureClassNames>
            writer.WriteEndElement();

            // <TopologyRules>
            writer.WriteStartElement(Xml.TOPOLOGYRULES);
            writer.WriteAttributeString(Xml._XSI, Xml._TYPE, null, Xml._ARRAYOFTOPOLOGYRULE);

            // <TopologyRule></TopologyRule>
            foreach (TopologyRule topologyRule in this._topologyRules)
            {
                topologyRule.WriteXml(writer);
            }

            // </TopologyRules>
            writer.WriteEndElement();
        }
 public TopologyControllerMembership(TopologyControllerMembership prototype) : base(prototype) {
     this._topologyName = prototype.TopologyName;
     this._weight = prototype.Weight;
     this._xyRank = prototype.XYRank;
     this._zRank = prototype.ZRank;
     this._eventNotificationOnValidate = prototype.EventNotificationOnValidate;
 }
        //
        // PUBLIC METHODS
        //
        public override void OpenModel()
        {
            // Create Origin and Destination Lists
            List <EsriShape <FeatureClass> > listFeatureClassFrom = new List <EsriShape <FeatureClass> >();
            List <EsriShape <FeatureClass> > listFeatureClassTo   = new List <EsriShape <FeatureClass> >();
            List <EsriShape <Subtype> >      listSubtypeFrom      = new List <EsriShape <Subtype> >();
            List <EsriShape <Subtype> >      listSubtypeTo        = new List <EsriShape <Subtype> >();

            // Exit if invalid
            if (this._topology == null)
            {
                return;
            }

            // Suspend Model
            if (ModelSettings.Default.EnableUndoRedo)
            {
                this.UndoList.Suspend();
            }
            this.Suspend();
            this.SuspendEvents = true;

            // Get SchemaModel
            SchemaModel schemaModel = (SchemaModel)this._topology.Container;

            // Get Parent FeatureDataset
            Dataset parent = this._topology.GetParent();

            if (parent == null)
            {
                return;
            }
            FeatureDataset featureDataset = parent as FeatureDataset;

            if (featureDataset == null)
            {
                return;
            }

            // Add From and To FeatureDatasets
            EsriShape <FeatureDataset> featureDataset1 = new EsriShape <FeatureDataset>(featureDataset);
            EsriShape <FeatureDataset> featureDataset2 = new EsriShape <FeatureDataset>(featureDataset);

            this.Shapes.Add(this.Shapes.CreateKey(), featureDataset1);
            this.Shapes.Add(this.Shapes.CreateKey(), featureDataset2);

            // Add all Child FeatureClasses
            foreach (Dataset dataset in featureDataset.GetChildren())
            {
                if (dataset.GetType() != typeof(FeatureClass))
                {
                    continue;
                }

                // Get FeatureClass
                FeatureClass featureClass = (FeatureClass)dataset;

                // Only continue if FeatureClass belongs to the Topology
                bool participate = false;
                foreach (ControllerMembership controller in featureClass.ControllerMemberships)
                {
                    if (controller is TopologyControllerMembership)
                    {
                        TopologyControllerMembership topologyControllerMembership = (TopologyControllerMembership)controller;
                        if (topologyControllerMembership.TopologyName == this._topology.Name)
                        {
                            participate = true;
                            break;
                        }
                    }
                }
                if (!participate)
                {
                    continue;
                }

                // Get Subtypes
                List <Subtype> subtypes = featureClass.GetSubtypes();

                // Add From FetaureClasses and Subtypes
                EsriShape <FeatureClass> featureClass1 = new EsriShape <FeatureClass>(featureClass);
                this.Shapes.Add(this.Shapes.CreateKey(), featureClass1);
                listFeatureClassFrom.Add(featureClass1);

                // Add Line from FeatureDataset to FeatureClass
                Arrow arrow1 = new Arrow();
                arrow1.BorderColor    = ModelSettings.Default.DisabledLined;
                arrow1.DrawBackground = false;
                Line line1 = new Line(featureDataset1, featureClass1);
                line1.End.AllowMove   = false;
                line1.End.Marker      = arrow1;
                line1.Start.AllowMove = false;
                line1.BorderColor     = ModelSettings.Default.DisabledLined;
                this.Lines.Add(this.Lines.CreateKey(), line1);

                // Add Subtypes and Link to FeatureClass
                foreach (Subtype subtype in subtypes)
                {
                    EsriShape <Subtype> sub = new EsriShape <Subtype>(subtype);
                    this.Shapes.Add(this.Shapes.CreateKey(), sub);
                    listSubtypeFrom.Add(sub);
                    Arrow arrow3 = new Arrow();
                    arrow3.BorderColor    = ModelSettings.Default.DisabledLined;
                    arrow3.DrawBackground = false;
                    Line line = new Line(featureClass1, sub);
                    line.End.AllowMove   = false;
                    line.End.Marker      = arrow3;
                    line.Start.AllowMove = false;
                    line.BorderColor     = ModelSettings.Default.DisabledLined;
                    this.Lines.Add(this.Lines.CreateKey(), line);
                }

                // Add To FetaureClasses and Subtypes
                EsriShape <FeatureClass> featureClass2 = new EsriShape <FeatureClass>(featureClass);
                this.Shapes.Add(this.Shapes.CreateKey(), featureClass2);
                listFeatureClassTo.Add(featureClass2);

                // Add Line from FeatureDataset to FeatureClass
                Arrow arrow2 = new Arrow();
                arrow2.BorderColor    = ModelSettings.Default.DisabledLined;
                arrow2.DrawBackground = false;
                Line line2 = new Line(featureClass2, featureDataset2);
                line2.End.AllowMove   = false;
                line2.Start.AllowMove = false;
                line2.Start.Marker    = arrow2;
                line2.BorderColor     = ModelSettings.Default.DisabledLined;
                this.Lines.Add(this.Lines.CreateKey(), line2);

                // Add Subtyes and Link to FeatureClasses
                foreach (Subtype subtype in subtypes)
                {
                    EsriShape <Subtype> sub = new EsriShape <Subtype>(subtype);
                    this.Shapes.Add(this.Shapes.CreateKey(), sub);
                    listSubtypeTo.Add(sub);
                    Arrow arrow4 = new Arrow();
                    arrow4.BorderColor    = ModelSettings.Default.DisabledLined;
                    arrow4.DrawBackground = false;
                    Line line = new Line(sub, featureClass2);
                    line.End.AllowMove   = false;
                    line.Start.Marker    = arrow4;
                    line.Start.AllowMove = false;
                    line.BorderColor     = ModelSettings.Default.DisabledLined;
                    this.Lines.Add(this.Lines.CreateKey(), line);
                }
            }

            // Loop Through All Connectivity Rules
            foreach (TopologyRule topologyRule in this._topology.TopologyRules)
            {
                // Origin Table
                EsriTable origin = null;
                if (topologyRule.AllOriginSubtypes)
                {
                    origin = schemaModel.FindObjectClass(topologyRule.OriginClassId);
                }
                else
                {
                    origin = schemaModel.FindObjectClassOrSubtype(
                        topologyRule.OriginClassId,
                        topologyRule.OriginSubtype);
                }

                // Destination Table
                EsriTable destination = null;
                if (topologyRule.AllDestinationSubtypes)
                {
                    destination = schemaModel.FindObjectClass(topologyRule.DestinationClassId);
                }
                else
                {
                    destination = schemaModel.FindObjectClassOrSubtype(
                        topologyRule.DestinationClassId,
                        topologyRule.DestinationSubtype);
                }

                // Origin and Destination Shapes
                Shape shapeOrigin      = null;
                Shape shapeDestiantion = null;

                // Find Origin Shape in Diagram
                foreach (EsriShape <FeatureClass> f in listFeatureClassFrom)
                {
                    if (f.Parent == origin)
                    {
                        shapeOrigin = f;
                        break;
                    }
                }
                if (shapeOrigin == null)
                {
                    foreach (EsriShape <Subtype> s in listSubtypeFrom)
                    {
                        if (s.Parent == origin)
                        {
                            shapeOrigin = s;
                            break;
                        }
                    }
                }

                // Find Destination Shape in Diagram
                foreach (EsriShape <FeatureClass> f in listFeatureClassTo)
                {
                    if (f.Parent == destination)
                    {
                        shapeDestiantion = f;
                        break;
                    }
                }
                if (shapeDestiantion == null)
                {
                    foreach (EsriShape <Subtype> s in listSubtypeTo)
                    {
                        if (s.Parent == destination)
                        {
                            shapeDestiantion = s;
                            break;
                        }
                    }
                }

                // Skip if Origin and Destination Shapes not found
                if (shapeOrigin == null || shapeDestiantion == null)
                {
                    continue;
                }

                EsriLine <TopologyRule> line2 = new EsriLine <TopologyRule>(topologyRule, shapeOrigin, shapeDestiantion);
                this.Lines.Add(this.Lines.CreateKey(), line2);
            }

            // Perform Layout
            this.ExecuteLayout(typeof(HierarchicalLayout), true);

            // Resume and Refresh Model
            this.SuspendEvents = false;
            this.Resume();
            if (ModelSettings.Default.EnableUndoRedo)
            {
                this.UndoList.Resume();
            }
            this.Refresh();
        }
예제 #6
0
        //
        // CONSTRUCTOR
        //
        public ObjectClass(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <OIDFieldName></OIDFieldName>
            XPathNavigator navigatorOIDFieldName = navigator.SelectSingleNode("OIDFieldName");
            if (navigatorOIDFieldName != null) {
                this._oidFieldName = navigatorOIDFieldName.Value;
            }

            // <CLSID></CLSID>
            XPathNavigator navigatorCLSID = navigator.SelectSingleNode("CLSID");
            if (navigatorCLSID != null) {
                if (!string.IsNullOrEmpty(navigatorCLSID.Value)) {
                    this._clsid = navigatorCLSID.Value;
                }
            }

            // <EXTCLSID></EXTCLSID>
            XPathNavigator navigatorEXTCLSID = navigator.SelectSingleNode("EXTCLSID");
            if (navigatorEXTCLSID != null) {
                if (!string.IsNullOrEmpty(navigatorEXTCLSID.Value)) {
                    this._extClsid = navigatorEXTCLSID.Value;
                }
            }

            // <AliasName></AliasName>
            XPathNavigator navigatorAliasName = navigator.SelectSingleNode("AliasName");
            if (navigatorAliasName != null) {
                this._aliasName = navigatorAliasName.Value;
            }

            // <ModelName></ModelName>
            XPathNavigator navigatorModelName = navigator.SelectSingleNode("ModelName");
            if (navigatorModelName != null) {
                this._modelName = navigatorModelName.Value;
            }

            // <GlobalIDFieldName></GlobalIDFieldName>
            XPathNavigator navigatorGlobalIDFieldName = navigator.SelectSingleNode("GlobalIDFieldName");
            if (navigatorGlobalIDFieldName != null) {
                this._globalIDFieldName = navigatorGlobalIDFieldName.Value;
            }

            // <RasterFieldName></RasterFieldName>
            XPathNavigator navigatorRasterFieldName = navigator.SelectSingleNode("RasterFieldName");
            if (navigatorRasterFieldName != null) {
                this._rasterFieldName = navigatorRasterFieldName.Value;
            }

            // <PropertySetProperty></PropertySetProperty>
            this._extensionProperties = new List<Property>();
            XPathNodeIterator interatorPropertySetProperty = navigator.Select("ExtensionProperties/PropertyArray/PropertySetProperty");
            while (interatorPropertySetProperty.MoveNext()) {
                // Get Property Note
                XPathNavigator navigatorPropertySetProperty = interatorPropertySetProperty.Current;

                // Create Property Object
                Property property = new Property(navigatorPropertySetProperty);

                // Store Property Object in List
                this._extensionProperties.Add(property);
            }

            // <SubtypeFieldName></SubtypeFieldName>
            XPathNavigator navigatorSubtypeFieldName = navigator.SelectSingleNode("SubtypeFieldName");
            if (navigatorSubtypeFieldName != null) {
                this._subtypeFieldName = navigatorSubtypeFieldName.Value;
            }

            // Create ESRI Namespace Manager
            XmlNamespaceManager namespaceManager = new XmlNamespaceManager(navigator.NameTable);
            namespaceManager.AddNamespace(Xml._XSI, Xml.XMLSCHEMAINSTANCE);

            // <ControllerMemberships><ControllerMembership></ControllerMembership></ControllerMemberships>
            this._controllerMemberships = new List<ControllerMembership>();
            XPathNodeIterator interatorControllerMembership = navigator.Select("ControllerMemberships/ControllerMembership");
            while (interatorControllerMembership.MoveNext()) {
                // Get ControllerMembership
                XPathNavigator navigatorControllerMembership = interatorControllerMembership.Current;

                // Get Type
                XPathNavigator type = navigatorControllerMembership.SelectSingleNode(Xml._XSITYPE, namespaceManager);
                switch (type.Value) {
                    case Xml._GEOMETRICNETWORKMEMBERSHIP:
                        GeometricNetworkControllerMembership geometricNetworkControllerMembership = new GeometricNetworkControllerMembership(navigatorControllerMembership);
                        this._controllerMemberships.Add(geometricNetworkControllerMembership);
                        break;
                    case Xml._TOPOLOGYMEMBERSHIP:
                        TopologyControllerMembership topologyControllerMembership = new TopologyControllerMembership(navigatorControllerMembership);
                        this._controllerMemberships.Add(topologyControllerMembership);
                        break;
                    case Xml._TERRAINMEMBERSHIP:
                        break;
                    case Xml._NETWORKDATASETMEMBERSHIP:
                        NetworkControllerMembership networkControllerMembership = new NetworkControllerMembership(navigatorControllerMembership);
                        this._controllerMemberships.Add(networkControllerMembership);
                        break;
                }
            }

            // Create Fields Group
            TableGroup tableGroupFields = new TableGroup();
            tableGroupFields.Expanded = true;
            tableGroupFields.Text = "Fields";
            this.Groups.Add(tableGroupFields);

            XPathNodeIterator interatorField = navigator.Select("Fields/FieldArray/Field");
            while (interatorField.MoveNext()) {
                // Create Field
                XPathNavigator navigatorField = interatorField.Current;
                Field field = new Field(navigatorField, this);

                // Add Field To Group
                tableGroupFields.Rows.Add(field);
            }

            // Create Indexes Group
            TableGroup tableGroupIndexes = new TableGroup();
            tableGroupIndexes.Expanded = true;
            tableGroupIndexes.Text = "Indexes";
            this.Groups.Add(tableGroupIndexes);

            XPathNodeIterator interatorIndex = navigator.Select("Indexes/IndexArray/Index");
            while (interatorIndex.MoveNext()) {
                // Add Index
                XPathNavigator navigatorIndex = interatorIndex.Current;
                Index index = new Index(navigatorIndex);
                tableGroupIndexes.Groups.Add(index);
                
                // Add Field Index
                XPathNodeIterator interatorIndexField = navigatorIndex.Select("Fields/FieldArray/Field");
                while (interatorIndexField.MoveNext()) {
                    XPathNavigator navigatorIndexField = interatorIndexField.Current;

                    IndexField indexField = new IndexField(navigatorIndexField);
                    index.Rows.Add(indexField);
                }
            }
        }
예제 #7
0
        //
        // PUBLIC METHODS
        //
        public override void OpenModel()
        {
            // Exit if invalid
            if (this._topology == null)
            {
                return;
            }

            // Suspend Model
            if (ModelSettings.Default.EnableUndoRedo)
            {
                this.UndoList.Suspend();
            }
            this.Suspend();
            this.SuspendEvents = true;

            // Add GeometricNetwork Shape
            EsriShape <Topology> shapeTopology = new EsriShape <Topology>(this._topology);

            this.Shapes.Add(base.Shapes.CreateKey(), shapeTopology);

            // Get Parent FeatureDataset
            Dataset parent = this._topology.GetParent();

            if (parent == null)
            {
                return;
            }
            FeatureDataset featureDataset = parent as FeatureDataset;

            if (featureDataset == null)
            {
                return;
            }

            // Add FeatureDataset Shape
            EsriShape <FeatureDataset> shapeFeatureDataset = new EsriShape <FeatureDataset>(featureDataset);

            this.Shapes.Add(base.Shapes.CreateKey(), shapeFeatureDataset);

            // Add all Child FeatureClasses
            foreach (Dataset dataset in featureDataset.GetChildren())
            {
                if (dataset.GetType() == typeof(FeatureClass))
                {
                    // Add FetaureClass Shape
                    FeatureClass             featureClass      = (FeatureClass)dataset;
                    EsriShape <FeatureClass> shapeFeatureClass = new EsriShape <FeatureClass>(featureClass);
                    this.Shapes.Add(base.Shapes.CreateKey(), shapeFeatureClass);

                    // Add Link
                    Arrow arrow = new Arrow();
                    arrow.BorderColor    = ModelSettings.Default.DisabledLined;
                    arrow.DrawBackground = false;
                    Line line = new Line(shapeFeatureClass, shapeFeatureDataset);
                    line.BorderColor     = ModelSettings.Default.DisabledLined;
                    line.End.AllowMove   = false;
                    line.Start.Marker    = arrow;
                    line.Start.AllowMove = false;
                    this.Lines.Add(base.Lines.CreateKey(), line);

                    foreach (ControllerMembership controllerMembership in featureClass.ControllerMemberships)
                    {
                        if (controllerMembership is TopologyControllerMembership)
                        {
                            TopologyControllerMembership topologyControllerMembership = (TopologyControllerMembership)controllerMembership;
                            if (topologyControllerMembership.TopologyName == this._topology.Name)
                            {
                                EsriLine <TopologyControllerMembership> line2 = new EsriLine <TopologyControllerMembership>(topologyControllerMembership, shapeTopology, shapeFeatureClass);
                                this.Lines.Add(base.Lines.CreateKey(), line2);
                            }
                        }
                    }
                }
            }

            // Perform Layout
            this.ExecuteLayout(typeof(HierarchicalLayout), true);

            // Resume and Refresh Model
            this.SuspendEvents = false;
            this.Resume();
            if (ModelSettings.Default.EnableUndoRedo)
            {
                this.UndoList.Resume();
            }
            this.Refresh();
        }
예제 #8
0
        private void Model_ElementInvalid(object sender, ElementEventArgs e)
        {
            // Exit if GeometricNetwork Does not Exist
            if (this._topology == null)
            {
                return;
            }

            // Get Element
            Element element = e.Value;

            if (element == null)
            {
                return;
            }
            EsriLine <TopologyControllerMembership> line = element as EsriLine <TopologyControllerMembership>;

            if (line == null)
            {
                return;
            }

            // Get Controller
            TopologyControllerMembership controller = line.Parent;

            // Suspend Rule Events
            controller.Suspend();

            // Get Start and End Elements
            Element elementStart = line.Start.Shape;
            Element elementEnd   = line.End.Shape;

            // Update GeometricNetwork Name Property
            if (elementStart == null)
            {
                controller.TopologyName = string.Empty;
            }
            else if (elementStart is EsriShape <Topology> )
            {
                EsriShape <Topology> shape    = (EsriShape <Topology>)elementStart;
                Topology             topology = shape.Parent;
                controller.TopologyName = topology.Name;
            }

            //
            DiagrammerEnvironment diagrammerEnvironment = DiagrammerEnvironment.Default;
            SchemaModel           schemaModel           = diagrammerEnvironment.SchemaModel;
            ObjectClass           objectClass           = schemaModel.FindParent(controller);

            if (objectClass != null)
            {
                objectClass.ControllerMemberships.Remove(controller);
            }

            if (elementEnd == null)
            {
            }
            else if (elementEnd is EsriShape <FeatureClass> )
            {
                EsriShape <FeatureClass> es           = (EsriShape <FeatureClass>)elementEnd;
                FeatureClass             featureClass = es.Parent;
                featureClass.ControllerMemberships.Add(controller);
            }

            // Resume Controller Events
            controller.Resume();
        }
예제 #9
0
        //
        // CONSTRUCTOR
        //
        public ObjectClass(IXPathNavigable path) : base(path)
        {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // <OIDFieldName></OIDFieldName>
            XPathNavigator navigatorOIDFieldName = navigator.SelectSingleNode("OIDFieldName");

            if (navigatorOIDFieldName != null)
            {
                this._oidFieldName = navigatorOIDFieldName.Value;
            }

            // <CLSID></CLSID>
            XPathNavigator navigatorCLSID = navigator.SelectSingleNode("CLSID");

            if (navigatorCLSID != null)
            {
                if (!string.IsNullOrEmpty(navigatorCLSID.Value))
                {
                    this._clsid = navigatorCLSID.Value;
                }
            }

            // <EXTCLSID></EXTCLSID>
            XPathNavigator navigatorEXTCLSID = navigator.SelectSingleNode("EXTCLSID");

            if (navigatorEXTCLSID != null)
            {
                if (!string.IsNullOrEmpty(navigatorEXTCLSID.Value))
                {
                    this._extClsid = navigatorEXTCLSID.Value;
                }
            }

            // <AliasName></AliasName>
            XPathNavigator navigatorAliasName = navigator.SelectSingleNode("AliasName");

            if (navigatorAliasName != null)
            {
                this._aliasName = navigatorAliasName.Value;
            }

            // <ModelName></ModelName>
            XPathNavigator navigatorModelName = navigator.SelectSingleNode("ModelName");

            if (navigatorModelName != null)
            {
                this._modelName = navigatorModelName.Value;
            }

            // <GlobalIDFieldName></GlobalIDFieldName>
            XPathNavigator navigatorGlobalIDFieldName = navigator.SelectSingleNode("GlobalIDFieldName");

            if (navigatorGlobalIDFieldName != null)
            {
                this._globalIDFieldName = navigatorGlobalIDFieldName.Value;
            }

            // <RasterFieldName></RasterFieldName>
            XPathNavigator navigatorRasterFieldName = navigator.SelectSingleNode("RasterFieldName");

            if (navigatorRasterFieldName != null)
            {
                this._rasterFieldName = navigatorRasterFieldName.Value;
            }

            // <PropertySetProperty></PropertySetProperty>
            this._extensionProperties = new List <Property>();
            XPathNodeIterator interatorPropertySetProperty = navigator.Select("ExtensionProperties/PropertyArray/PropertySetProperty");

            while (interatorPropertySetProperty.MoveNext())
            {
                // Get Property Note
                XPathNavigator navigatorPropertySetProperty = interatorPropertySetProperty.Current;

                // Create Property Object
                Property property = new Property(navigatorPropertySetProperty);

                // Store Property Object in List
                this._extensionProperties.Add(property);
            }

            // <SubtypeFieldName></SubtypeFieldName>
            XPathNavigator navigatorSubtypeFieldName = navigator.SelectSingleNode("SubtypeFieldName");

            if (navigatorSubtypeFieldName != null)
            {
                this._subtypeFieldName = navigatorSubtypeFieldName.Value;
            }

            // Create ESRI Namespace Manager
            XmlNamespaceManager namespaceManager = new XmlNamespaceManager(navigator.NameTable);

            namespaceManager.AddNamespace(Xml._XSI, Xml.XMLSCHEMAINSTANCE);

            // <ControllerMemberships><ControllerMembership></ControllerMembership></ControllerMemberships>
            this._controllerMemberships = new List <ControllerMembership>();
            XPathNodeIterator interatorControllerMembership = navigator.Select("ControllerMemberships/ControllerMembership");

            while (interatorControllerMembership.MoveNext())
            {
                // Get ControllerMembership
                XPathNavigator navigatorControllerMembership = interatorControllerMembership.Current;

                // Get Type
                XPathNavigator type = navigatorControllerMembership.SelectSingleNode(Xml._XSITYPE, namespaceManager);
                switch (type.Value)
                {
                case Xml._GEOMETRICNETWORKMEMBERSHIP:
                    GeometricNetworkControllerMembership geometricNetworkControllerMembership = new GeometricNetworkControllerMembership(navigatorControllerMembership);
                    this._controllerMemberships.Add(geometricNetworkControllerMembership);
                    break;

                case Xml._TOPOLOGYMEMBERSHIP:
                    TopologyControllerMembership topologyControllerMembership = new TopologyControllerMembership(navigatorControllerMembership);
                    this._controllerMemberships.Add(topologyControllerMembership);
                    break;

                case Xml._TERRAINMEMBERSHIP:
                    break;

                case Xml._NETWORKDATASETMEMBERSHIP:
                    NetworkControllerMembership networkControllerMembership = new NetworkControllerMembership(navigatorControllerMembership);
                    this._controllerMemberships.Add(networkControllerMembership);
                    break;
                }
            }

            // Create Fields Group
            TableGroup tableGroupFields = new TableGroup();

            tableGroupFields.Expanded = true;
            tableGroupFields.Text     = "Fields";
            this.Groups.Add(tableGroupFields);

            XPathNodeIterator interatorField = navigator.Select("Fields/FieldArray/Field");

            while (interatorField.MoveNext())
            {
                // Create Field
                XPathNavigator navigatorField = interatorField.Current;
                Field          field          = new Field(navigatorField, this);

                // Add Field To Group
                tableGroupFields.Rows.Add(field);
            }

            // Create Indexes Group
            TableGroup tableGroupIndexes = new TableGroup();

            tableGroupIndexes.Expanded = true;
            tableGroupIndexes.Text     = "Indexes";
            this.Groups.Add(tableGroupIndexes);

            XPathNodeIterator interatorIndex = navigator.Select("Indexes/IndexArray/Index");

            while (interatorIndex.MoveNext())
            {
                // Add Index
                XPathNavigator navigatorIndex = interatorIndex.Current;
                Index          index          = new Index(navigatorIndex);
                tableGroupIndexes.Groups.Add(index);

                // Add Field Index
                XPathNodeIterator interatorIndexField = navigatorIndex.Select("Fields/FieldArray/Field");
                while (interatorIndexField.MoveNext())
                {
                    XPathNavigator navigatorIndexField = interatorIndexField.Current;

                    IndexField indexField = new IndexField(navigatorIndexField);
                    index.Rows.Add(indexField);
                }
            }
        }