Skip to content

Commit

Permalink
Split many types out into separate files. No impactful changes.
Browse files Browse the repository at this point in the history
Sort usings, add spacing.
Replace Empty.Array with Array.Empty.
  • Loading branch information
wasabii committed Jan 8, 2024
1 parent 0f23b36 commit 4586f50
Show file tree
Hide file tree
Showing 157 changed files with 7,637 additions and 5,142 deletions.
5 changes: 4 additions & 1 deletion src/IKVM.Reflection/AmbiguousMatchException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Jeroen Frijters

namespace IKVM.Reflection
{
[Serializable]

[Serializable]
public sealed class AmbiguousMatchException : Exception
{
public AmbiguousMatchException()
Expand All @@ -46,5 +47,7 @@ private AmbiguousMatchException(System.Runtime.Serialization.SerializationInfo i
: base(info, context)
{
}

}

}
102 changes: 102 additions & 0 deletions src/IKVM.Reflection/ArrayType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
Copyright (C) 2009-2015 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
[email protected]
*/
using System;
using System.Collections.Generic;

namespace IKVM.Reflection
{
sealed class ArrayType : ElementHolderType
{
internal static Type Make(Type type, CustomModifiers mods)
{
return type.Universe.CanonicalizeType(new ArrayType(type, mods));
}

private ArrayType(Type type, CustomModifiers mods)
: base(type, mods, Signature.ELEMENT_TYPE_SZARRAY)
{
}

public override Type BaseType
{
get { return elementType.Module.universe.System_Array; }
}

public override Type[] __GetDeclaredInterfaces()
{
return new Type[] {
this.Module.universe.Import(typeof(IList<>)).MakeGenericType(elementType),
this.Module.universe.Import(typeof(ICollection<>)).MakeGenericType(elementType),
this.Module.universe.Import(typeof(IEnumerable<>)).MakeGenericType(elementType)
};
}

public override MethodBase[] __GetDeclaredMethods()
{
Type[] int32 = new Type[] { this.Module.universe.System_Int32 };
List<MethodBase> list = new List<MethodBase>();
list.Add(new BuiltinArrayMethod(this.Module, this, "Set", CallingConventions.Standard | CallingConventions.HasThis, this.Module.universe.System_Void, new Type[] { this.Module.universe.System_Int32, elementType }));
list.Add(new BuiltinArrayMethod(this.Module, this, "Address", CallingConventions.Standard | CallingConventions.HasThis, elementType.MakeByRefType(), int32));
list.Add(new BuiltinArrayMethod(this.Module, this, "Get", CallingConventions.Standard | CallingConventions.HasThis, elementType, int32));
list.Add(new ConstructorInfoImpl(new BuiltinArrayMethod(this.Module, this, ".ctor", CallingConventions.Standard | CallingConventions.HasThis, this.Module.universe.System_Void, int32)));
for (Type type = elementType; type.__IsVector; type = type.GetElementType())
{
Array.Resize(ref int32, int32.Length + 1);
int32[int32.Length - 1] = int32[0];
list.Add(new ConstructorInfoImpl(new BuiltinArrayMethod(this.Module, this, ".ctor", CallingConventions.Standard | CallingConventions.HasThis, this.Module.universe.System_Void, int32)));
}
return list.ToArray();
}

public override TypeAttributes Attributes
{
get { return TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.Serializable; }
}

public override int GetArrayRank()
{
return 1;
}

public override bool Equals(object o)
{
return EqualsHelper(o as ArrayType);
}

public override int GetHashCode()
{
return elementType.GetHashCode() * 5;
}

internal override string GetSuffix()
{
return "[]";
}

protected override Type Wrap(Type type, CustomModifiers mods)
{
return Make(type, mods);
}
}
}
2 changes: 2 additions & 0 deletions src/IKVM.Reflection/AssemblyComparisonResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Jeroen Frijters

namespace IKVM.Reflection
{

public enum AssemblyComparisonResult
{
Unknown = 0,
Expand All @@ -39,4 +40,5 @@ public enum AssemblyComparisonResult
EquivalentPartialFXUnified = 10,
NonEquivalentPartialVersion = 11,
}

}
31 changes: 31 additions & 0 deletions src/IKVM.Reflection/AssemblyContentType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright (C) 2009-2012 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
[email protected]
*/
namespace IKVM.Reflection
{
public enum AssemblyContentType
{
Default = 0,
WindowsRuntime = 1,
}
}
32 changes: 32 additions & 0 deletions src/IKVM.Reflection/AssemblyHashAlgorithm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright (C) 2009-2012 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
[email protected]
*/
namespace IKVM.Reflection
{
public enum AssemblyHashAlgorithm
{
None = 0,
MD5 = 0x8003,
SHA1 = 0x8004,
}
}
4 changes: 3 additions & 1 deletion src/IKVM.Reflection/AssemblyName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ Jeroen Frijters

namespace IKVM.Reflection
{

public sealed class AssemblyName
: ICloneable
{

private string name;
private string culture;
private Version version;
Expand Down Expand Up @@ -85,7 +87,7 @@ public AssemblyName(string assemblyName)
if (parsed.PublicKeyToken != null)
{
if (parsed.PublicKeyToken.Equals("null", StringComparison.OrdinalIgnoreCase))
publicKeyToken = Empty<byte>.Array;
publicKeyToken = Array.Empty<byte>();
else if (parsed.PublicKeyToken.Length != 16)
throw new FileLoadException();
else
Expand Down
37 changes: 37 additions & 0 deletions src/IKVM.Reflection/AssemblyNameFlags.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Copyright (C) 2009-2012 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
[email protected]
*/
using System;

namespace IKVM.Reflection
{
[Flags]
public enum AssemblyNameFlags
{
None = 0,
PublicKey = 1,
Retargetable = 256,
EnableJITcompileOptimizer = 16384,
EnableJITcompileTracking = 32768,
}
}
32 changes: 32 additions & 0 deletions src/IKVM.Reflection/AssemblyVersionCompatibility.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright (C) 2009-2012 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
[email protected]
*/
namespace IKVM.Reflection
{
public enum AssemblyVersionCompatibility
{
SameMachine = 1,
SameProcess = 2,
SameDomain = 3,
}
}
6 changes: 5 additions & 1 deletion src/IKVM.Reflection/BadImageFormatException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ Jeroen Frijters

namespace IKVM.Reflection
{
[Serializable]

[Serializable]
public sealed class BadImageFormatException : Exception
{

public BadImageFormatException()
{
}
Expand All @@ -46,5 +48,7 @@ private BadImageFormatException(System.Runtime.Serialization.SerializationInfo i
: base(info, context)
{
}

}

}
Loading

0 comments on commit 4586f50

Please sign in to comment.