CPF/CPF.Mac/Mac/CoreFoundation/CFIndex.cs
2023-11-21 23:05:03 +08:00

30 lines
464 B
C#

using System;
namespace CPF.Mac.CoreFoundation
{
public struct CFIndex
{
private IntPtr value;
private CFIndex(IntPtr value)
{
this.value = value;
}
public static implicit operator int(CFIndex index)
{
return index.value.ToInt32();
}
public static implicit operator CFIndex(int value)
{
return new CFIndex(new IntPtr(value));
}
public static implicit operator long(CFIndex index)
{
return index.value.ToInt64();
}
}
}