public static PSGalleryItem ToPSGalleryItem(this GalleryItem gallery) { PSGalleryItem psGalleryItem = new PSGalleryItem(); foreach (PropertyInfo prop in gallery.GetType().GetProperties()) { (typeof(PSGalleryItem)).GetProperty(prop.Name).SetValue(psGalleryItem, prop.GetValue(gallery, null), null); } return(psGalleryItem); }
public static PSGalleryItem ToPSGalleryItem(this GalleryItem gallery) { PSGalleryItem psGalleryItem = new PSGalleryItem(); foreach (PropertyInfo prop in gallery.GetType().GetProperties()) { (typeof(PSGalleryItem)).GetProperty(prop.Name).SetValue(psGalleryItem, prop.GetValue(gallery, null), null); } return psGalleryItem; }