public void PainterCreationWithoutReflectionTest() { SimpleFactory factory = SimpleFactory.GetFactory(); IArtist x = factory.GetArtist(typeof(Painter)); Assert.AreSame(x.GetType(), typeof(Painter)); }
internal static IntPtr GetPointer(IArtist artist) { if (artist.GetType() == typeof(ArtistWrapper)) { return(((ArtistWrapper)artist).artist.artistPtr); } throw new ArgumentException("Invalid artist"); }
internal static IntPtr GetPointer(IArtist artist) { if (artist.GetType() == typeof(ArtistWrapper)) return ((ArtistWrapper)artist).artist.artistPtr; throw new ArgumentException("Invalid artist"); }