/// <summary>Provide a IDispatch-based (e.g. late-bound) access to a COM object. Use <see cref="Invoke"/> to work with the object.</summary>
publicclassSafeIDispatch:ComReleaser<dynamic>
{
/// <summary>Initializes a new instance of the <see cref="SafeIDispatch"/> class.</summary>
/// <param name="target">The target object which must be a raw COM object.</param>
publicSafeIDispatch(objecttarget):base(target)
{
if(!Marshal.IsComObject(target))
thrownewArgumentException("The target object must be a COM object");
RawPointer=GetRawPointer(target);
}
/// <summary>Gets the pointer to the IDispatch instance.</summary>
/// <value>A pointer to the IDispatch instance.</value>
publicIntPtrRawPointer{get;}
/// <summary>Determines whether the specified <see cref="System.Object"/>, is equal to this instance.</summary>
/// <param name="other">The <see cref="System.Object"/> to compare with this instance.</param>
/// <returns><see langword="true"/> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <see langword="false"/>.</returns>
/// <summary>Determines whether the specified <see cref="System.Object"/>, is equal to this instance.</summary>
/// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
/// <returns><see langword="true"/> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <see langword="false"/>.</returns>