Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Ryan Heath
Do you use the formating also when displaying the values in the UI? If not, is it possible to defer the formating right before writing the *value* to the db? At that point it is known (is it?) to which db field you are going to write to. Currently it seems you are coupling the format information

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Greg Rothlander
Thanks for the feedback. I have looked at the IFormatProvider and it will work for what I am doing. However, it's not the problem that I am having. The problem that I am having is finding a place to store the format string for each variable I declare. I could pass it into my function. That

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Marc Brooks
Sorry, wrong links and interface name. I MEANT IFormatProvider http://rajkwatra.blogspot.com/2007/05/custom-string-formatting-in-net.html Marc On Tue, Aug 12, 2008 at 9:15 PM, Marc Brooks <[EMAIL PROTECTED]> wrote: > Maybe you should consider building some custom formatters that > implement IFor

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Marc Brooks
Maybe you should consider building some custom formatters that implement IFormatter http://geekswithblogs.net/luskan/archive/2007/07/16/113956.aspx -- "Your lack of planning DOES constitute an emergency on my part... so PLAN BETTER! " Marc C. Brooks http://musingmarc.blogspot.com ==

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Sébastien Lorion
I am thinking that maybe you can use CultureInfo for what you are trying to do, either by settings directly the properties on the current culture, or creating a new one and setting it as current. That way, you can control what is the default format for numbers, dates, etc. Just another way to look

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Greg Rothlander
Thanks for all of the suggestions of using extension for this. That really helps but it leaves one issue still remaining. I can use the extensions to apply the format. That works well using extensions. But now I need to pull in the format string as well from somewhere. I have stored them in a

Re: [ADVANCED-DOTNET] Can you extend the datatypes in VB.Net

2008-08-12 Thread Greg Rothlander
Exactly. That is what it is in .Net, but not in other languages. In other languages you store the format within the data type. So I'm just trying to figure out good way to keep track of the format as well. I can keep track of the format in a little array. Then look up the format when the varia