Click here to Skip to main content
15,891,423 members
Home / Discussions / C#
   

C#

 
AnswerRe: Bind ReportViwer to DataSource dynamically Pin
preetham gd5-Dec-11 3:22
preetham gd5-Dec-11 3:22 
GeneralRe: Bind ReportViwer to DataSource dynamically Pin
Software20075-Dec-11 4:40
Software20075-Dec-11 4:40 
QuestionC# remoting with Sql server and store recordset Pin
kornkimhour2-Dec-11 22:31
kornkimhour2-Dec-11 22:31 
AnswerRe: C# remoting with Sql server and store recordset Pin
DaveyM693-Dec-11 12:55
professionalDaveyM693-Dec-11 12:55 
Questionget type of anonymous list Pin
zeeShan anSari2-Dec-11 9:30
zeeShan anSari2-Dec-11 9:30 
AnswerRepost Pin
Not Active2-Dec-11 9:44
mentorNot Active2-Dec-11 9:44 
AnswerRe: get type of anonymous list Pin
Wonde Tadesse2-Dec-11 16:48
professionalWonde Tadesse2-Dec-11 16:48 
QuestionIncluding an additional enum property into an object? Pin
Goalie352-Dec-11 9:20
Goalie352-Dec-11 9:20 
How can I assign an additional "enum" property to a pre-existing object?

I'm building a Trophy system for my website where user's can earn trophies for various achievements. I currently have a "Trophy" object which was created for me automatically in Linq when I created my dbml file. Nice and simple so far Smile | :)

Now however, I want to include an additional property to my "Trophy" object of type enum called "TrophyLevel". For several, long winded reasons, I don't want to include TrophyLevel as a part of the actual "Trophy" object. So, I've tried setting it up in a partial class like the following:
C#
public partial class Trophy
    {
        public enum TrophyLevel
        {
            Bronze = 1,
            Silver = 2,
            Gold = 3,
            Platinum = 4
        }
    }


Is this the correct way I should be setting this up, and if so, how do I access it? So, basically, I want to be able to have code like the following:
Trophy.TrophyLevel = 1;
OR
String level = Trophy.TrophyLevel;

Am I going about this correctly?

Thanks
AnswerRe: Including an additional enum property into an object? Pin
Not Active2-Dec-11 9:47
mentorNot Active2-Dec-11 9:47 
AnswerRe: Including an additional enum property into an object? Pin
BillWoodruff2-Dec-11 19:27
professionalBillWoodruff2-Dec-11 19:27 
Questionstring concatenation: several seconds Pin
pirotrav2-Dec-11 2:35
pirotrav2-Dec-11 2:35 
AnswerRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 2:43
Rob Philpott2-Dec-11 2:43 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 2:48
pirotrav2-Dec-11 2:48 
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 2:51
Rob Philpott2-Dec-11 2:51 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 2:57
pirotrav2-Dec-11 2:57 
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 3:13
Rob Philpott2-Dec-11 3:13 
GeneralRe: string concatenation: several seconds Pin
BobJanova2-Dec-11 5:49
BobJanova2-Dec-11 5:49 
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 5:55
Rob Philpott2-Dec-11 5:55 
GeneralRe: string concatenation: several seconds Pin
BobJanova2-Dec-11 6:05
BobJanova2-Dec-11 6:05 
GeneralRe: string concatenation: several seconds Pin
Not Active2-Dec-11 3:01
mentorNot Active2-Dec-11 3:01 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 3:13
pirotrav2-Dec-11 3:13 
GeneralRe: string concatenation: several seconds Pin
Not Active2-Dec-11 4:04
mentorNot Active2-Dec-11 4:04 
AnswerRe: string concatenation: several seconds Pin
emardini2-Dec-11 3:34
emardini2-Dec-11 3:34 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 21:03
pirotrav2-Dec-11 21:03 
GeneralRe: string concatenation: several seconds Pin
Gerry Schmitz2-Dec-11 22:23
mveGerry Schmitz2-Dec-11 22:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.