示例#1
0
        public static ServiceAttributeDefinition ToServiceAttributeDefinition(IAttributeDefinition myAttributeDefinition)
        {
            ServiceAttributeDefinition svcAttributeDef = null;

            if (myAttributeDefinition != null)
            {
                switch (myAttributeDefinition.Kind)
                {
                case AttributeType.Property:
                    svcAttributeDef = new ServicePropertyDefinition((IPropertyDefinition)myAttributeDefinition);
                    break;

                case AttributeType.OutgoingEdge:
                    svcAttributeDef = new ServiceOutgoingEdgeDefinition((IOutgoingEdgeDefinition)myAttributeDefinition);
                    break;

                case AttributeType.IncomingEdge:
                    svcAttributeDef = new ServiceIncomingEdgeDefinition((IIncomingEdgeDefinition)myAttributeDefinition);
                    break;

                case AttributeType.BinaryProperty:
                    svcAttributeDef = new ServiceBinaryPropertyDefinition((IBinaryPropertyDefinition)myAttributeDefinition);
                    break;
                }
            }
            return(svcAttributeDef);
        }
 internal RemoteOutgoingEdgeDefinition(ServiceOutgoingEdgeDefinition myOutgoingEdgeDefinition, IServiceToken myServiceToken)
 {
     this.EdgeType = new RemoteEdgeType(myOutgoingEdgeDefinition.EdgeType, myServiceToken);
     this.InnerEdgeType = new RemoteEdgeType(myOutgoingEdgeDefinition.InnerEdgeType, myServiceToken);
     this.Multiplicity = (EdgeMultiplicity)myOutgoingEdgeDefinition.Multiplicity;
     this.SourceVertexType = new RemoteVertexType(myOutgoingEdgeDefinition.SourceVertexType, myServiceToken);
     this.TargetVertexType = new RemoteVertexType(myOutgoingEdgeDefinition.TargetVertexType, myServiceToken);
     this.Name = myOutgoingEdgeDefinition.Name;
     this.ID = myOutgoingEdgeDefinition.ID;
     this.RelatedType = ConvertHelper.ToBaseType(myOutgoingEdgeDefinition.RelatedType, myServiceToken);
     this.IsUserDefined = myOutgoingEdgeDefinition.IsUserDefined;
 }
 internal RemoteOutgoingEdgeDefinition(ServiceOutgoingEdgeDefinition myOutgoingEdgeDefinition, IServiceToken myServiceToken)
 {
     this.EdgeType      = new RemoteEdgeType(myOutgoingEdgeDefinition.EdgeType, myServiceToken);
     this.InnerEdgeType = (myOutgoingEdgeDefinition.InnerEdgeType == null) ?
                          null : new RemoteEdgeType(myOutgoingEdgeDefinition.InnerEdgeType, myServiceToken);
     this.Multiplicity     = ConvertHelper.ToEdgeMultiplicity(myOutgoingEdgeDefinition.Multiplicity);
     this.SourceVertexType = new RemoteVertexType(myOutgoingEdgeDefinition.SourceVertexType, myServiceToken);
     this.TargetVertexType = new RemoteVertexType(myOutgoingEdgeDefinition.TargetVertexType, myServiceToken);
     this.Name             = myOutgoingEdgeDefinition.Name;
     this.ID            = myOutgoingEdgeDefinition.ID;
     this.RelatedType   = ConvertHelper.ToBaseType(myOutgoingEdgeDefinition.RelatedType, myServiceToken);
     this.IsUserDefined = myOutgoingEdgeDefinition.IsUserDefined;
 }