public void SetColor(int?type) { if (type.HasValue) { var info = ColorInfos.FirstOrDefault(x => x.Type == type.Value); if (info != null) { selection = Convert.ToInt32(type); if (text != null) { component.color = info.Color; } } else { selection = null; } } else { selection = null; } }
public void SetColor(int?type) { if (type.HasValue) { var info = ColorInfos.FirstOrDefault(x => x.Type == type.Value); if (info != null) { selection = Convert.ToInt32(type); if (text != null) { component.color = info.Color; } //====== Shadow ====== if (Shadow != null) { Shadow.enabled = info.ShadowColor.HasValue; if (info.ShadowColor.HasValue) { Shadow.SetColor(info.ShadowColor.Value); } } //====== Drop Shadow ====== if (RichShadow != null) { RichShadow.enabled = info.ShadowColor.HasValue; if (info.ShadowColor.HasValue) { RichShadow.effectColor = info.ShadowColor.Value; } } //====== Outline ====== if (Outline != null) { Outline.enabled = info.OutlineColor.HasValue; if (info.OutlineColor.HasValue) { Outline.SetColor(info.OutlineColor.Value); } } //====== RichOutline ====== if (RichOutline != null) { RichOutline.enabled = info.OutlineColor.HasValue; if (info.OutlineColor.HasValue) { RichOutline.effectColor = info.OutlineColor.Value; } } } else { selection = null; } } else { selection = null; } }