Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
9,683 additions
and
9,683 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
namespace Raven.Abstractions.MEF | ||
{ | ||
public class PartMetadata : IPartMetadata | ||
{ | ||
public int Order { get; set; } | ||
} | ||
namespace Raven.Abstractions.MEF | ||
{ | ||
public class PartMetadata : IPartMetadata | ||
{ | ||
public int Order { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="ReplicationDocument.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System.Collections.Generic; | ||
|
||
namespace Raven.Abstractions.Replication | ||
{ | ||
/// <summary> | ||
/// This class represent the list of replication destinations for the server | ||
/// </summary> | ||
public class ReplicationDocument | ||
{ | ||
/// <summary> | ||
/// Gets or sets the list of replication destinations. | ||
/// </summary> | ||
public List<ReplicationDestination> Destinations { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the id. | ||
/// </summary> | ||
/// <value>The id.</value> | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ReplicationDocument"/> class. | ||
/// </summary> | ||
public ReplicationDocument() | ||
{ | ||
Id = "Raven/Replication/Destinations"; | ||
Destinations = new List<ReplicationDestination>(); | ||
} | ||
} | ||
//----------------------------------------------------------------------- | ||
// <copyright file="ReplicationDocument.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System.Collections.Generic; | ||
|
||
namespace Raven.Abstractions.Replication | ||
{ | ||
/// <summary> | ||
/// This class represent the list of replication destinations for the server | ||
/// </summary> | ||
public class ReplicationDocument | ||
{ | ||
/// <summary> | ||
/// Gets or sets the list of replication destinations. | ||
/// </summary> | ||
public List<ReplicationDestination> Destinations { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the id. | ||
/// </summary> | ||
/// <value>The id.</value> | ||
public string Id { get; set; } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="ReplicationDocument"/> class. | ||
/// </summary> | ||
public ReplicationDocument() | ||
{ | ||
Id = "Raven/Replication/Destinations"; | ||
Destinations = new List<ReplicationDestination>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="ReflectionExtensions.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace Raven.Client.Linq | ||
{ | ||
internal static class ReflectionExtensions | ||
{ | ||
public static Type GetMemberType(this MemberInfo member) | ||
{ | ||
switch (member.MemberType) | ||
{ | ||
case MemberTypes.Field: | ||
return ((FieldInfo)member).FieldType; | ||
case MemberTypes.Property: | ||
return ((PropertyInfo)member).PropertyType; | ||
default: | ||
throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
} | ||
//----------------------------------------------------------------------- | ||
// <copyright file="ReflectionExtensions.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace Raven.Client.Linq | ||
{ | ||
internal static class ReflectionExtensions | ||
{ | ||
public static Type GetMemberType(this MemberInfo member) | ||
{ | ||
switch (member.MemberType) | ||
{ | ||
case MemberTypes.Field: | ||
return ((FieldInfo)member).FieldType; | ||
case MemberTypes.Property: | ||
return ((PropertyInfo)member).PropertyType; | ||
default: | ||
throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,88 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="TypeSystem.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
|
||
namespace Raven.Client.Linq | ||
{ | ||
internal static class TypeSystem | ||
{ | ||
private static Type FindIEnumerable(Type seqType) | ||
{ | ||
if (seqType == null || seqType == typeof(string)) | ||
return null; | ||
if (seqType.IsArray) | ||
return typeof(IEnumerable<>).MakeGenericType(seqType.GetElementType()); | ||
if (seqType.IsGenericType) | ||
{ | ||
foreach (Type arg in seqType.GetGenericArguments()) | ||
{ | ||
Type ienum = typeof(IEnumerable<>).MakeGenericType(arg); | ||
if (ienum.IsAssignableFrom(seqType)) | ||
return ienum; | ||
} | ||
} | ||
Type[] ifaces = seqType.GetInterfaces(); | ||
if (ifaces != null && ifaces.Length > 0) | ||
{ | ||
foreach (Type iface in ifaces) | ||
{ | ||
Type ienum = FindIEnumerable(iface); | ||
if (ienum != null) | ||
return ienum; | ||
} | ||
} | ||
if (seqType.BaseType != null && seqType.BaseType != typeof(object)) | ||
return FindIEnumerable(seqType.BaseType); | ||
return null; | ||
} | ||
|
||
internal static Type GetSequenceType(Type elementType) | ||
{ | ||
return typeof(IEnumerable<>).MakeGenericType(elementType); | ||
} | ||
|
||
internal static Type GetElementType(Type seqType) | ||
{ | ||
Type ienum = FindIEnumerable(seqType); | ||
if (ienum == null) | ||
return seqType; | ||
return ienum.GetGenericArguments()[0]; | ||
} | ||
|
||
internal static bool IsNullableType(Type type) | ||
{ | ||
return type != null && type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); | ||
} | ||
|
||
internal static bool IsNullAssignable(Type type) | ||
{ | ||
return !type.IsValueType || IsNullableType(type); | ||
} | ||
|
||
internal static Type GetNonNullableType(Type type) | ||
{ | ||
if (IsNullableType(type)) | ||
return type.GetGenericArguments()[0]; | ||
return type; | ||
} | ||
|
||
internal static Type GetMemberType(MemberInfo mi) | ||
{ | ||
FieldInfo fi = mi as FieldInfo; | ||
if (fi != null) | ||
return fi.FieldType; | ||
PropertyInfo pi = mi as PropertyInfo; | ||
if (pi != null) | ||
return pi.PropertyType; | ||
EventInfo ei = mi as EventInfo; | ||
if (ei != null) | ||
return ei.EventHandlerType; | ||
return null; | ||
} | ||
} | ||
} | ||
//----------------------------------------------------------------------- | ||
// <copyright file="TypeSystem.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
//----------------------------------------------------------------------- | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
|
||
namespace Raven.Client.Linq | ||
{ | ||
internal static class TypeSystem | ||
{ | ||
private static Type FindIEnumerable(Type seqType) | ||
{ | ||
if (seqType == null || seqType == typeof(string)) | ||
return null; | ||
if (seqType.IsArray) | ||
return typeof(IEnumerable<>).MakeGenericType(seqType.GetElementType()); | ||
if (seqType.IsGenericType) | ||
{ | ||
foreach (Type arg in seqType.GetGenericArguments()) | ||
{ | ||
Type ienum = typeof(IEnumerable<>).MakeGenericType(arg); | ||
if (ienum.IsAssignableFrom(seqType)) | ||
return ienum; | ||
} | ||
} | ||
Type[] ifaces = seqType.GetInterfaces(); | ||
if (ifaces != null && ifaces.Length > 0) | ||
{ | ||
foreach (Type iface in ifaces) | ||
{ | ||
Type ienum = FindIEnumerable(iface); | ||
if (ienum != null) | ||
return ienum; | ||
} | ||
} | ||
if (seqType.BaseType != null && seqType.BaseType != typeof(object)) | ||
return FindIEnumerable(seqType.BaseType); | ||
return null; | ||
} | ||
|
||
internal static Type GetSequenceType(Type elementType) | ||
{ | ||
return typeof(IEnumerable<>).MakeGenericType(elementType); | ||
} | ||
|
||
internal static Type GetElementType(Type seqType) | ||
{ | ||
Type ienum = FindIEnumerable(seqType); | ||
if (ienum == null) | ||
return seqType; | ||
return ienum.GetGenericArguments()[0]; | ||
} | ||
|
||
internal static bool IsNullableType(Type type) | ||
{ | ||
return type != null && type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>); | ||
} | ||
|
||
internal static bool IsNullAssignable(Type type) | ||
{ | ||
return !type.IsValueType || IsNullableType(type); | ||
} | ||
|
||
internal static Type GetNonNullableType(Type type) | ||
{ | ||
if (IsNullableType(type)) | ||
return type.GetGenericArguments()[0]; | ||
return type; | ||
} | ||
|
||
internal static Type GetMemberType(MemberInfo mi) | ||
{ | ||
FieldInfo fi = mi as FieldInfo; | ||
if (fi != null) | ||
return fi.FieldType; | ||
PropertyInfo pi = mi as PropertyInfo; | ||
if (pi != null) | ||
return pi.PropertyType; | ||
EventInfo ei = mi as EventInfo; | ||
if (ei != null) | ||
return ei.EventHandlerType; | ||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.