Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wintellect PowerCollections for Windows 7 Phone?

This otherwise great open source collection won't build on the Windows 7 Phone because it uses Serializable and the ICloneable interface, which is internal within Silverlight based frameworks. Does there exist an alternative or a ported version?

like image 391
Rhubarb Avatar asked Dec 24 '11 15:12

Rhubarb


1 Answers

I recommend downloading the source from CodePlex and building it in a WP7 application.

What we do when we share code across platforms like this where specific attributes are not supported, is to add stub classes to the Silverlight project for the unsupported attributes. This allows the source to compile on all platforms without needing change.

For example, here is our stub for Serializable:

/// <summary>
/// This is a dummy attribute to support silverlight
/// </summary>
/// <remarks></remarks>
public class Serializable : Attribute
{
    public Serializable() : base()
    {
    }
}

You may also find that there are unsupported method overloads (Silverlight has fewer overloads for various methods). If this is the case, you can just use conditional compilation to provide the correct overload for the missing methods.

like image 66
competent_tech Avatar answered Oct 10 '22 05:10

competent_tech