Mono.Interop.ComInteropProxy.CanCastTo C# (CSharp) Méthode

CanCastTo() public méthode

public CanCastTo ( Type fromType, object o ) : bool
fromType System.Type
o object
Résultat bool
		public bool CanCastTo (Type fromType, object o)
		{
            __ComObject co = o as __ComObject;
            if (co == null)
                throw new NotSupportedException ("Only RCWs are currently supported");

            if ((fromType.Attributes & TypeAttributes.Import) == 0)
                return false;

            if (co.GetInterface (fromType, false) == IntPtr.Zero)
                return false;
            
            return true;
		}
	}