Ejemplo n.º 1
0
        public void VisitPrimitiveTypeReference(IEdmPrimitiveTypeReference reference)
        {
            switch (reference.PrimitiveKind())
            {
            case EdmPrimitiveTypeKind.Binary:
                this.ProcessBinaryTypeReference(reference.AsBinary());
                break;

            case EdmPrimitiveTypeKind.Decimal:
                this.ProcessDecimalTypeReference(reference.AsDecimal());
                break;

            case EdmPrimitiveTypeKind.String:
                this.ProcessStringTypeReference(reference.AsString());
                break;

            case EdmPrimitiveTypeKind.DateTimeOffset:
            case EdmPrimitiveTypeKind.Duration:
            case EdmPrimitiveTypeKind.TimeOfDay:
                this.ProcessTemporalTypeReference(reference.AsTemporal());
                break;

            case EdmPrimitiveTypeKind.Geography:
            case EdmPrimitiveTypeKind.GeographyPoint:
            case EdmPrimitiveTypeKind.GeographyLineString:
            case EdmPrimitiveTypeKind.GeographyPolygon:
            case EdmPrimitiveTypeKind.GeographyCollection:
            case EdmPrimitiveTypeKind.GeographyMultiPolygon:
            case EdmPrimitiveTypeKind.GeographyMultiLineString:
            case EdmPrimitiveTypeKind.GeographyMultiPoint:
            case EdmPrimitiveTypeKind.Geometry:
            case EdmPrimitiveTypeKind.GeometryPoint:
            case EdmPrimitiveTypeKind.GeometryLineString:
            case EdmPrimitiveTypeKind.GeometryPolygon:
            case EdmPrimitiveTypeKind.GeometryCollection:
            case EdmPrimitiveTypeKind.GeometryMultiPolygon:
            case EdmPrimitiveTypeKind.GeometryMultiLineString:
            case EdmPrimitiveTypeKind.GeometryMultiPoint:
                this.ProcessSpatialTypeReference(reference.AsSpatial());
                break;

            case EdmPrimitiveTypeKind.Boolean:
            case EdmPrimitiveTypeKind.Byte:
            case EdmPrimitiveTypeKind.Double:
            case EdmPrimitiveTypeKind.Guid:
            case EdmPrimitiveTypeKind.Int16:
            case EdmPrimitiveTypeKind.Int32:
            case EdmPrimitiveTypeKind.Int64:
            case EdmPrimitiveTypeKind.SByte:
            case EdmPrimitiveTypeKind.Single:
            case EdmPrimitiveTypeKind.Stream:
            case EdmPrimitiveTypeKind.Date:
            case EdmPrimitiveTypeKind.None:
                this.ProcessPrimitiveTypeReference(reference);
                break;

            default:
                throw new InvalidOperationException(Edm.Strings.UnknownEnumVal_PrimitiveKind(reference.PrimitiveKind().ToString()));
            }
        }
        private static void AppendFacets(this StringBuilder sb, IEdmPrimitiveTypeReference type)
        {
            switch (type.PrimitiveKind())
            {
            case EdmPrimitiveTypeKind.Binary:
                sb.AppendBinaryFacets(type.AsBinary());
                break;

            case EdmPrimitiveTypeKind.Decimal:
                sb.AppendDecimalFacets(type.AsDecimal());
                break;

            case EdmPrimitiveTypeKind.String:
                sb.AppendStringFacets(type.AsString());
                break;

            case EdmPrimitiveTypeKind.Time:
            case EdmPrimitiveTypeKind.DateTime:
            case EdmPrimitiveTypeKind.DateTimeOffset:
                sb.AppendTemporalFacets(type.AsTemporal());
                break;

            case EdmPrimitiveTypeKind.Geography:
            case EdmPrimitiveTypeKind.GeographyPoint:
            case EdmPrimitiveTypeKind.GeographyLineString:
            case EdmPrimitiveTypeKind.GeographyPolygon:
            case EdmPrimitiveTypeKind.GeographyCollection:
            case EdmPrimitiveTypeKind.GeographyMultiPolygon:
            case EdmPrimitiveTypeKind.GeographyMultiLineString:
            case EdmPrimitiveTypeKind.GeographyMultiPoint:
            case EdmPrimitiveTypeKind.Geometry:
            case EdmPrimitiveTypeKind.GeometryPoint:
            case EdmPrimitiveTypeKind.GeometryLineString:
            case EdmPrimitiveTypeKind.GeometryPolygon:
            case EdmPrimitiveTypeKind.GeometryCollection:
            case EdmPrimitiveTypeKind.GeometryMultiPolygon:
            case EdmPrimitiveTypeKind.GeometryMultiLineString:
            case EdmPrimitiveTypeKind.GeometryMultiPoint:
                sb.AppendSpatialFacets(type.AsSpatial());
                break;
            }
        }
 private static void AppendFacets(this StringBuilder sb, IEdmPrimitiveTypeReference type)
 {
     switch (type.PrimitiveKind())
     {
         case EdmPrimitiveTypeKind.Binary:
             sb.AppendBinaryFacets(type.AsBinary());
             break;
         case EdmPrimitiveTypeKind.Decimal:
             sb.AppendDecimalFacets(type.AsDecimal());
             break;
         case EdmPrimitiveTypeKind.String:
             sb.AppendStringFacets(type.AsString());
             break;
         case EdmPrimitiveTypeKind.Time:
         case EdmPrimitiveTypeKind.DateTime:
         case EdmPrimitiveTypeKind.DateTimeOffset:
             sb.AppendTemporalFacets(type.AsTemporal());
             break;
         case EdmPrimitiveTypeKind.Geography:
         case EdmPrimitiveTypeKind.GeographyPoint:
         case EdmPrimitiveTypeKind.GeographyLineString:
         case EdmPrimitiveTypeKind.GeographyPolygon:
         case EdmPrimitiveTypeKind.GeographyCollection:
         case EdmPrimitiveTypeKind.GeographyMultiPolygon:
         case EdmPrimitiveTypeKind.GeographyMultiLineString:
         case EdmPrimitiveTypeKind.GeographyMultiPoint:
         case EdmPrimitiveTypeKind.Geometry:
         case EdmPrimitiveTypeKind.GeometryPoint:
         case EdmPrimitiveTypeKind.GeometryLineString:
         case EdmPrimitiveTypeKind.GeometryPolygon:
         case EdmPrimitiveTypeKind.GeometryCollection:
         case EdmPrimitiveTypeKind.GeometryMultiPolygon:
         case EdmPrimitiveTypeKind.GeometryMultiLineString:
         case EdmPrimitiveTypeKind.GeometryMultiPoint:
             sb.AppendSpatialFacets(type.AsSpatial());
             break;
     }
 }
        private static void AppendFacets(this StringBuilder sb, IEdmPrimitiveTypeReference type)
        {
            EdmPrimitiveTypeKind edmPrimitiveTypeKind = type.PrimitiveKind();

            switch (edmPrimitiveTypeKind)
            {
            case EdmPrimitiveTypeKind.Binary:
            {
                sb.AppendBinaryFacets(type.AsBinary());
                return;
            }

            case EdmPrimitiveTypeKind.Boolean:
            case EdmPrimitiveTypeKind.Byte:
            case EdmPrimitiveTypeKind.Double:
            case EdmPrimitiveTypeKind.Guid:
            case EdmPrimitiveTypeKind.Int16:
            case EdmPrimitiveTypeKind.Int32:
            case EdmPrimitiveTypeKind.Int64:
            case EdmPrimitiveTypeKind.SByte:
            case EdmPrimitiveTypeKind.Single:
            case EdmPrimitiveTypeKind.Stream:
            {
                return;
            }

            case EdmPrimitiveTypeKind.DateTime:
            case EdmPrimitiveTypeKind.DateTimeOffset:
            case EdmPrimitiveTypeKind.Time:
            {
                sb.AppendTemporalFacets(type.AsTemporal());
                return;
            }

            case EdmPrimitiveTypeKind.Decimal:
            {
                sb.AppendDecimalFacets(type.AsDecimal());
                return;
            }

            case EdmPrimitiveTypeKind.String:
            {
                sb.AppendStringFacets(type.AsString());
                return;
            }

            case EdmPrimitiveTypeKind.Geography:
            case EdmPrimitiveTypeKind.GeographyPoint:
            case EdmPrimitiveTypeKind.GeographyLineString:
            case EdmPrimitiveTypeKind.GeographyPolygon:
            case EdmPrimitiveTypeKind.GeographyCollection:
            case EdmPrimitiveTypeKind.GeographyMultiPolygon:
            case EdmPrimitiveTypeKind.GeographyMultiLineString:
            case EdmPrimitiveTypeKind.GeographyMultiPoint:
            case EdmPrimitiveTypeKind.Geometry:
            case EdmPrimitiveTypeKind.GeometryPoint:
            case EdmPrimitiveTypeKind.GeometryLineString:
            case EdmPrimitiveTypeKind.GeometryPolygon:
            case EdmPrimitiveTypeKind.GeometryCollection:
            case EdmPrimitiveTypeKind.GeometryMultiPolygon:
            case EdmPrimitiveTypeKind.GeometryMultiLineString:
            case EdmPrimitiveTypeKind.GeometryMultiPoint:
            {
                sb.AppendSpatialFacets(type.AsSpatial());
                return;
            }

            default:
            {
                return;
            }
            }
        }
Ejemplo n.º 5
0
		private static void AppendFacets(this StringBuilder sb, IEdmPrimitiveTypeReference type)
		{
			EdmPrimitiveTypeKind edmPrimitiveTypeKind = type.PrimitiveKind();
			switch (edmPrimitiveTypeKind)
			{
				case EdmPrimitiveTypeKind.Binary:
				{
					sb.AppendBinaryFacets(type.AsBinary());
					return;
				}
				case EdmPrimitiveTypeKind.Boolean:
				case EdmPrimitiveTypeKind.Byte:
				case EdmPrimitiveTypeKind.Double:
				case EdmPrimitiveTypeKind.Guid:
				case EdmPrimitiveTypeKind.Int16:
				case EdmPrimitiveTypeKind.Int32:
				case EdmPrimitiveTypeKind.Int64:
				case EdmPrimitiveTypeKind.SByte:
				case EdmPrimitiveTypeKind.Single:
				case EdmPrimitiveTypeKind.Stream:
				{
					return;
				}
				case EdmPrimitiveTypeKind.DateTime:
				case EdmPrimitiveTypeKind.DateTimeOffset:
				case EdmPrimitiveTypeKind.Time:
				{
					sb.AppendTemporalFacets(type.AsTemporal());
					return;
				}
				case EdmPrimitiveTypeKind.Decimal:
				{
					sb.AppendDecimalFacets(type.AsDecimal());
					return;
				}
				case EdmPrimitiveTypeKind.String:
				{
					sb.AppendStringFacets(type.AsString());
					return;
				}
				case EdmPrimitiveTypeKind.Geography:
				case EdmPrimitiveTypeKind.GeographyPoint:
				case EdmPrimitiveTypeKind.GeographyLineString:
				case EdmPrimitiveTypeKind.GeographyPolygon:
				case EdmPrimitiveTypeKind.GeographyCollection:
				case EdmPrimitiveTypeKind.GeographyMultiPolygon:
				case EdmPrimitiveTypeKind.GeographyMultiLineString:
				case EdmPrimitiveTypeKind.GeographyMultiPoint:
				case EdmPrimitiveTypeKind.Geometry:
				case EdmPrimitiveTypeKind.GeometryPoint:
				case EdmPrimitiveTypeKind.GeometryLineString:
				case EdmPrimitiveTypeKind.GeometryPolygon:
				case EdmPrimitiveTypeKind.GeometryCollection:
				case EdmPrimitiveTypeKind.GeometryMultiPolygon:
				case EdmPrimitiveTypeKind.GeometryMultiLineString:
				case EdmPrimitiveTypeKind.GeometryMultiPoint:
				{
					sb.AppendSpatialFacets(type.AsSpatial());
					return;
				}
				default:
				{
					return;
				}
			}
		}