Home Contact

X

Coder, not artist.

News

Current archive is at: http://cskardon.wordpress.com/ - I aim to move it all soon! All code on here is free, but as a consequence it's up to you to check it, ha! If you have any questions, feel free to email: cskardon -- @ -- xclave dot co dot uk I'm sure you can decrypt the address there!

Twitter












Archives

Post Categories

Image Galleries

Syndication:

MAF PipeLineBuilder with 'params'

More of a note really, but lets (for example) say we've defined a Contract for our Managed Addin Framework (MAF):
[AddInContract]
public interface ISimpleCalc : IContract
{
    double Add(double x, double y, params double[] theRest);
}
if we use the PipeLineBuilder to generate the Pipeline for us, we'll find the contact defined in our 'AddInView' and 'HostView' projects as:

public interface ISimpleCalc
{
  double Add(double x, double y, double[] theRest);
}

Which is obviously a problem as we're expecting to just be able to use this in our hosts as:
Add(1,2,3,4,5,6);
or
Add(1,2);
instead, we have to use:
Add(1,2, new double[] {3,4,5,6});
or
Add(1,2, null);
Fortunately this is purely to do with the Pipeline builder, just editing the two contract definitions in the AddInView and HostView, just add the params arg in:

public interface ISimpleCalc
{
  double Add(double x, double y, params double[] theRest);
}

Job done...
I've got the Pipeline code now, so I'm gonna see if I can add this in!

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: