Click here to Skip to main content
       

C#

 
QuestionCompare rows of a datagridview and remove repeated rows PinmemberGREG_DORIANcod6-Dec-12 6:12 
AnswerRe: Compare rows of a datagridview and remove repeated rows PinmemberMember 96474616-Dec-12 8:30 
Question[OptionalField] prevents deserialization [SOLVED] [modified] PinmemberAlan Balkany6-Dec-12 5:20 
QuestionShare datalayer in memory PinmemberRICARDOR2708746-Dec-12 5:14 
AnswerRe: Share datalayer in memory PinmemberEddy Vluggen6-Dec-12 5:32 
QuestionLocalize ColorDialog PinmemberDavid Knechtges6-Dec-12 4:28 
AnswerRe: Localize ColorDialog PinmemberZac Greve7-Dec-12 17:23 
QuestionHow to get enum as parameter thru interface PinmemberMichCl6-Dec-12 4:00 
I have an enum definition that I wanted to put in my interface, but I'm getting a compilation error:
Mode: interfaces cannot declare types
 
public enum Mode
        {
            Off = 0,
            On1 = 1,
            On2 = 2
        }
and the interface has a method in it that classes implementing it must define, where I want to pass the mode as a param:
int ProcessTWrit(ref Byte[] wDat, ref Byte[] sDat, ref Byte[] dataCk, int theMode);
 
So, I had to put separate definitions of the enum in both my El.cs and the class that it's calling through the interface.
 
I have my El.cs that I have also defined the enum above and want to call the above method:
 
result = cr.ProcessTWrit(ref wDat, ref sDat, ref dataCk, (int)Mode.On1);
 
My question is, is there a way that I can put my Mode enum in the interface so that the calling class and the receiving class can pass/use the enum values, so I don't have to have multiple definitions of the enum? There doesn't seem to be any other class that it would make sense for me to put the Mode definition in. This is a factory implementation. It looks like this:
 
El.cs =======> iCR.cs ==========================> CR5.cs
..........calls................ ProcessTWrit()................................................................ ProcessTWrit(){}
 
with multiple definitions of Mode in El.cs and CR5.cs. The three classes discussed above are in separate Visual Studio projects, if it makes a difference.
AnswerRe: How to get enum as parameter thru interface PinmentorDaveyM696-Dec-12 4:08 
AnswerRe: How to get enum as parameter thru interface PinmemberPIEBALDconsult6-Dec-12 4:55 
QuestionWhat would be the best approach for screen sharing c# PinmemberTridip Bhattacharjee5-Dec-12 21:00 
AnswerRe: What would be the best approach for screen sharing c# PinmemberEddy Vluggen6-Dec-12 5:28 
GeneralRe: What would be the best approach for screen sharing c# PinmemberTridip Bhattacharjee6-Dec-12 19:54 
GeneralRe: What would be the best approach for screen sharing c# PinmemberEddy Vluggen7-Dec-12 1:20 
QuestionExtending OpenFileDialog to select folder and file simultaneously Pinmemberhemant.4oct5-Dec-12 19:57 
AnswerRe: Extending OpenFileDialog to select folder and file simultaneously PinmvpRichard MacCutchan5-Dec-12 21:41 
GeneralRe: Extending OpenFileDialog to select folder and file simultaneously Pinmemberhemant.4oct5-Dec-12 22:16 
GeneralRe: Extending OpenFileDialog to select folder and file simultaneously PinmemberEddy Vluggen6-Dec-12 2:28 
GeneralRe: Extending OpenFileDialog to select folder and file simultaneously PinmvpRichard MacCutchan6-Dec-12 2:45 
Questionimage processing PinmemberBishwajit Nepali5-Dec-12 19:52 
AnswerRe: image processing PinmvpRichard MacCutchan5-Dec-12 21:34 
AnswerRe: image processing Pinmemberlukeer5-Dec-12 23:45 
QuestionHow to read data from crl file in C# PinmemberGramulos5-Dec-12 19:12 
AnswerRe: How to read data from crl file in C# PinmvpRichard MacCutchan5-Dec-12 21:32 
AnswerRe: How to read data from crl file in C# PinmemberEddy Vluggen6-Dec-12 2:34 

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

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


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 31 Jul 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid