コード例 #1
0
ファイル: UnresolvedType.cs プロジェクト: nickchal/pash
		public UnresolvedType(string qualifiedName, EdmLocation location)
			: base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedType, Strings.Bad_UnresolvedType(qualifiedName)) })
		{
			string str = qualifiedName;
			string empty = str;
			if (str == null)
			{
				empty = string.Empty;
			}
			qualifiedName = empty;
			EdmUtil.TryGetNamespaceNameFromQualifiedName(qualifiedName, out this.namespaceName, out this.name);
		}
コード例 #2
0
ファイル: UnresolvedFunction.cs プロジェクト: nickchal/pash
		public UnresolvedFunction(string qualifiedName, string errorMessage, EdmLocation location)
			: base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedFunction, errorMessage) })
		{
			string str = qualifiedName;
			string empty = str;
			if (str == null)
			{
				empty = string.Empty;
			}
			qualifiedName = empty;
			EdmUtil.TryGetNamespaceNameFromQualifiedName(qualifiedName, out this.namespaceName, out this.name);
			this.returnType = new BadTypeReference(new BadType(base.Errors), true);
		}
コード例 #3
0
ファイル: UnresolvedParameter.cs プロジェクト: nickchal/pash
		public UnresolvedParameter(IEdmFunctionBase declaringFunction, string name, EdmLocation location)
			: base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedParameter, Strings.Bad_UnresolvedParameter(name)) })
		{
			this.type = new Cache<UnresolvedParameter, IEdmTypeReference>();
			string str = name;
			string empty = str;
			if (str == null)
			{
				empty = string.Empty;
			}
			this.name = empty;
			this.declaringFunction = declaringFunction;
		}
コード例 #4
0
ファイル: UnresolvedEnumMember.cs プロジェクト: nickchal/pash
		public UnresolvedEnumMember(string name, IEdmEnumType declaringType, EdmLocation location)
			: base(new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEnumMember, Strings.Bad_UnresolvedEnumMember(name)) })
		{
			this.@value = new Cache<UnresolvedEnumMember, IEdmPrimitiveValue>();
			UnresolvedEnumMember unresolvedEnumMember = this;
			string str = name;
			string empty = str;
			if (str == null)
			{
				empty = string.Empty;
			}
			unresolvedEnumMember.name = empty;
			this.declaringType = declaringType;
		}
コード例 #5
0
		private static bool TestNullabilityMatch(this IEdmTypeReference expressionType, IEdmTypeReference assertedType, EdmLocation location, out IEnumerable<EdmError> discoveredErrors)
		{
			if (assertedType.IsNullable || !expressionType.IsNullable)
			{
				discoveredErrors = Enumerable.Empty<EdmError>();
				return true;
			}
			else
			{
				EdmError[] edmError = new EdmError[1];
				edmError[0] = new EdmError(location, EdmErrorCode.CannotAssertNullableTypeAsNonNullableType, Strings.EdmModel_Validator_Semantic_CannotAssertNullableTypeAsNonNullableType(expressionType.FullName()));
				discoveredErrors = edmError;
				return false;
			}
		}
コード例 #6
0
        private static IEnumerable <EdmError> ConversionError(EdmLocation location, string typeName, string typeKindName)
        {
            EdmError[]  edmErrorArray = new EdmError[1];
            EdmError[]  edmError      = edmErrorArray;
            int         num           = 0;
            EdmLocation edmLocation   = location;
            int         num1          = 230;
            string      str           = typeName;
            object      obj           = str;

            if (str == null)
            {
                obj = "UnnamedType";
            }
            edmError[num] = new EdmError(edmLocation, (EdmErrorCode)num1, Strings.TypeSemantics_CouldNotConvertTypeReference(obj, typeKindName));
            return(edmErrorArray);
        }
コード例 #7
0
		private static bool TestTypeMatch(this IEdmTypeReference expressionType, IEdmTypeReference assertedType, EdmLocation location, out IEnumerable<EdmError> discoveredErrors)
		{
			if (expressionType.TestNullabilityMatch(assertedType, location, out discoveredErrors))
			{
				if (expressionType.TypeKind() == EdmTypeKind.None || expressionType.IsBad())
				{
					discoveredErrors = Enumerable.Empty<EdmError>();
					return true;
				}
				else
				{
					if (!expressionType.IsPrimitive() || !assertedType.IsPrimitive())
					{
						if (!expressionType.Definition.IsEquivalentTo(assertedType.Definition))
						{
							EdmError[] edmError = new EdmError[1];
							edmError[0] = new EdmError(location, EdmErrorCode.ExpressionNotValidForTheAssertedType, Strings.EdmModel_Validator_Semantic_ExpressionNotValidForTheAssertedType);
							discoveredErrors = edmError;
							return false;
						}
					}
					else
					{
						if (!expressionType.PrimitiveKind().PromotesTo(assertedType.AsPrimitive().PrimitiveKind()))
						{
							EdmError[] edmErrorArray = new EdmError[1];
							edmErrorArray[0] = new EdmError(location, EdmErrorCode.ExpressionPrimitiveKindNotValidForAssertedType, Strings.EdmModel_Validator_Semantic_ExpressionPrimitiveKindCannotPromoteToAssertedType(expressionType.FullName(), assertedType.FullName()));
							discoveredErrors = edmErrorArray;
							return false;
						}
					}
					discoveredErrors = Enumerable.Empty<EdmError>();
					return true;
				}
			}
			else
			{
				return false;
			}
		}
コード例 #8
0
ファイル: ValidationContext.cs プロジェクト: nickchal/pash
		public void AddError(EdmLocation location, EdmErrorCode errorCode, string errorMessage)
		{
			this.AddError(new EdmError(location, errorCode, errorMessage));
		}
コード例 #9
0
		public UnresolvedEntityContainer(string name, EdmLocation location)
			: base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedEntityContainer, Strings.Bad_UnresolvedEntityContainer(name)) })
		{
		}
コード例 #10
0
ファイル: EdmError.cs プロジェクト: nickchal/pash
		public EdmError(EdmLocation errorLocation, EdmErrorCode errorCode, string errorMessage)
		{
			this.ErrorLocation = errorLocation;
			this.ErrorCode = errorCode;
			this.ErrorMessage = errorMessage;
		}
コード例 #11
0
		public UnresolvedPrimitiveType(string qualifiedName, EdmLocation location)
			: base(qualifiedName, 0, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedPrimitiveType, Strings.Bad_UnresolvedPrimitiveType(qualifiedName)) })
		{

		}
コード例 #12
0
 private static IEnumerable <EdmError> ConversionError(EdmLocation location, string typeName, string typeKindName)
 {
     return(new[] { new EdmError(location, EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, Edm.Strings.TypeSemantics_CouldNotConvertTypeReference(typeName ?? EdmConstants.Value_UnnamedType, typeKindName)) });
 }
コード例 #13
0
			public void JustDecompileGenerated_set_Location(EdmLocation value)
			{
				this.JustDecompileGenerated_k__BackingField = value;
			}
コード例 #14
0
ファイル: CyclicComplexType.cs プロジェクト: nickchal/pash
		public CyclicComplexType(string qualifiedName, EdmLocation location)
			: base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicComplex, Strings.Bad_CyclicComplex(qualifiedName)) })
		{

		}
コード例 #15
0
ファイル: ValidationRules.cs プロジェクト: nickchal/pash
		private static void CheckForNameError(ValidationContext context, string name, EdmLocation location)
		{
			if (EdmUtil.IsNullOrWhiteSpaceInternal(name) || name.Length == 0)
			{
				context.AddError(location, EdmErrorCode.InvalidName, Strings.EdmModel_Validator_Syntactic_MissingName);
				return;
			}
			else
			{
				if (name.Length <= 0x1e0)
				{
					if (!EdmUtil.IsValidUndottedName(name))
					{
						context.AddError(location, EdmErrorCode.InvalidName, Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsNotAllowed(name));
					}
					return;
				}
				else
				{
					context.AddError(location, EdmErrorCode.NameTooLong, Strings.EdmModel_Validator_Syntactic_EdmModel_NameIsTooLong(name));
					return;
				}
			}
		}
コード例 #16
0
		public CyclicEntityContainer(string name, EdmLocation location)
			: base(name, new EdmError[] { new EdmError(location, EdmErrorCode.BadCyclicEntityContainer, Strings.Bad_CyclicEntityContainer(name)) })
		{

		}
コード例 #17
0
		public UnresolvedAssociation(string qualifiedName, EdmLocation location)
			: base(qualifiedName, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedType, Strings.Bad_UnresolvedType(qualifiedName)) })
		{

		}
コード例 #18
0
ファイル: ValidationRules.cs プロジェクト: nickchal/pash
		private static void CheckForUnreacheableTypeError(ValidationContext context, IEdmSchemaType type, EdmLocation location)
		{
			IEdmType edmType = context.Model.FindType(type.FullName());
			if (edmType as AmbiguousTypeBinding == null)
			{
				if (!edmType.IsEquivalentTo(type))
				{
					context.AddError(location, EdmErrorCode.BadUnresolvedType, Strings.EdmModel_Validator_Semantic_InaccessibleType(type.FullName()));
				}
				return;
			}
			else
			{
				context.AddError(location, EdmErrorCode.BadAmbiguousElementBinding, Strings.EdmModel_Validator_Semantic_AmbiguousType(type.FullName()));
				return;
			}
		}
コード例 #19
0
 private static IEnumerable<EdmError> ConversionError(EdmLocation location, string typeName, string typeKindName)
 {
     return new[] { new EdmError(location, EdmErrorCode.TypeSemanticsCouldNotConvertTypeReference, Edm.Strings.TypeSemantics_CouldNotConvertTypeReference(typeName ?? EdmConstants.Value_UnnamedType, typeKindName)) };
 }
コード例 #20
0
ファイル: EdmTypeSemantics.cs プロジェクト: nickchal/pash
		private static IEnumerable<EdmError> ConversionError(EdmLocation location, string typeName, string typeKindName)
		{
			EdmError[] edmErrorArray = new EdmError[1];
			EdmError[] edmError = edmErrorArray;
			int num = 0;
			EdmLocation edmLocation = location;
			int num1 = 230;
			string str = typeName;
			object obj = str;
			if (str == null)
			{
				obj = "UnnamedType";
			}
			edmError[num] = new EdmError(edmLocation, (EdmErrorCode)num1, Strings.TypeSemantics_CouldNotConvertTypeReference(obj, typeKindName));
			return edmErrorArray;
		}
コード例 #21
0
		public UnresolvedLabeledElement(string label, EdmLocation location)
			: base(label, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedLabeledElement, Strings.Bad_UnresolvedLabeledElement(label)) })
		{

		}
コード例 #22
0
ファイル: UnresolvedProperty.cs プロジェクト: nickchal/pash
		public UnresolvedProperty(IEdmStructuredType declaringType, string name, EdmLocation location)
			: base(declaringType, name, new EdmError[] { new EdmError(location, EdmErrorCode.BadUnresolvedProperty, Strings.Bad_UnresolvedProperty(name)) })
		{

		}
コード例 #23
0
		public UnresolvedAssociationEnd(IEdmAssociation declaringAssociation, string role, EdmLocation location)
			: base(declaringAssociation, role, new EdmError[] {  new EdmError(location, EdmErrorCode.BadNonComputableAssociationEnd, Strings.Bad_UncomputableAssociationEnd(role)) })
		{

		}