G
Guest
I have a little webcontrol that generates images based on propertyvalues. To
get a name for each image that is "unique" for only one combination of
propertyvalues on the control I use GetHashCode from each property and
combines the values I get to create the name (ie 2452566266.gif). That should
give me a name that is always the same as long as the propertyvalues are the
same. As soon as one of the propertyvalues are changed (ie the property
BackgroundColor is changed from "Green" to "White") a new imagename/image is
created (which is exactly what I want).
With me so far?
All this works fine except for my Font property. Let's say
myFontProperty.GetHashCode() generates 123456789 the first time, same number
the second time, same number the third time and so on. But now here's the
funny part - after restarting my computer and running the exact same code
(the font property has the exact same fontname, size etc as before the
restart), myFontProperty.GetHashCode() generates another number. Is this
behavior really correct? Shouldn't a font instance with the exact same values
in it always generate the exact same hashcode?
get a name for each image that is "unique" for only one combination of
propertyvalues on the control I use GetHashCode from each property and
combines the values I get to create the name (ie 2452566266.gif). That should
give me a name that is always the same as long as the propertyvalues are the
same. As soon as one of the propertyvalues are changed (ie the property
BackgroundColor is changed from "Green" to "White") a new imagename/image is
created (which is exactly what I want).
With me so far?
All this works fine except for my Font property. Let's say
myFontProperty.GetHashCode() generates 123456789 the first time, same number
the second time, same number the third time and so on. But now here's the
funny part - after restarting my computer and running the exact same code
(the font property has the exact same fontname, size etc as before the
restart), myFontProperty.GetHashCode() generates another number. Is this
behavior really correct? Shouldn't a font instance with the exact same values
in it always generate the exact same hashcode?