SilverlightMappingToolBasic.ThemeManager.GetSkin C# (CSharp) Method

GetSkin() public method

public GetSkin ( INodeTypeProxy nodeTypeProxy, string skinName ) : INodeSkin
nodeTypeProxy INodeTypeProxy
skinName string
return INodeSkin
        public INodeSkin GetSkin(INodeTypeProxy nodeTypeProxy, string skinName)
        {
            //Dictionary<INodeTypeProxy, Dictionary<string, INodeSkin>> nodeTypes = _themes[_currentThemeName];
            //Dictionary<string, INodeSkin> nodeSkins = nodeTypes[nodeTypeProxy];

            foreach (ThemeSkin skin in _themes2[_currentThemeName].Skin)
            {
                if (skin.Name == skinName && skin.NodeType == nodeTypeProxy.Name)
                {
                    object skinObject = Assembly.GetExecutingAssembly().CreateInstance(skin.Class);
                    if (skinObject is INodeSkin)
                    {
                        INodeSkin skinObj = skinObject as INodeSkin;
                        foreach (ThemeSkinProperty skinProperty in skin.Property)
                        {
                            skinObj.SkinProperties[skinProperty.Name] = skinProperty.Value;
                        }
                        return skinObj;
                    }
                }
            }
            return null;
            //INodeSkin nodeSkin = nodeSkins[skinName];

           // return nodeSkin;
        }

Usage Example

Ejemplo n.º 1
0
        public NodeRenderer(NavigatorView parentNavigatorView, INodeProxy nodeProxy, ThemeManager themeManager, string skinName)
            : this()
        {
            Node = nodeProxy;
            ParentNavigatorView   = parentNavigatorView;
            ThemeManagementObject = themeManager;

            SkinName = skinName;
            Skin     = ThemeManagementObject.GetSkin(Node.NodeType, SkinName);

            this.Loaded += new RoutedEventHandler(OnLoaded);

            this.MouseLeftButtonDown += new MouseButtonEventHandler(OnMouseLeftButtonDown);
            this.MouseLeftButtonUp   += new MouseButtonEventHandler(OnMouseLeftButtonUp);
            this.MouseMove           += new MouseEventHandler(OnMouseMove);
        }