Hmmz.. if I read this, you have something like
classA
functionA(string name, int age)
classB.functionB()
functionA2(real amount, string city)
classB.functionB()
classB
functionB()
and you want code in B to access the parameters name and age you got in the
calling function A? (amount and city from calling A2...)
Do not know about accessing the callingstack @ runtime, but that seems to be
a hack and not really object oriënted. What you could do is create a
intermediate class like 'customParameter', which contains a few internal
variables (collections) that are set by functionA and functionA2.
Other approach is create overloaded functions of functionB that (offcourse)
have different signatures. Call a different functionB from all calling
functions. Create a base (generic) functionBBase that is called from the
overloaded functionB's for generic data processing.
Not knowing the exact situation this is all I solutions I can think off just
now. Is it possible to re-design this part aplication? Any more information?
> I'm working with .net framework 1.1 in C# for a windows application
>
[quoted text clipped - 7 lines]
> Thanks in advance!
> Paula
Paula - 22 Aug 2005 18:34 GMT
Gerrit,
Thanks for the response - the situation you described is exactly what I need
to do. I had thought about the container idea and the overloaded functions
and either solution will work. I was wondering if there was a better way!
And the good news is I haven't written anything for the application yet so
redesign isn't an issue.
Thanks again!
> Hmmz.. if I read this, you have something like
>
[quoted text clipped - 35 lines]
> > Thanks in advance!
> > Paula
Lloyd Dupont - 23 Aug 2005 01:24 GMT
I would say it's a bad idea as it only work with A & B.
what if a class C about which B knows nothing call B?
otherwise look at System.Diagnostic.StackTrace
> Gerrit,
>
[quoted text clipped - 54 lines]
>> > Thanks in advance!
>> > Paula