convert VB to C#

This commit is contained in:
2020-09-24 11:21:53 +02:00
parent 64277916cd
commit fecbeb4659
320 changed files with 17755 additions and 10320 deletions

View File

@@ -0,0 +1,30 @@
using System.Drawing;
namespace Pilz.S3DFileParser
{
internal static class Extensions
{
public static object GetPropertyValue(this object @base, string propertyName)
{
return @base?.GetType().GetProperty(propertyName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Static)?.GetValue(@base);
}
public static bool IsTheSameAs(this Bitmap @base, Bitmap image)
{
if (@base.Size != image.Size)
return false;
for (int y = 0, loopTo = @base.Height - 1; y <= loopTo; y++)
{
for (int x = 0, loopTo1 = @base.Width - 1; x <= loopTo1; x++)
{
var p1 = @base.GetPixel(x, y);
var p2 = image.GetPixel(x, y);
if (p1 != p2)
return false;
}
}
return true;
}
}
}