What you want is something like Aspect Oriented Programming, where you
could cross-cut all the methods that have a certain parameter.
Nothing like that exists for .NET right now, at least out of the box. I
believe there are some people out there working on something like this, but
I don't know how much progress was made. You could google AOP (or aspect
oriented programming) and .NET and see what comes up.
You could achieve this with creating a sink for a ContextBoundObject,
but it would require you to derive all your classes from ContextBoundObject,
as well as write the sink code. Also, all of your parameters would have to
be serializable or derive from MarshalByRefObject, and there would be a
performance hit in calling your objects as well.
--
- Nicholas Paldino [.NET/C# MVP]
-
(E-Mail Removed)
"roundcrisis" <(E-Mail Removed)> wrote in message
news:4867e928-16ce-4f5b-be86-(E-Mail Removed)...
> On Nov 16, 3:18 pm, Chris Shepherd <c...@nospam.chsh.ca> wrote:
>> roundcrisis wrote:
>> > Hi there:
>>
>> > I m trying to do something (check values) if one of the parameter in a
>> > procedure is used, for example
>>
>> > let say I have the following procedures:
>>
>> > index(int a, string specialParam, ..)
>> > save (string specialParam)
>> > delete(string specialParam, string lloooo)
>> > upstream()
>>
>> > basically i want to run another prooc anytime a procedure that has
>> > specialParam as a parameter is run, and actually if this proc returns
>> > false, then the original procedure shouldn't run
>> > I know this is not terribly clear so please feel free to ask for
>> > clarification
>> > any ideas?
>>
>> Just make another method and run it inside each method here.
>>
>> ie:
>>
>> private bool handleSpecial(string specialParam)
>> { /* do stuff here */ }
>>
>> then in other methods;
>>
>> private void index(int a, string specialParam,..)
>> {
>> if (!handleSpecial(specialParam))
>> return;
>>
>> }
>>
>> What part are you confused about?
>>
>> Chris.- Hide quoted text -
>>
>> - Show quoted text -
>
> this is a bit bigger than that
> many classes involved, etc
>