/// <summary> /// Converts a reference to the given type by first trying a CLR cast, and then /// trying to get an adapter; if none is available, throws an AdaptationException</summary> /// <typeparam name="T">Desired type, must be ref type</typeparam> /// <returns>Converted reference for the given object</returns> public T Cast <T>() where T : class { return(Adapters.Cast <T>(this)); }
/// <summary> /// Converts a reference to the given type by first trying a CLR cast, and then /// trying to get an adapter; if none is available, throws an AdaptationException</summary> /// <typeparam name="U">Desired type, must be ref type</typeparam> /// <returns>Converted reference for the given object</returns> public U Cast <U>() where U : class { return(Adapters.Cast <U>(this)); }