OsmSharp / ui

The UI components.
http://osmsharp.com/
GNU General Public License v2.0
138 stars 91 forks source link

Public class SortedList collides with BCL class #233

Closed GSPP closed 9 years ago

GSPP commented 9 years ago

OsmSharp.dll includes a class System.Collections.Generic.SortedList<TKey,TValue> which is public and has the same name as the corresponding .NET Framework class. This class should not be public.

Right now it is impossible to use SortedList because the compiler cannot differentiate between two identically named types from different assemblies.

SortedList is an implementation detail of OsmSharp. As such it should be private.

GSPP commented 9 years ago

On a similar note I'd like to suggest to make everything else private that is not related to what OsmSharp is supposed to do. For example is there a need to keep ASCIIEncoding public? The Utilities class also is an implementation detail (for the most part). LimitedStream, CappedStream, ... Implementation details should not be exposed because they lead to developers taking dependencies on them and being confused.

I suggest opening the compiled assembly with Reflector. This is a very easy way to check the public surface area and trim away stuff. A library should expose a clean surface area.

xivk commented 9 years ago

Thanks for letting us know how we should build this stuff.

We are aware of the SortedList problem and it will be fixed once there is time to find a truly cross-platform solution.

Pull-request are also welcome.

GSPP commented 9 years ago

Would you take a pull request making those classes private?

Seems like a small fix to make, though, so why the need for a pull request?

No offense intended by my comments. I made them to help you.