Click here to Skip to main content
15,892,517 members
Home / Discussions / C#
   

C#

 
GeneralRe: Com DLL file reference access ... [modified] Pin
Dave Kreskowiak9-Jan-08 9:14
mveDave Kreskowiak9-Jan-08 9:14 
QuestionHow Do I Prohibit Users From Sorting In A DataGridView Pin
Joe Marchionna9-Jan-08 5:24
Joe Marchionna9-Jan-08 5:24 
GeneralRe: How Do I Prohibit Users From Sorting In A DataGridView Pin
led mike9-Jan-08 5:33
led mike9-Jan-08 5:33 
GeneralRe: How Do I Prohibit Users From Sorting In A DataGridView Pin
Joe Marchionna9-Jan-08 5:40
Joe Marchionna9-Jan-08 5:40 
GeneralRe: How Do I Prohibit Users From Sorting In A DataGridView Pin
led mike9-Jan-08 6:03
led mike9-Jan-08 6:03 
GeneralRe: How Do I Prohibit Users From Sorting In A DataGridView Pin
Joe Marchionna9-Jan-08 8:42
Joe Marchionna9-Jan-08 8:42 
QuestionHow to delete a row from a dataGrid Pin
Imran Adam9-Jan-08 5:22
Imran Adam9-Jan-08 5:22 
GeneralSerializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 4:50
Skippums9-Jan-08 4:50 
I have a class "Foo" with a flag-type enum property that I do NOT want to serialize by name as many of the values can be serialized as a combination of misleading things (some of the flags have different meaning based on other flags, so both "LanguageSpanish" and "ChicagoBears" could have the same enum value of 5. With default serialization, if I meant to use LanguageSpanish, I could end up receiving ChicagoBears or vice-versa). Therefore, I am attempting to get this enum value as an integer. I do this by adding another property to my class that is of type ulong (the base type of the enumeration). However, the ulong type is serialized as a base-10 integer, when I want it to be in hex representation as it is a flags field. Is there any way to get the ulong property (or the enum) to serialize in hex, or am I resigned to using a string as the property type? The following example illustrates what I mean assuming the enum type I am using is "AnotherFlag | LanguageSpanish".
public enum TestEnum : ulong {
    ChicagoBears = 5,
    LanguageSpanish = 5,
    AnotherFlag = 8,
    ...
}
[Serializable]
public class Foo {
    // This serializes as "AnotherFlag ChicagoBears"
    public TestEnum EnumValue { get; set; }
    // This serializes as "13"
    public ulong   UlongValue { get; set; }
    // This serializes as "000000000000000D"
    // (how I want it, but I also want to indicate it's type as ulong or TestEnum)
    public string StringValue { get; set; }
}
Thanks,

Sounds like somebody's got a case of the Mondays

-Jeff

GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 5:21
Le centriste9-Jan-08 5:21 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 8:10
Skippums9-Jan-08 8:10 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 8:24
Le centriste9-Jan-08 8:24 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 9:27
Skippums9-Jan-08 9:27 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Le centriste9-Jan-08 9:37
Le centriste9-Jan-08 9:37 
GeneralRe: Serializing ints, enums in hexidecimal Pin
Skippums9-Jan-08 10:17
Skippums9-Jan-08 10:17 
GeneralTo add to my other answer... Pin
Le centriste9-Jan-08 9:40
Le centriste9-Jan-08 9:40 
QuestionHow to invoke SQL Function through SqlCommand class Pin
El'Cachubrey9-Jan-08 4:06
El'Cachubrey9-Jan-08 4:06 
AnswerRe: How to invoke SQL Function through SqlCommand class Pin
led mike9-Jan-08 4:31
led mike9-Jan-08 4:31 
AnswerRe: How to invoke SQL Function through SqlCommand class Pin
andyharman9-Jan-08 4:44
professionalandyharman9-Jan-08 4:44 
QuestionHow to catch the event of thowing an exception in Visual Studio Pin
manustone9-Jan-08 3:51
manustone9-Jan-08 3:51 
Generalset child form height Pin
arkiboys9-Jan-08 2:29
arkiboys9-Jan-08 2:29 
GeneralRe: set child form height Pin
Stu Richardson9-Jan-08 2:40
Stu Richardson9-Jan-08 2:40 
GeneralRe: set child form height Pin
arkiboys9-Jan-08 2:49
arkiboys9-Jan-08 2:49 
GeneralRe: set child form height Pin
DaveyM699-Jan-08 3:08
professionalDaveyM699-Jan-08 3:08 
GeneralRe: set child form height Pin
arkiboys9-Jan-08 3:13
arkiboys9-Jan-08 3:13 
GeneralRe: set child form height Pin
DaveyM699-Jan-08 3:24
professionalDaveyM699-Jan-08 3:24 

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.