¡@

Home 

c# Programming Glossary: iconvertible

If Int32 is just an alias for int, how can the Int32 class use an int?

http://stackoverflow.com/questions/16113850/if-int32-is-just-an-alias-for-int-how-can-the-int32-class-use-an-int

Int32 type public struct Int32 IComparable IFormattable IConvertible internal int m_value ... But isn't this illegal in C# If int..

What is the point of Convert.ToDateTime(bool)?

http://stackoverflow.com/questions/2689572/what-is-the-point-of-convert-todatetimebool

It makes sense because ToDateTime is part of the IConvertible interface implemented by bool . If you look in reflector you..

Why does casting int to invalid enum value NOT throw exception?

http://stackoverflow.com/questions/6413804/why-does-casting-int-to-invalid-enum-value-not-throw-exception

typeparam public static class EnumUtil T where T struct IConvertible Try to get as much of a static check as we can. The .NET framework..

Why does the VS Metadata view does not display explicit interface implemented members

http://stackoverflow.com/questions/7268632/why-does-the-vs-metadata-view-does-not-display-explicit-interface-implemented-me

Boolean struct metadata. Boolean implements the interface IConvertible. But looking at Boolean's members i could not see most of the.. looking at Boolean's members i could not see most of the IConvertible members. I've done some tests with some colleagues including.. creating our own classes and came to the conclusion that IConvertible must be implemented explicitly for Boolean. The question is..

Arithmetic operator overloading for a generic class in C#

http://stackoverflow.com/questions/756954/arithmetic-operator-overloading-for-a-generic-class-in-c-sharp

question I think the best you'd be able to do is use IConvertible as a constraint and do something like public static operator.. do something like public static operator T T x T y where T IConvertible var type typeof T if type typeof String type typeof DateTime.. though so you might want to do some manual checking but IConvertible should get you close enough and allow you to do the operation...

Create Generic method constraining T to an Enum

http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum

T ParseEnum T string value T defaultValue where T struct IConvertible if typeof T .IsEnum throw new ArgumentException T must be an.. share improve this question Since Enum Type implements IConvertible interface a better implementation should be something like this.. public T GetEnumFromString T string value where T struct IConvertible if typeof T .IsEnum throw new ArgumentException T must be an..

How can I fix this up to do generic conversion to Nullable<T>?

http://stackoverflow.com/questions/793714/how-can-i-fix-this-up-to-do-generic-conversion-to-nullablet

to do conversions between types public static T To T this IConvertible obj return T Convert.ChangeType obj typeof T However it doesn't.. share improve this question public static T To T this IConvertible obj Type t typeof T Type u Nullable.GetUnderlyingType t if u..