Пример #1
0
 IRelationshipClass IFeatureWorkspace.CreateRelationshipClass(
     string relClassName, IObjectClass originClass, IObjectClass destinationClass,
     string forwardLabel, string backwardLabel,
     esriRelCardinality cardinality, esriRelNotification notification, bool isComposite,
     bool isAttributed, IFields relAttrFields, string originPrimaryKey,
     string destPrimaryKey, string originForeignKey, string destForeignKey)
 {
     throw new NotImplementedException();
 }
 public RelationshipClass(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     this._cardinality           = (esriRelCardinality)Enum.Parse(typeof(esriRelCardinality), info.GetString(RelationshipClass.CARDINALITY), true);
     this._notification          = (esriRelNotification)Enum.Parse(typeof(esriRelNotification), info.GetString(RelationshipClass.NOTIFICATION), true);
     this._isComposite           = info.GetBoolean(RelationshipClass.ISCOMPOSITE);
     this._originClassNames      = info.GetString(RelationshipClass.ORIGINCLASSNAMES);
     this._destinationClassNames = info.GetString(RelationshipClass.DESTINATIONCLASSNAMES);
     this._keyType            = (esriRelKeyType)Enum.Parse(typeof(esriRelKeyType), info.GetString(RelationshipClass.KEYTYPE), true);
     this._classKey           = (esriRelClassKey)Enum.Parse(typeof(esriRelClassKey), info.GetString(RelationshipClass.CLASSKEY), true);
     this._forwardPathLabel   = info.GetString(RelationshipClass.FORWARDPATHLABEL);
     this._backwardPathLabel  = info.GetString(RelationshipClass.BACKWARDPATHLABEL);
     this._isReflexive        = info.GetBoolean(RelationshipClass.ISREFLEXIVE);
     this._originPrimary      = info.GetString(RelationshipClass.ORIGINPRIMARY);
     this._originForeign      = info.GetString(RelationshipClass.ORIGINFOREIGN);
     this._destinationPrimary = info.GetString(RelationshipClass.DESTINATIONPRIMARY);
     this._destinationForeign = info.GetString(RelationshipClass.DESTINATIONFOREIGN);
     this._relationshipRules  = (List <RelationshipRule>)info.GetValue(RelationshipClass.RELATIONSHIPRULES, typeof(List <RelationshipRule>));
 }
Пример #3
0
 public IRelationshipClass CreateRelationshipClass(string relClassName,
                                                   IObjectClass OriginClass,
                                                   IObjectClass DestinationClass,
                                                   string forwardLabel,
                                                   string backwardLabel,
                                                   esriRelCardinality Cardinality,
                                                   esriRelNotification
                                                   Notification,
                                                   bool IsComposite,
                                                   bool IsAttributed,
                                                   IFields relAttrFields,
                                                   string OriginPrimaryKey,
                                                   string destPrimaryKey,
                                                   string OriginForeignKey,
                                                   string destForeignKey)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 private static void old_acctor_mc()
 {
     m_pFeatureDataset = null;
     m_pWorkspace      = null;
     relClassName      = "";
     OriginClass       = null;
     DestinationClass  = null;
     forwardLabel      = "";
     backwardLabel     = "";
     Cardinality       = esriRelCardinality.esriRelCardinalityOneToOne;
     Notification      = esriRelNotification.esriRelNotificationNone;
     IsComposite       = false;
     IsAttributed      = false;
     relAttrFields     = new FieldsClass();
     OriginPrimaryKey  = "";
     destPrimaryKey    = "";
     OriginForeignKey  = "";
     destForeignKey    = "";
 }
        public RelationshipClass(RelationshipClass prototype) : base(prototype)
        {
            this._cardinality           = prototype.Cardinality;
            this._notification          = prototype.Notification;
            this._isComposite           = prototype.IsComposite;
            this._originClassNames      = prototype.OriginClassName;
            this._destinationClassNames = prototype.DestinationClassName;
            this._keyType            = prototype.KeyType;
            this._classKey           = prototype.ClassKey;
            this._forwardPathLabel   = prototype.ForwardPathLabel;
            this._backwardPathLabel  = prototype.BackwardPathLabel;
            this._isReflexive        = prototype.IsReflexive;
            this._originPrimary      = prototype.OriginPrimary;
            this._originForeign      = prototype.OriginForeign;
            this._destinationPrimary = prototype.DestinationPrimary;
            this._destinationForeign = prototype.DestinationForeign;

            // Add Cloned Relationship Rules
            this._relationshipRules = new List <RelationshipRule>();
            foreach (RelationshipRule relationshipRule in prototype.RelationshipRules)
            {
                this._relationshipRules.Add((RelationshipRule)relationshipRule.Clone());
            }
        }
        //
        // CONSTRUCTOR
        //
        public RelationshipClass(IXPathNavigable path) : base(path)
        {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // Get Model
            SchemaModel model = (SchemaModel)base.Container;

            // <Cardinality></Cardinality>
            XPathNavigator navigatorCardinality = navigator.SelectSingleNode(Xml.CARDINALITY);

            if (navigatorCardinality != null)
            {
                this._cardinality = (esriRelCardinality)Enum.Parse(typeof(esriRelCardinality), navigatorCardinality.Value, true);
            }

            // <Notification></Notification>
            XPathNavigator navigatorNotification = navigator.SelectSingleNode(Xml.NOTIFICATION);

            if (navigatorNotification != null)
            {
                this._notification = (esriRelNotification)Enum.Parse(typeof(esriRelNotification), navigatorNotification.Value, true);
            }

            // <IsComposite>false</IsComposite>
            XPathNavigator navigatorIsComposite = navigator.SelectSingleNode(Xml.ISCOMPOSITE);

            if (navigatorIsComposite != null)
            {
                this._isComposite = navigatorIsComposite.ValueAsBoolean;
            }

            // <OriginClassNames></OriginClassNames>
            XPathNavigator navigatorOriginClassNames = navigator.SelectSingleNode(string.Format("{0}/{1}", Xml.ORIGINCLASSNAMES, Xml.NAME)); //  "OriginClassNames/Name");

            if (navigatorOriginClassNames != null)
            {
                this._originClassNames = navigatorOriginClassNames.Value;
            }

            // <DestinationClassNames></DestinationClassNames>
            XPathNavigator navigatorDestinationClassNames = navigator.SelectSingleNode(string.Format("{0}/{1}", Xml.DESTINATIONCLASSNAMES, Xml.NAME)); //"DestinationClassNames/Name");

            if (navigatorDestinationClassNames != null)
            {
                this._destinationClassNames = navigatorDestinationClassNames.Value;
            }

            // <KeyType></KeyType>
            XPathNavigator navigatorKeyType = navigator.SelectSingleNode(Xml.KEYTYPE);

            if (navigatorKeyType != null)
            {
                this._keyType = (esriRelKeyType)Enum.Parse(typeof(esriRelKeyType), navigatorKeyType.Value, true);
            }

            // <ClassKey></ClassKey>
            XPathNavigator navigatorClassKey = navigator.SelectSingleNode(Xml.CLASSKEY);

            if (navigatorClassKey != null)
            {
                this._classKey = (esriRelClassKey)Enum.Parse(typeof(esriRelClassKey), navigatorClassKey.Value, true);
            }

            // <ForwardPathLabel></ForwardPathLabel>
            XPathNavigator navigatorForwardPathLabel = navigator.SelectSingleNode(Xml.FORWARDPATHLABEL);

            if (navigatorForwardPathLabel != null)
            {
                this._forwardPathLabel = navigatorForwardPathLabel.Value;
            }

            // <BackwardPathLabel></BackwardPathLabel>
            XPathNavigator navigatorBackwardPathLabel = navigator.SelectSingleNode(Xml.BACKWARDPATHLABEL);

            if (navigatorBackwardPathLabel != null)
            {
                this._backwardPathLabel = navigatorBackwardPathLabel.Value;
            }

            // <IsReflexive></IsReflexive>
            XPathNavigator navigatorIsReflexive = navigator.SelectSingleNode(Xml.ISREFLEXIVE);

            if (navigatorIsReflexive != null)
            {
                this._isReflexive = navigatorIsReflexive.ValueAsBoolean;
            }

            // <OriginClassKeys><RelationshipClassKey></RelationshipClassKey></OriginClassKeys>
            // <DestinationClassKeys><RelationshipClassKey></RelationshipClassKey></DestinationClassKeys>
            string            xpath = string.Format("{0}/{2} | {1}/{2}", Xml.ORIGINCLASSKEYS, Xml.DESTINATIONCLASSKEYS, Xml.RELATIONSHIPCLASSKEY);
            XPathNodeIterator interatorClassKeys = navigator.Select(xpath); // "OriginClassKeys/RelationshipClassKey | DestinationClassKeys/RelationshipClassKey");

            while (interatorClassKeys.MoveNext())
            {
                // Get <RelationshipClassKey>
                XPathNavigator navigatorClassKeys = interatorClassKeys.Current;

                // Get <KeyRole>
                XPathNavigator navigatorKeyRole = navigatorClassKeys.SelectSingleNode(Xml.KEYROLE);
                if (navigatorKeyRole == null)
                {
                    continue;
                }
                if (string.IsNullOrEmpty(navigatorKeyRole.Value))
                {
                    continue;
                }
                string keyRole = navigatorKeyRole.Value;

                // Get <ObjectKeyName>
                XPathNavigator navigatorObjectKeyName = navigatorClassKeys.SelectSingleNode(Xml.OBJECTKEYNAME);
                if (navigatorObjectKeyName == null)
                {
                    continue;
                }

                // Set Relationship Keys
                if (keyRole == esriRelKeyRole.esriRelKeyRoleOriginPrimary.ToString())
                {
                    this._originPrimary = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleOriginForeign.ToString())
                {
                    this._originForeign = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleDestinationPrimary.ToString())
                {
                    this._destinationPrimary = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleDestinationForeign.ToString())
                {
                    this._destinationForeign = navigatorObjectKeyName.Value;
                }
            }

            // <RelationshipRules><RelationshipRule></RelationshipRule></RelationshipRules>
            this._relationshipRules = new List <RelationshipRule>();
            XPathNodeIterator interatorRelationshipRule = navigator.Select(string.Format("{0}/{1}", Xml.RELATIONSHIPRULES, Xml.RELATIONSHIPRULE)); // "RelationshipRules/RelationshipRule");

            while (interatorRelationshipRule.MoveNext())
            {
                // Get <RelationshipRule>
                XPathNavigator navigatorRelationshipRule = interatorRelationshipRule.Current;

                // Create Relationship Rule
                RelationshipRule relationshipRule = new RelationshipRule(navigatorRelationshipRule);

                // Add Rule to Collection
                this._relationshipRules.Add(relationshipRule);
            }
        }
Пример #7
0
 public IRelationshipClass CreateRelationshipClass(string relClassName, IObjectClass OriginClass, IObjectClass DestinationClass, string forwardLabel, string backwardLabel, esriRelCardinality Cardinality, esriRelNotification Notification, bool IsComposite, bool IsAttributed, IFields relAttrFields, string OriginPrimaryKey, string destPrimaryKey, string OriginForeignKey, string destForeignKey)
 {
     // I don't think this needs to be implemented for now.
     throw new NotImplementedException();
 }
        public RelationshipClass(RelationshipClass prototype) : base(prototype) {
            this._cardinality = prototype.Cardinality;
            this._notification = prototype.Notification;
            this._isComposite = prototype.IsComposite;
            this._originClassNames = prototype.OriginClassName;
            this._destinationClassNames = prototype.DestinationClassName;
            this._keyType = prototype.KeyType;
            this._classKey = prototype.ClassKey;
            this._forwardPathLabel = prototype.ForwardPathLabel;
            this._backwardPathLabel = prototype.BackwardPathLabel;
            this._isReflexive = prototype.IsReflexive;
            this._originPrimary = prototype.OriginPrimary;
            this._originForeign = prototype.OriginForeign;
            this._destinationPrimary = prototype.DestinationPrimary;
            this._destinationForeign = prototype.DestinationForeign;

            // Add Cloned Relationship Rules
            this._relationshipRules = new List<RelationshipRule>();
            foreach (RelationshipRule relationshipRule in prototype.RelationshipRules) {
                this._relationshipRules.Add((RelationshipRule)relationshipRule.Clone());
            }
        }
 public RelationshipClass(SerializationInfo info, StreamingContext context) : base(info, context) {
     this._cardinality = (esriRelCardinality)Enum.Parse(typeof(esriRelCardinality), info.GetString(RelationshipClass.CARDINALITY), true);
     this._notification = (esriRelNotification)Enum.Parse(typeof(esriRelNotification), info.GetString(RelationshipClass.NOTIFICATION), true);
     this._isComposite = info.GetBoolean(RelationshipClass.ISCOMPOSITE);
     this._originClassNames = info.GetString(RelationshipClass.ORIGINCLASSNAMES);
     this._destinationClassNames = info.GetString(RelationshipClass.DESTINATIONCLASSNAMES);
     this._keyType = (esriRelKeyType)Enum.Parse(typeof(esriRelKeyType), info.GetString(RelationshipClass.KEYTYPE), true);
     this._classKey = (esriRelClassKey)Enum.Parse(typeof(esriRelClassKey), info.GetString(RelationshipClass.CLASSKEY), true);
     this._forwardPathLabel = info.GetString(RelationshipClass.FORWARDPATHLABEL);
     this._backwardPathLabel = info.GetString(RelationshipClass.BACKWARDPATHLABEL);
     this._isReflexive = info.GetBoolean(RelationshipClass.ISREFLEXIVE);
     this._originPrimary = info.GetString(RelationshipClass.ORIGINPRIMARY);
     this._originForeign = info.GetString(RelationshipClass.ORIGINFOREIGN);
     this._destinationPrimary = info.GetString(RelationshipClass.DESTINATIONPRIMARY);
     this._destinationForeign = info.GetString(RelationshipClass.DESTINATIONFOREIGN);
     this._relationshipRules = (List<RelationshipRule>)info.GetValue(RelationshipClass.RELATIONSHIPRULES, typeof(List<RelationshipRule>));
 }
        //
        // CONSTRUCTOR
        //
        public RelationshipClass(IXPathNavigable path) : base(path) {
            // Get Navigator
            XPathNavigator navigator = path.CreateNavigator();

            // Get Model
            SchemaModel model = (SchemaModel)base.Container;

            // <Cardinality></Cardinality>
            XPathNavigator navigatorCardinality = navigator.SelectSingleNode(Xml.CARDINALITY);
            if (navigatorCardinality != null) {
                this._cardinality = (esriRelCardinality)Enum.Parse(typeof(esriRelCardinality), navigatorCardinality.Value, true);
            }

            // <Notification></Notification> 
            XPathNavigator navigatorNotification = navigator.SelectSingleNode(Xml.NOTIFICATION);
            if (navigatorNotification != null) {
                this._notification = (esriRelNotification)Enum.Parse(typeof(esriRelNotification), navigatorNotification.Value, true);
            }

            // <IsComposite>false</IsComposite> 
            XPathNavigator navigatorIsComposite = navigator.SelectSingleNode(Xml.ISCOMPOSITE);
            if (navigatorIsComposite != null) {
                this._isComposite = navigatorIsComposite.ValueAsBoolean;
            }

            // <OriginClassNames></OriginClassNames>
            XPathNavigator navigatorOriginClassNames = navigator.SelectSingleNode(string.Format("{0}/{1}", Xml.ORIGINCLASSNAMES, Xml.NAME)); //  "OriginClassNames/Name");
            if (navigatorOriginClassNames != null) {
                this._originClassNames = navigatorOriginClassNames.Value;
            }

            // <DestinationClassNames></DestinationClassNames>
            XPathNavigator navigatorDestinationClassNames = navigator.SelectSingleNode(string.Format("{0}/{1}", Xml.DESTINATIONCLASSNAMES, Xml.NAME)); //"DestinationClassNames/Name");
            if (navigatorDestinationClassNames != null) {
                this._destinationClassNames = navigatorDestinationClassNames.Value;
            }

            // <KeyType></KeyType> 
            XPathNavigator navigatorKeyType = navigator.SelectSingleNode(Xml.KEYTYPE);
            if (navigatorKeyType != null) {
                this._keyType = (esriRelKeyType)Enum.Parse(typeof(esriRelKeyType), navigatorKeyType.Value, true);
            }

            // <ClassKey></ClassKey> 
            XPathNavigator navigatorClassKey = navigator.SelectSingleNode(Xml.CLASSKEY);
            if (navigatorClassKey != null) {
                this._classKey = (esriRelClassKey)Enum.Parse(typeof(esriRelClassKey), navigatorClassKey.Value, true);
            }

            // <ForwardPathLabel></ForwardPathLabel> 
            XPathNavigator navigatorForwardPathLabel = navigator.SelectSingleNode(Xml.FORWARDPATHLABEL);
            if (navigatorForwardPathLabel != null) {
                this._forwardPathLabel = navigatorForwardPathLabel.Value;
            }

            // <BackwardPathLabel></BackwardPathLabel> 
            XPathNavigator navigatorBackwardPathLabel = navigator.SelectSingleNode(Xml.BACKWARDPATHLABEL);
            if (navigatorBackwardPathLabel != null) {
                this._backwardPathLabel = navigatorBackwardPathLabel.Value;
            }

            // <IsReflexive></IsReflexive>
            XPathNavigator navigatorIsReflexive = navigator.SelectSingleNode(Xml.ISREFLEXIVE);
            if (navigatorIsReflexive != null) {
                this._isReflexive = navigatorIsReflexive.ValueAsBoolean;
            }

            // <OriginClassKeys><RelationshipClassKey></RelationshipClassKey></OriginClassKeys>
            // <DestinationClassKeys><RelationshipClassKey></RelationshipClassKey></DestinationClassKeys>
            string xpath = string.Format("{0}/{2} | {1}/{2}", Xml.ORIGINCLASSKEYS, Xml.DESTINATIONCLASSKEYS, Xml.RELATIONSHIPCLASSKEY);
            XPathNodeIterator interatorClassKeys = navigator.Select(xpath); // "OriginClassKeys/RelationshipClassKey | DestinationClassKeys/RelationshipClassKey");
            while (interatorClassKeys.MoveNext()) {
                // Get <RelationshipClassKey>
                XPathNavigator navigatorClassKeys = interatorClassKeys.Current;

                // Get <KeyRole>
                XPathNavigator navigatorKeyRole = navigatorClassKeys.SelectSingleNode(Xml.KEYROLE);
                if (navigatorKeyRole == null){continue;}
                if (string.IsNullOrEmpty(navigatorKeyRole.Value)){continue;}
                string keyRole = navigatorKeyRole.Value;

                // Get <ObjectKeyName>
                XPathNavigator navigatorObjectKeyName = navigatorClassKeys.SelectSingleNode(Xml.OBJECTKEYNAME);
                if (navigatorObjectKeyName == null){continue;}

                // Set Relationship Keys
                if (keyRole == esriRelKeyRole.esriRelKeyRoleOriginPrimary.ToString()){
                    this._originPrimary = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleOriginForeign.ToString()){
                    this._originForeign = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleDestinationPrimary.ToString()){
                    this._destinationPrimary = navigatorObjectKeyName.Value;
                }
                else if (keyRole == esriRelKeyRole.esriRelKeyRoleDestinationForeign.ToString()){
                    this._destinationForeign = navigatorObjectKeyName.Value;
                }
            }

            // <RelationshipRules><RelationshipRule></RelationshipRule></RelationshipRules>
            this._relationshipRules = new List<RelationshipRule>();
            XPathNodeIterator interatorRelationshipRule = navigator.Select(string.Format("{0}/{1}", Xml.RELATIONSHIPRULES, Xml.RELATIONSHIPRULE)); // "RelationshipRules/RelationshipRule");
            while (interatorRelationshipRule.MoveNext()) {
                // Get <RelationshipRule>
                XPathNavigator navigatorRelationshipRule = interatorRelationshipRule.Current;

                // Create Relationship Rule
                RelationshipRule relationshipRule = new RelationshipRule(navigatorRelationshipRule);

                // Add Rule to Collection
                this._relationshipRules.Add(relationshipRule);
            }
        }