Click here to Skip to main content
15,913,275 members
Home / Discussions / C#
   

C#

 
AnswerRe: TreeView - Control vs TreeView - Class Pin
Ravi Bhavnani24-May-06 6:15
professionalRavi Bhavnani24-May-06 6:15 
GeneralRe: TreeView - Control vs TreeView - Class Pin
Tomerland28-May-06 20:57
Tomerland28-May-06 20:57 
AnswerRe: TreeView - Control vs TreeView - Class Pin
Wjousts24-May-06 6:59
Wjousts24-May-06 6:59 
GeneralRe: TreeView - Control vs TreeView - Class Pin
Tomerland28-May-06 20:56
Tomerland28-May-06 20:56 
QuestionCoboBox dopdownstyle Pin
Del Mitchell24-May-06 4:40
Del Mitchell24-May-06 4:40 
AnswerRe: CoboBox dopdownstyle Pin
_AK_24-May-06 19:44
_AK_24-May-06 19:44 
GeneralRe: CoboBox dopdownstyle Pin
Del Mitchell25-May-06 3:29
Del Mitchell25-May-06 3:29 
Questionhow to point to a set of parameters using delegate Pin
donkaiser24-May-06 4:10
donkaiser24-May-06 4:10 
Hello,
I wonder if it's possible to point to a set of parameters or values when calling a function with a delegate. I have 2 forms and I pass delegate to call functions from form1.
lets say on form2 i have:
public delegate bool CallFuncDelegate();
private int generalX, general Y;

public bool Call(delegate, int a, int b)
{ generalX = a;
generalY = b;
invoke();
}

public bool Func1()
{ int localX = generalX;
int localY = generalY;
....
}

public bool Func2()
{ int localX = generalX;
int localY = generalY;
....
}

On form1 i will assign Func() to the delegate and call it thru Call():
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate, 1, 2);

form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate, 8, 9);

So is there a way to call Func() in form one and at the same time tell which parameters to use in form2?
so it's gonna be like this on form2:
public delegate bool CallFuncDelegate();
setofParam1{int generalX =1; int generalY =2};
setofParam2{int generalX=8; int generalY=9};

public bool Call(delegate)
{
invoke();
}

public bool Func1()
{ int localX = setofParam1.generalX;
int localY = setofParam1.generalY;
....
}

public bool Func2()
{ int localX = setofParam2.generalX;
int localY = setofParam2.generalY;
....
}

On form1:
form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func1);
AF.Logon(CFDelegate); // and then activate set1

form2.CallFuncDelegate CFDelegate = new form2.CallFuncDelegate (form2.Func2);
AF.Logon(CFDelegate);// and then activate set2

Sorry for being a little bit confusing. I want to do that because sometimes Func() can have less or more parameters and that required me to change the Call() and it's signature.

Donkaiser
AnswerRe: how to point to a set of parameters using delegate Pin
Judah Gabriel Himango24-May-06 7:14
sponsorJudah Gabriel Himango24-May-06 7:14 
QuestionImplement Heap help? Pin
eric_tran24-May-06 4:05
eric_tran24-May-06 4:05 
QuestionProgramatic (and only slightly problematic) Datasets Pin
martin_hughes24-May-06 3:58
martin_hughes24-May-06 3:58 
AnswerRe: Programatic (and only slightly problematic) Datasets Pin
Ed.Poore24-May-06 4:08
Ed.Poore24-May-06 4:08 
GeneralRe: Programatic (and only slightly problematic) Datasets Pin
martin_hughes24-May-06 7:13
martin_hughes24-May-06 7:13 
GeneralRe: Programatic (and only slightly problematic) Datasets Pin
Ed.Poore24-May-06 7:23
Ed.Poore24-May-06 7:23 
GeneralRe: Programatic (and only slightly problematic) Datasets Pin
martin_hughes24-May-06 8:51
martin_hughes24-May-06 8:51 
GeneralRe: Programatic (and only slightly problematic) Datasets Pin
Ed.Poore24-May-06 9:34
Ed.Poore24-May-06 9:34 
QuestionHow compile a file from my application Pin
Sasuko24-May-06 2:36
Sasuko24-May-06 2:36 
AnswerRe: How compile a file from my application Pin
-Dy24-May-06 2:52
-Dy24-May-06 2:52 
GeneralRe: How compile a file from my application Pin
Sasuko24-May-06 4:11
Sasuko24-May-06 4:11 
GeneralRe: How compile a file from my application Pin
-Dy24-May-06 22:56
-Dy24-May-06 22:56 
AnswerRe: How compile a file from my application Pin
Josh Smith24-May-06 4:26
Josh Smith24-May-06 4:26 
Questionconstructor to deserialize an object not found Pin
sameerhanda24-May-06 2:13
sameerhanda24-May-06 2:13 
AnswerRe: constructor to deserialize an object not found Pin
Ed.Poore24-May-06 4:01
Ed.Poore24-May-06 4:01 
GeneralRe: constructor to deserialize an object not found Pin
sameerhanda24-May-06 5:27
sameerhanda24-May-06 5:27 
GeneralRe: constructor to deserialize an object not found Pin
Ed.Poore24-May-06 21:58
Ed.Poore24-May-06 21:58 

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.