How to get Styles within a Theme

Topics: SharpMap Project, Web Controls, WinForms Controls
Developer
Oct 17, 2012 at 7:30 AM
Edited Oct 17, 2012 at 7:31 AM

I am trying to make a simple style editor for editing theming of vectorlayers, the issue I face is that once a theme has been set for a layer, there is no easy way to find the style(s) that have made the theme.

The only way I see is to keep a separate registry of layer, theme and style, if any one can suggest a better option (basically one that will prevent duplication of style data) it would be really great.

Developer
Jan 7, 2013 at 4:09 AM
Edited Jan 7, 2013 at 4:10 AM

Well coming back to this topic one solution will be to use an interface and apply it to the themes being used like so:

    interface IHaveStyleMap
    {
        Dictionary<string, IStyle> StyleMap { get; }
    }

Then we can implement it in the Theme concrete classes like for eg in the UniqueValuesTheme

 

public Dictionary<string, IStyle> StyleMap
        {
            get { return _styleMap; }
        }

 

The benefit of this is that the existing implementations will not be broken, and the interface will provide us with an easy way to support legend, theme editor etc. I may be on a wrong path here please correct me if I am wrong.