MonoGameUi.Control.ApplySkin C# (CSharp) Method

ApplySkin() protected method

protected ApplySkin ( Type type ) : void
type System.Type
return void
        protected void ApplySkin(Type type)
        {
            // ControlSkin-Loader
            if (Skin.Current != null &&
                Skin.Current.ControlSkins != null)
            {
                // Generische Datentypen
                TypeInfo info = type.GetTypeInfo();
                if (info.IsGenericType && Skin.Current.ControlSkins.ContainsKey(type.GetGenericTypeDefinition()))
                    Skin.Current.ControlSkins[type.GetGenericTypeDefinition()](this);

                // Konkrete Datentypen
                if (Skin.Current.ControlSkins.ContainsKey(type))
                    Skin.Current.ControlSkins[type](this);
            }

            // StyleSkin-Loader
            if (!string.IsNullOrEmpty(Style) && // Nur wenn der Style gesetzt ist
                type == GetType() &&            // Nur wenn der Type == dem Type des Controls entspricht (bedeutet der letzte Aufruf auf ApplySkin)
                Skin.Current != null &&
                Skin.Current.StyleSkins != null &&
                Skin.Current.StyleSkins.ContainsKey(Style))
            {
                Skin.Current.StyleSkins[Style](this);
            }
        }