converting values to the generic type

by pietman 17. February 2011 09:19

 

 

public class TypedProperty<T> : Property 
{ 
 public T TypedValue 
 { 
   get { return (T)Convert.ChangeType(base.Value, typeof(T)); } 
   set { base.Value = value.ToString();} 
 } 
}


 

Tags:

c# | Generics

Add c0mment




  Country flag
biuquote
  • Comment
  • Preview
Loading


About ...

pietman celliersPietman Celliers
Bitlink  Ltd
bitlinkit.com