Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,85 @@
//
// DataServiceProviderMethods.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Data.Services.Providers;
using System.Reflection;
namespace System.Data.Services.Providers
{
public static class DataServiceProviderMethods
{
public static object GetValue (object value, ResourceProperty property)
{
// LAMESPEC: this method is not implemented in the .NET assembly
throw new NotImplementedException ();
}
public static IEnumerable <T> GetSequenceValue<T> (object value, ResourceProperty property)
{
// LAMESPEC: this method is not implemented in the .NET assembly
throw new NotImplementedException ();
}
public static object Convert (object value, ResourceType type)
{
// LAMESPEC: this method is not implemented in the .NET assembly
throw new NotImplementedException ();
}
public static bool TypeIs (object value, ResourceType type)
{
// LAMESPEC: this method is not implemented in the .NET assembly
throw new NotImplementedException ();
}
public static int Compare (string left, string right)
{
return Comparer <string>.Default.Compare (left, right);
}
public static int Compare (bool left, bool right)
{
return Comparer <bool>.Default.Compare (left, right);
}
public static int Compare (bool? left, bool? right)
{
return Comparer <bool?>.Default.Compare (left, right);
}
public static int Compare (Guid left, Guid right)
{
return Comparer <Guid>.Default.Compare (left, right);
}
public static int Compare (Guid? left, Guid? right)
{
return Comparer <Guid?>.Default.Compare (left, right);
}
}
}

View File

@@ -0,0 +1,47 @@
//
// IDataServiceMetadataProvider.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Data.Services.Providers;
namespace System.Data.Services.Providers
{
public interface IDataServiceMetadataProvider
{
string ContainerNamespace { get; }
string ContainerName { get; }
IEnumerable <ResourceSet> ResourceSets { get; }
IEnumerable <ResourceType> Types { get; }
IEnumerable <ServiceOperation> ServiceOperations { get; }
bool TryResolveResourceSet (string name, out ResourceSet resourceSet);
ResourceAssociationSet GetResourceAssociationSet (ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty);
bool TryResolveResourceType (string name, out ResourceType resourceType);
IEnumerable <ResourceType> GetDerivedTypes (ResourceType resourceType);
bool HasDerivedTypes (ResourceType resourceType);
bool TryResolveServiceOperation (string name, out ServiceOperation serviceOperation);
}
}

View File

@@ -0,0 +1,39 @@
//
// IDataServicePagingProvider.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections;
using System.Data.Services.Providers;
using System.Linq;
namespace System.Data.Services.Providers
{
public interface IDataServicePagingProvider
{
object[] GetContinuationToken (IEnumerator enumerator);
void SetContinuationToken (IQueryable query, ResourceType resourceType, object[] continuationToken);
}
}

View File

@@ -0,0 +1,45 @@
//
// IDataServiceQueryProvider.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Data.Services.Providers;
using System.Linq;
namespace System.Data.Services.Providers
{
public interface IDataServiceQueryProvider
{
object CurrentDataSource { get; set; }
bool IsNullPropagationRequired { get; }
IQueryable GetQueryRootForResourceSet (ResourceSet resourceSet);
ResourceType GetResourceType (object target);
object GetPropertyValue (object target, ResourceProperty resourceProperty);
object GetOpenPropertyValue (object target, string propertyName);
IEnumerable <KeyValuePair <string, object>> GetOpenPropertyValues (object target);
object InvokeServiceOperation (ServiceOperation serviceOperation, object[] parameters);
}
}

View File

@@ -0,0 +1,45 @@
//
// IDataServiceStreamProvider.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services;
using System.Data.Services.Providers;
using System.IO;
namespace System.Data.Services.Providers
{
public interface IDataServiceStreamProvider
{
int StreamBufferSize { get; }
Stream GetReadStream (object entity, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext);
Stream GetWriteStream (object entity, string etag, bool? checkETagForEquality, DataServiceOperationContext operationContext);
void DeleteStream (object entity, DataServiceOperationContext operationContext);
string GetStreamContentType (object entity, DataServiceOperationContext operationContext);
Uri GetReadStreamUri (object entity, DataServiceOperationContext operationContext);
string GetStreamETag (object entity, DataServiceOperationContext operationContext);
string ResolveType (string entitySetName, DataServiceOperationContext operationContext);
}
}

View File

@@ -0,0 +1,38 @@
//
// IDataServiceUpdateProvider.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Providers;
namespace System.Data.Services.Providers
{
public interface IDataServiceUpdateProvider : IUpdatable
{
void SetConcurrencyValues (object resourceCookie, bool? checkForEquality, IEnumerable <KeyValuePair <string, object>> concurrencyValues);
}
}

View File

@@ -0,0 +1,231 @@
//
// OpenTypeMethods.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Linq.Expressions;
using System.Reflection;
namespace System.Data.Services.Providers
{
public static class OpenTypeMethods
{
public static object GetValue (object value, string propertyName)
{
throw new NotImplementedException ();
}
public static object Add (object left, object right)
{
throw new NotImplementedException ();
}
public static object AndAlso (object left, object right)
{
throw new NotImplementedException ();
}
public static object Divide (object left, object right)
{
throw new NotImplementedException ();
}
public static object Equal (object left, object right)
{
throw new NotImplementedException ();
}
public static object GreaterThan (object left, object right)
{
throw new NotImplementedException ();
}
public static object GreaterThanOrEqual (object left, object right)
{
throw new NotImplementedException ();
}
public static object LessThan (object left, object right)
{
throw new NotImplementedException ();
}
public static object LessThanOrEqual (object left, object right)
{
throw new NotImplementedException ();
}
public static object Modulo (object left, object right)
{
throw new NotImplementedException ();
}
public static object Multiply (object left, object right)
{
throw new NotImplementedException ();
}
public static object NotEqual (object left, object right)
{
throw new NotImplementedException ();
}
public static object OrElse (object left, object right)
{
throw new NotImplementedException ();
}
public static object Subtract (object left, object right)
{
throw new NotImplementedException ();
}
public static object Negate (object value)
{
throw new NotImplementedException ();
}
public static object Not (object value)
{
throw new NotImplementedException ();
}
public static object Convert (object value, ResourceType type)
{
throw new NotImplementedException ();
}
public static object TypeIs (object value, ResourceType type)
{
throw new NotImplementedException ();
}
public static object Concat (object first, object second)
{
throw new NotImplementedException ();
}
public static object EndsWith (object targetString, object substring)
{
throw new NotImplementedException ();
}
public static object IndexOf (object targetString, object substring)
{
throw new NotImplementedException ();
}
public static object Length (object value)
{
throw new NotImplementedException ();
}
public static object Replace (object targetString, object substring, object newString)
{
throw new NotImplementedException ();
}
public static object StartsWith (object targetString, object substring)
{
throw new NotImplementedException ();
}
public static object Substring (object targetString, object startIndex)
{
throw new NotImplementedException ();
}
public static object Substring (object targetString, object startIndex, object length)
{
throw new NotImplementedException ();
}
public static object SubstringOf (object substring, object targetString)
{
throw new NotImplementedException ();
}
public static object ToLower (object targetString)
{
throw new NotImplementedException ();
}
public static object ToUpper (object targetString)
{
throw new NotImplementedException ();
}
public static object Trim (object targetString)
{
throw new NotImplementedException ();
}
public static object Year (object dateTime)
{
throw new NotImplementedException ();
}
public static object Month (object dateTime)
{
throw new NotImplementedException ();
}
public static object Day (object dateTime)
{
throw new NotImplementedException ();
}
public static object Hour (object dateTime)
{
throw new NotImplementedException ();
}
public static object Minute (object dateTime)
{
throw new NotImplementedException ();
}
public static object Second (object dateTime)
{
throw new NotImplementedException ();
}
public static object Ceiling (object value)
{
throw new NotImplementedException ();
}
public static object Floor (object value)
{
throw new NotImplementedException ();
}
public static object Round (object value)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,55 @@
//
// ResourceAssociationSet.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerDisplay ("ResourceAssociationSet: ({End1.ResourceSet.Name}, {End1.ResourceType.Name}, {End1.ResourceProperty.Name}) <-> ({End2.ResourceSet.Name}, {End2.ResourceType.Name}, {End2.ResourceProperty.Name})")]
public sealed class ResourceAssociationSet
{
public string Name {
get { throw new NotImplementedException (); }
}
public ResourceAssociationSetEnd End1 {
get { throw new NotImplementedException (); }
}
public ResourceAssociationSetEnd End2 {
get { throw new NotImplementedException (); }
}
public ResourceAssociationSet (string name, ResourceAssociationSetEnd end1, ResourceAssociationSetEnd end2)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,54 @@
//
// ResourceAssociationSetEnd.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Runtime;
namespace System.Data.Services.Providers
{
[DebuggerDisplay ("ResourceAssociationSetEnd: {Name}: ({ResourceSet.Name}, {ResourceType.Name}, {ResourceProperty.Name})")]
public sealed class ResourceAssociationSetEnd
{
public ResourceSet ResourceSet {
get { throw new NotImplementedException (); }
}
public ResourceType ResourceType {
get { throw new NotImplementedException (); }
}
public ResourceProperty ResourceProperty {
get { throw new NotImplementedException (); }
}
public ResourceAssociationSetEnd (ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,81 @@
//
// ResourceProperty.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerDisplay ("{kind}: {name}")]
public class ResourceProperty
{
public bool CanReflectOnInstanceTypeProperty {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public ResourceType ResourceType {
get; private set;
}
public string Name {
get; private set;
}
public string MimeType {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public ResourcePropertyKind Kind {
get; private set;
}
public object CustomState {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool IsReadOnly {
get; private set;
}
public ResourceProperty (string name, ResourcePropertyKind kind, ResourceType propertyResourceType)
{
this.Name = name;
this.Kind = kind;
this.ResourceType = propertyResourceType;
}
public void SetReadOnly ()
{
IsReadOnly = true;
}
}
}

View File

@@ -0,0 +1,42 @@
//
// ResourcePropertyKind.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
namespace System.Data.Services.Providers
{
[Flags]
public enum ResourcePropertyKind
{
Primitive = 0x01,
Key = 0x02,
ComplexType = 0x04,
ResourceReference = 0x08,
ResourceSetReference = 0x10,
ETag = 0x20
}
}

View File

@@ -0,0 +1,66 @@
//
// ResourceSet.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Linq;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerDisplay ("{Name}: {ResourceType}")]
public class ResourceSet
{
public string Name {
get; private set;
}
public ResourceType ResourceType {
get; private set;
}
public object CustomState {
get; set;
}
public bool IsReadOnly {
get; private set;
}
public ResourceSet (string name, ResourceType elementType)
{
this.Name = name;
this.ResourceType = elementType;
}
public void SetReadOnly ()
{
IsReadOnly = true;
}
}
}

View File

@@ -0,0 +1,167 @@
//
// ResourceType.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Services.Common;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerDisplay ("{Name}: {InstanceType}, {ResourceTypeKind}")]
public class ResourceType
{
string nameSpace;
public bool IsMediaLinkEntry {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public Type InstanceType {
get; private set;
}
public ResourceType BaseType {
get; private set;
}
public ResourceTypeKind ResourceTypeKind {
get; private set;
}
public ReadOnlyCollection <ResourceProperty> Properties {
get { throw new NotImplementedException (); }
}
public ReadOnlyCollection <ResourceProperty> PropertiesDeclaredOnThisType {
get { throw new NotImplementedException (); }
}
public ReadOnlyCollection <ResourceProperty> KeyProperties {
get { throw new NotImplementedException (); }
}
public ReadOnlyCollection <ResourceProperty> ETagProperties {
get { throw new NotImplementedException (); }
}
public string Name {
get; private set;
}
public string FullName {
get; private set;
}
public string Namespace {
get {
if (nameSpace == null)
return String.Empty;
return nameSpace;
}
}
public bool IsAbstract {
get; private set;
}
public bool IsOpenType {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool CanReflectOnInstanceType {
get; set;
}
public object CustomState {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public bool IsReadOnly {
get; private set;
}
public ResourceType (Type instanceType, ResourceTypeKind resourceTypeKind, ResourceType baseType, string namespaceName, string name, bool isAbstract)
{
if (instanceType == null)
throw new ArgumentNullException ("instanceType");
if (String.IsNullOrEmpty (name))
throw new ArgumentNullException ("name");
if (resourceTypeKind == ResourceTypeKind.Primitive)
throw new ArgumentException ("'Primitive' is not a valid value for resourceTypeKind", "resourceTypeKind");
if (instanceType.IsValueType)
throw new ArgumentException ("Clr type for the resource type cannot be a value type.");
this.InstanceType = instanceType;
this.ResourceTypeKind = resourceTypeKind;
this.BaseType = baseType;
if (String.IsNullOrEmpty (namespaceName))
this.FullName = name;
else
this.FullName = namespaceName + "." + name;
this.Name = name;
this.nameSpace = namespaceName;
this.IsAbstract = isAbstract;
// Appears to always be true
this.CanReflectOnInstanceType = true;
}
public static ResourceType GetPrimitiveResourceType (Type type)
{
throw new NotImplementedException ();
}
public void AddProperty (ResourceProperty property)
{
throw new NotImplementedException ();
}
public void AddEntityPropertyMappingAttribute (EntityPropertyMappingAttribute attribute)
{
throw new NotImplementedException ();
}
public void SetReadOnly ()
{
// TODO: anything else?
IsReadOnly = true;
}
protected virtual IEnumerable <ResourceProperty> LoadPropertiesDeclaredOnThisType ()
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,38 @@
//
// ResourceTypeKind.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
namespace System.Data.Services.Providers
{
public enum ResourceTypeKind
{
EntityType = 0,
ComplexType = 1,
Primitive = 2
}
}

View File

@@ -0,0 +1,87 @@
//
// ServiceOperation.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerVisualizer ("ServiceOperation={Name}")]
public class ServiceOperation
{
public string Method {
get { throw new NotImplementedException (); }
}
public string MimeType {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
}
public string Name {
get { throw new NotImplementedException (); }
}
public ReadOnlyCollection <ServiceOperationParameter> Parameters {
get { throw new NotImplementedException (); }
}
public ServiceOperationResultKind ResultKind {
get { throw new NotImplementedException (); }
}
public ResourceType ResultType {
get { throw new NotImplementedException (); }
}
public object CustomState {
get; set;
}
public bool IsReadOnly {
get { throw new NotImplementedException (); }
}
public ResourceSet ResourceSet {
get { throw new NotImplementedException (); }
}
public ServiceOperation (string name, ServiceOperationResultKind resultKind, ResourceType resultType, ResourceSet resultSet, string method, IEnumerable <ServiceOperationParameter> parameters)
{
throw new NotImplementedException ();
}
public void SetReadOnly ()
{
throw new NotImplementedException ();
}
}
}

View File

@@ -0,0 +1,65 @@
//
// ServiceOperationParameter.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.CompilerServices;
namespace System.Data.Services.Providers
{
[DebuggerVisualizer ("ServiceOperationParameter={Name}")]
public class ServiceOperationParameter
{
public string Name {
get; private set;
}
public ResourceType ParameterType {
get; private set;
}
public object CustomState {
get; set;
}
public bool IsReadOnly {
get; private set;
}
public ServiceOperationParameter (string name, ResourceType parameterType)
{
this.Name = name;
this.ParameterType = parameterType;
}
public void SetReadOnly ()
{
IsReadOnly = true;
}
}
}

View File

@@ -0,0 +1,40 @@
//
// ServiceOperationResultKind.cs
//
// Author:
// Marek Habersack <grendel@twistedcode.net>
//
// Copyright (c) 2011 Novell, Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
using System.Data.Services.Providers;
namespace System.Data.Services.Providers
{
public enum ServiceOperationResultKind
{
DirectValue = 0,
Enumeration = 1,
QueryWithMultipleResults = 2,
QueryWithSingleResult = 3,
Void = 4
}
}