POV-Ray : Newsgroups : povray.off-topic : C# 4.0 Default parameters : Re: C# 4.0 Default parameters Server Time
6 Sep 2024 15:19:20 EDT (-0400)
  Re: C# 4.0 Default parameters  
From: Mike Raiford
Date: 4 Feb 2009 14:31:56
Message: <4989ed2c@news.povray.org>
Warp wrote:
> Mike Raiford <"m[raiford]!at"@gmail.com> wrote:
>> Transparently.
> 
>> e.g.
> 
>> delegate void myDel(int x);
> 
>> class SomeClass
>> {
>>    public int myValue;
> 
>>    public void DoInstanceStuff(int x)
>>    {
>>      myValue = x;
>>    }
> 
>>    public static void Main()
>>    {
>>      SomeClass c = new SomeClass();
> 
>>      myDel d = c.DoInstanceStuff
> 
>>      d(6); // this sets c.myValue to 6;
> 
>>    }
>> }
> 
>   So you can't use the same function delegate for calling a member
> function of two different objects?
> 

No, I don't think you can. The closest you could get would be something 
like a multicast delegate. But, then you really cannot get a return value.
-- 
~Mike


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.