Short and null
Let say I have an object and this object has a property
of the type short.
How I can check if someone set this property?
When i try to check this like that:
I get an null reference exception.
if( myObject.MyShortProperty != null )
How I can check this without a null references exception?
I should note that this will return true if you have something like:
In this example the MessageBox shows because, for some reason, it reads (0,0) as a null, or empty, reference.
this.button.Location = new Point(0, 0);
MessageBox.Show("this.button has no location")
where do you get IsEmpty?
What do you mean?
EDIT: Blah, I'm a moron! That seems to only work for certain properties :(
This might work:
If they don't declare that property, that might work. Try it and tell me if it works.
Your "null reference exception" is because myObject is null. Check myObject first before you check it's properties.