Deveel.Data.Serialization.BinarySerializer.GetSpecialConstructor C# (CSharp) Method

GetSpecialConstructor() private method

private GetSpecialConstructor ( Type type ) : ConstructorInfo
type System.Type
return System.Reflection.ConstructorInfo
		private ConstructorInfo GetSpecialConstructor(Type type) {
#if PCL
			return type.GetConstructorOrNull(true, typeof (SerializationInfo), typeof (StreamingContext));
#else
			var ctors = type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			foreach (var ctor in ctors) {
				var paramTypes = ctor.GetParameters().Select(x => x.ParameterType).ToArray();
				if (paramTypes.Length == 2 && 
					paramTypes[0] == typeof(SerializationInfo) && 
					paramTypes[1] == typeof(StreamingContext))
					return ctor;
			}

			return null;
#endif
		}