/// <summary> /// Найти соответствующее типу контрола оформление в теме /// </summary> /// <param name="Control">Контрол для которого ищется оформление</param> /// <param name="Theme">Тема в которой</param> /// <returns></returns> public static IAppearance FindAppearance(this IDefaultControl Control, ITheme Theme) { if (Theme.Sets == null) { return(null); } //Проходим весь набор форомлений для компонентов //Если находим подходящий для текущего элемента, то применяем его foreach (ControlType controlType in Theme.Sets.Keys) { IAppearance appearance = Theme.Sets[controlType]; if (controlType == ControlType.Caption && Control is ICaptionControl) { return(appearance); } if (controlType == ControlType.Buttons && Control is IButtonsControl) { return(appearance); } if (controlType == ControlType.Table && Control is ITableControl) { return(appearance); } if (controlType == ControlType.Detail && Control is IDetailControl) { return(appearance); } if (controlType == ControlType.Total && Control is ITotalControl) { return(appearance); } if (controlType == ControlType.Input && Control is IInputControl) { return(appearance); } if (controlType == ControlType.Status && Control is IStatusControl) { return(appearance); } if (controlType == ControlType.Default) { return(appearance); } } return(null); }
/// <summary> /// Обработка изменения темы /// </summary> /// <param name="theme"></param> void OnThemeChange(ITheme Theme) { IDefaultControl control = this as IDefaultControl; IAppearance appearance = control.FindAppearance(Theme); if (appearance != null) { this.SetAppearance(appearance); } }
public async Task UnitAppearance() { await Cluster.GrainFactory.GetGrain <IGame>(0).InitGame(); IEntity unit = await Cluster.GrainFactory.GetGrain <IPrefabManager>(0).Clone("test", "human.init"); await unit.Enable(); IAppearance appearance = await unit.Get <IAppearance>(); Assert.NotNull(appearance); AppearanceContainer container = await appearance.GetData(); Assert.NotEmpty(container.Appearances); }
public new void SetAppearance(IAppearance appearance) { base.SetAppearance(appearance); }
public void SetAppearance(IAppearance appearance) { //TODO Добавить обработку установки внешнего вида }
public new void SetAppearance(IAppearance appearance) { throw new System.NotImplementedException(); }
public void SetAppearance(IAppearance appearance) { this.WPFControl.SetAppearance(appearance); }
/// <summary> /// Получить шрифт /// </summary> /// <param name="appearence">Оформление для компонента</param> /// <param name="value">Строковое представление шрифта</param> /// <returns></returns> public static Font GetFont(this IAppearance appearence, string value) { //TODO Добавить парсинг параметра value в цвет return(SystemFonts.DefaultFont); }
/// <summary> /// Получить цвет /// </summary> /// <param name="appearence">Оформление для компонента</param> /// <param name="value">Строковое представление цвета</param> /// <returns></returns> public static Color GetColor(this IAppearance appearence, string value) { //TODO Добавить парсинг параметра value в цвет return(Color.Transparent); }