IShapeFactory Shape.List alternative

Topics: General, Troubleshooting, Writing modules
Nov 20, 2011 at 4:10 PM

is it possible to create a method like Shape.List for outputing a Table instead of using the list and override the result. So create a method like:

var table= Shape.Table();

table.AddRange(shapes);

Nov 20, 2011 at 4:34 PM

It's definitely possible, I was thinking at one point about implementing such a thing. Look at CoreShapes.cs to see how existing code shapes like List are implemented. It gets pretty complex. And I think for Table you'd want to start making new Clay behaviours to add functions for managing rows/columns/headers/cells etc.

Nov 20, 2011 at 4:55 PM
Edited Nov 20, 2011 at 4:59 PM

thanks! i managed to get this working by a IShapeTableProvider and copy and change the List implementation. It would be nice though if there's a module which includes all kinds of shapes so we don't have to repeat each others work everytime. :)

i don't have experience with clay but i'll give it a try. and make sure you can add rows/columns etc.

Nov 20, 2011 at 6:11 PM

Well you've made a start with Table, why not release that module so others can use it, and keep adding more shapes to it?

Nov 20, 2011 at 7:34 PM

yes i think i'm gonna do that. Do you know where i can get some samples about how i can implement new clay behaviors? I'm not really sure how i can add functions for managing thead items,etc.