Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Spatial / Internal / SpatialExceptions.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="SqlSpatialServices.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner  willa
7 // @backupOwner Microsoft
8 //------------------------------------------------------------------------------
9
10 namespace System.Data.Spatial.Internal
11 {
12     using System;
13     using System.Data;
14
15     internal static class SpatialExceptions
16     {
17         internal static ArgumentNullException ArgumentNull(string argumentName)
18         {
19             // 
20             return EntityUtil.ArgumentNull(argumentName);
21         }
22
23         internal static Exception ProviderValueNotCompatibleWithSpatialServices()
24         {
25             // 
26             return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_ProviderValueNotCompatibleWithSpatialServices, "providerValue");
27         }
28
29         /// <summary>
30         /// Thrown whenever DbGeograpy/DbGeometry.WellKnownValue is set after regular construction (not deserialization instantiation).
31         /// </summary>
32         /// <returns><see cref="InvalidOperationException"/></returns>
33         internal static InvalidOperationException WellKnownValueSerializationPropertyNotDirectlySettable()
34         {
35             // 
36             return EntityUtil.InvalidOperation(System.Data.Entity.Strings.Spatial_WellKnownValueSerializationPropertyNotDirectlySettable);
37         }
38
39         #region Geography-specific exceptions
40
41         internal static Exception GeographyValueNotCompatibleWithSpatialServices(string argumentName)
42         {
43             // 
44             return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_GeographyValueNotCompatibleWithSpatialServices, argumentName);
45         }
46
47         internal static Exception WellKnownGeographyValueNotValid(string argumentName)
48         {
49             // 
50             return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_WellKnownGeographyValueNotValid, argumentName);
51         }
52
53         internal static Exception CouldNotCreateWellKnownGeographyValueNoSrid(string argumentName)
54         {
55             // 
56             return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoSrid, argumentName);
57         }
58
59         internal static Exception CouldNotCreateWellKnownGeographyValueNoWkbOrWkt(string argumentName)
60         {
61             // 
62             return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeographyValueNoWkbOrWkt, argumentName);
63         }
64
65         #endregion
66
67         #region Geometry-specific exceptions
68
69         internal static Exception GeometryValueNotCompatibleWithSpatialServices(string argumentName)
70         {
71             // 
72             return EntityUtil.Argument(System.Data.Entity.Strings.Spatial_GeometryValueNotCompatibleWithSpatialServices, argumentName);
73         }
74
75         internal static Exception WellKnownGeometryValueNotValid(string argumentName)
76         {
77             // 
78             throw EntityUtil.Argument(System.Data.Entity.Strings.Spatial_WellKnownGeometryValueNotValid, argumentName);
79         }
80
81         internal static Exception CouldNotCreateWellKnownGeometryValueNoSrid(String argumentName)
82         {
83             // 
84             return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoSrid, argumentName);
85         }
86
87         internal static Exception CouldNotCreateWellKnownGeometryValueNoWkbOrWkt(String argumentName)
88         {
89             // 
90             return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialservices_CouldNotCreateWellKnownGeometryValueNoWkbOrWkt, argumentName);
91         }
92                
93         #endregion
94
95         #region SqlSpatialServices-specific Exceptions
96
97         internal static Exception SqlSpatialServices_ProviderValueNotSqlType(Type requiredType)
98         {
99             return EntityUtil.Argument(System.Data.Entity.Strings.SqlSpatialServices_ProviderValueNotSqlType(requiredType.AssemblyQualifiedName), "providerValue");
100         }
101                 
102         #endregion
103     }
104 }