37 using System.Collections.Generic;
38 using System.Runtime.InteropServices;
40 namespace FreeImageAPI.IO
82 [Serializable, StructLayout(LayoutKind.Sequential)]
100 throw new ArgumentNullException(
"obj");
102 GCHandle gch = GCHandle.Alloc(obj, GCHandleType.Normal);
103 handle = GCHandle.ToIntPtr(gch);
116 return (left.handle == right.handle);
129 return (left.handle != right.handle);
139 return (handle == IntPtr.Zero);
148 internal object GetObject()
150 object result = null;
151 if (handle != IntPtr.Zero)
155 result = GCHandle.FromIntPtr(handle).Target;
171 return handle.ToString();
180 return handle.GetHashCode();
192 return ((obj is
fi_handle) && (
this == ((fi_handle)obj)));
202 return (
this == other);
219 throw new ArgumentException(
"obj");
221 return CompareTo((fi_handle)obj);
232 return handle.ToInt64().CompareTo(other.handle.ToInt64());
240 if (this.handle != IntPtr.Zero)
244 GCHandle.FromIntPtr(handle).Free();
251 this.handle = IntPtr.Zero;
override bool Equals(object obj)
Tests whether the specified object is a fi_handle structure and is equivalent to this fi_handle struc...
void Dispose()
Releases all resources used by the instance.
override int GetHashCode()
Returns a hash code for this fi_handle structure.
fi_handle(object obj)
Initializes a new instance wrapping a managed object.
override string ToString()
Converts the numeric value of the fi_handle object to its equivalent string representation.
int CompareTo(fi_handle other)
Compares this instance with a specified fi_handle object.
bool Equals(fi_handle other)
Indicates whether the current object is equal to another object of the same type. ...
Wrapper for a custom handle.
int CompareTo(object obj)
Compares this instance with a specified Object.