Example #1
0
 internal ResourceAssociationType(string name, string namespaceName, ResourceAssociationTypeEnd end1, ResourceAssociationTypeEnd end2)
 {
     this.name          = name;
     this.namespaceName = namespaceName;
     this.fullName      = namespaceName + "." + name;
     this.end1          = end1;
     this.end2          = end2;
 }
Example #2
0
 internal ResourceAssociationType(string name, string namespaceName, ResourceAssociationTypeEnd end1, ResourceAssociationTypeEnd end2)
 {
     this.name = name;
     this.namespaceName = namespaceName;
     this.fullName = namespaceName + "." + name;
     this.end1 = end1;
     this.end2 = end2;
 }
Example #3
0
        /// <summary>
        /// Creates a new instance of AssociationInfo to store information about an association.
        /// </summary>
        /// <param name="name">name of the association.</param>
        /// <param name="namespaceName">namespaceName of the association.</param>
        /// <param name="end1">first end of the association.</param>
        /// <param name="end2">second end of the association.</param>
        internal ResourceAssociationType(string name, string namespaceName, ResourceAssociationTypeEnd end1, ResourceAssociationTypeEnd end2)
        {
            Debug.Assert(!String.IsNullOrEmpty(name), "!String.IsNullOrEmpty(name)");
            Debug.Assert(end1 != null && end2 != null, "end1 != null && end2 != null");

            this.name = name;
            this.fullName = namespaceName + "." + name;
            this.end1 = end1;
            this.end2 = end2;
        }
        /// <summary>
        /// Creates a new instance of AssociationInfo to store information about an association.
        /// </summary>
        /// <param name="name">name of the association.</param>
        /// <param name="namespaceName">namespaceName of the association.</param>
        /// <param name="end1">first end of the association.</param>
        /// <param name="end2">second end of the association.</param>
        internal ResourceAssociationType(string name, string namespaceName, ResourceAssociationTypeEnd end1, ResourceAssociationTypeEnd end2)
        {
            Debug.Assert(!String.IsNullOrEmpty(name), "!String.IsNullOrEmpty(name)");
            Debug.Assert(end1 != null && end2 != null, "end1 != null && end2 != null");

            this.name     = name;
            this.fullName = namespaceName + "." + name;
            this.end1     = end1;
            this.end2     = end2;
        }
Example #5
0
        internal ResourceAssociationTypeEnd GetRelatedResourceAssociationSetEnd(ResourceType resourceType, ResourceProperty resourceProperty)
        {
            ResourceAssociationTypeEnd resourceAssociationTypeEnd = this.GetResourceAssociationTypeEnd(resourceType, resourceProperty);

            if (resourceAssociationTypeEnd != null)
            {
                foreach (ResourceAssociationTypeEnd end2 in new ResourceAssociationTypeEnd[] { this.end1, this.end2 })
                {
                    if (end2 != resourceAssociationTypeEnd)
                    {
                        return(end2);
                    }
                }
            }
            return(null);
        }
        /// <summary>
        /// Retrieve the related end for the given resource set, type and property.
        /// </summary>
        /// <param name="resourceType">resource type for the source end</param>
        /// <param name="resourceProperty">resource property for the source end</param>
        /// <returns>Related association type end for the given parameters</returns>
        internal ResourceAssociationTypeEnd GetRelatedResourceAssociationSetEnd(ResourceType resourceType, ResourceProperty resourceProperty)
        {
            Debug.Assert(resourceType != null, "resourceType != null");

            ResourceAssociationTypeEnd thisEnd = this.GetResourceAssociationTypeEnd(resourceType, resourceProperty);

            if (thisEnd != null)
            {
                foreach (ResourceAssociationTypeEnd end in new[] { this.end1, this.end2 })
                {
                    if (end != thisEnd)
                    {
                        return(end);
                    }
                }
            }

            return(null);
        }
Example #7
0
 /// <summary>
 /// Writes the metadata for association set end.
 /// </summary>
 /// <param name="xmlWriter">xmlWriter in which metadata needs to be written</param>
 /// <param name="associationSetEnd">association set end to be written.</param>
 /// <param name="associationTypeEnd">corresponding association type end</param>
 private static void WriteAssociationSetEnd(XmlWriter xmlWriter, ResourceAssociationSetEnd associationSetEnd, ResourceAssociationTypeEnd associationTypeEnd)
 {
     xmlWriter.WriteStartElement(XmlConstants.End);
     xmlWriter.WriteAttributeString(XmlConstants.Role, associationTypeEnd.Name);
     xmlWriter.WriteAttributeString(XmlConstants.EntitySet, associationSetEnd.ResourceSet.Name);
     xmlWriter.WriteEndElement();
 }
 internal ResourceReferentialConstraint(ResourceAssociationTypeEnd principalEnd, IEnumerable <ResourceProperty> dependentProperties)
 {
     this.PrincipalEnd        = principalEnd;
     this.DependentProperties = dependentProperties;
 }
 internal ResourceReferentialConstraint(ResourceAssociationTypeEnd principalEnd, IEnumerable<ResourceProperty> dependentProperties)
 {
     this.PrincipalEnd = principalEnd;
     this.DependentProperties = dependentProperties;
 }