In theory the designer could store your original input text. Yet since the visual designer can also modify these values (i.e. Left, Top, etc) it would have to reconcile this storage against the control's values during serialization. This is presumably one reason why the designer does not store the text values entered, rather it takes your text and converts it to a value that can be placed into the control. When it needs to serialize it just reads the control's properties and writes them. There would little point to interrogate the details of the decimal prior to storage just to optimize which constructor to use. It needs to handle all possible values of the decimal type, thus the int[] provides a round-trip reliable storage mechanic for any value a decimal can represent.
BTW, the following outlines the internal structure of the decimal:
- bits is a four-element array of 32-bit signed integers.
- bits [0], bits [1], and bits [2] contain the low, middle, and high 32 bits of the 96-bit integer number.
- bits [3] contains the scale factor and sign, and consists of following parts:
- Bits 0 to 15, the lower word, are unused and must be zero.
- Bits 16 to 23 must contain an exponent between 0 and 28, which indicates the power of 10 to divide the integer number.
- Bits 24 to 30 are unused and must be zero.
- Bit 31 contains the sign; 0 meaning positive, and 1 meaning negative.
Update:
Would you explain "...since the visual designer can also modify these values, ... it would have to reconcile this storage against the control's values during serialization..." in more detail?
Sure. I was just trying to address the literal interpretation of your question "why does the designer use that form instead of putting the value I entered". Basically all I'm saying is that the designer doesn't keep track of the exact textual value you entered "-65535". Instead, it converts it to a decimal with something like decimal.Parse(...). Then it places this decimal into the control's value, in this case NumericUpDown.Minimum. Afterwords it serializes the state of the control in the xxxx.Designer.cs file by reading each property value. Thus it no longer has a copy of the original text "-65535" you entered, but only the resulting decimal value.
The part referring to "reconcile this storage..." was to simply to point out that it would be difficult to not only track the original text input by a user, but also detect if that value had been changed by some other means that the original text input.
Sorry if that is still confusing I'm having trouble describing it. English is my 5th language, right behind C#, C++, SQL, and JScript all of which are much more explicit in meaning than English :)