Skip to content

Instantly share code, notes, and snippets.

@edgarRd
Created December 20, 2010 22:17
Show Gist options
  • Save edgarRd/749101 to your computer and use it in GitHub Desktop.
Save edgarRd/749101 to your computer and use it in GitHub Desktop.
Type conversions and casts.
namespace Tools
{
public class TypeConvert
{
public static ObjectTarget[] convertArrayTo(ObjectSource[] objElems)
{
ObjectTarget[] objsTarget = Array.ConvertAll<ObjectSource, ObjectTarget>(objElems,
delegate(ObjectSource obj)
{
return (ObjectTarget) obj;
});
return objsTarget;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment