New Posts New Posts RSS Feed: Formatting an Ideablade "enum"
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Formatting an Ideablade "enum"

 Post Reply Post Reply
Author
Dominique View Drop Down
Groupie
Groupie
Avatar

Joined: 28-Jun-2007
Location: Norway
Posts: 44
Post Options Post Options   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Topic: Formatting an Ideablade "enum"
    Posted: 26-Jul-2007 at 9:49am
Hi,
I am wondering how-to format a Text property of a generated enum when using it as a display member in a combo.
I tried to override both the property and ToString method but none worked. I also tried to find something around FormatString but could find a "firstLetterUpcase" :)
example:
I have a generated "enum" class like Status with Status.todo and Status.don), with the classicals Code and Text properties.
I using pm.getEntities(of Status) as a datasource to a combo and want to see:
Todo
Done
how could I achieve this?
Dominique

Back to Top
jeffdoolittle View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 146
Post Options Post Options   Quote jeffdoolittle Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jul-2007 at 12:53pm
Take a look at IdeaBlade.Util.StringFns

--Jeff
Back to Top
Dominique View Drop Down
Groupie
Groupie
Avatar

Joined: 28-Jun-2007
Location: Norway
Posts: 44
Post Options Post Options   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jul-2007 at 11:09pm
Originally posted by jeffdoolittle

Take a look at IdeaBlade.Util.StringFns

Hi,
Thank you for your answer, it was some nice functions there.
I might have asked the question wrongly, because my concern was more about where to put the code. :)
I.E. do I need to have a ProperCaseTekst property in every enum class. In this case I might go for an abstract formating class.
It would actually have been nice if, taking my example, a Status class was a superclass for the Status.done, Status.todo (done and todo _are_ status)
Dominique
Back to Top
Dominique View Drop Down
Groupie
Groupie
Avatar

Joined: 28-Jun-2007
Location: Norway
Posts: 44
Post Options Post Options   Quote Dominique Quote  Post ReplyReply Direct Link To This Post Posted: 26-Jul-2007 at 11:30pm
Originally posted by Dominique


It would actually have been nice if, taking my example, a Status class was a superclass for the Status.done, Status.todo (done and todo _are_ status)

Oops,
shame on me, it works just like that. I won't even try to find a bad excuse :D.
Thanks Jeff for your pointer, it still some nice useful functions in there.
Dominique
Back to Top
jeffdoolittle View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 146
Post Options Post Options   Quote jeffdoolittle Quote  Post ReplyReply Direct Link To This Post Posted: 27-Jul-2007 at 12:12pm
No problem.  
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down