internal RemotePropertyDefinition(ServicePropertyDefinition mySvcPropertyDefinition, IServiceToken myServiceToken) { _ServiceToken = myServiceToken; this.IsMandatory = mySvcPropertyDefinition.IsMandatory; this.IsUserDefined = mySvcPropertyDefinition.IsUserDefined; this.IsUserDefinedType = mySvcPropertyDefinition.IsUserDefinedType; this.BaseType = Type.GetType(mySvcPropertyDefinition.BaseType); switch (mySvcPropertyDefinition.Multiplicity) { case ServicePropertyMultiplicity.Single: this.Multiplicity = PropertyMultiplicity.Single; break; case ServicePropertyMultiplicity.Set: this.Multiplicity = PropertyMultiplicity.Set; break; case ServicePropertyMultiplicity.List: this.Multiplicity = PropertyMultiplicity.List; break; } this._InIndices = mySvcPropertyDefinition.InIndices; this.DefaultValue = (IComparable)mySvcPropertyDefinition.DefaultValue; this.ID = mySvcPropertyDefinition.ID; this.Name = mySvcPropertyDefinition.Name; this.RelatedType = ConvertHelper.ToBaseType(mySvcPropertyDefinition.RelatedType, _ServiceToken); }
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); }