public void Attach(ElementSelector selector, Action<StylingRule, double> ruleSet, AnimationSpan span) { var style = new StylingRule(); ResolveSelector(selector, style); stylingrules.Add((time) => { ruleSet(style, time); span.Update(time); }); span.OnAnimationEnd += (sender, args) => stylingrules.RemoveAt(stylingrules.Count - 1); }
public void Attach(IGuiElement element, Action<StylingRule, double> ruleSet, AnimationSpan span) { var style = new StylingRule(); AddElement(element, style, SelectorPriority.Default); stylingrules.Add((time) => { ruleSet(style, time); span.Update(time); }); span.OnAnimationEnd += (sender, args) => stylingrules.RemoveAt(stylingrules.Count - 1); }
private void JoinHelper(StylingRule dominantRule, StylingRule rule) { if (dominantRule == null || rule == null) { throw new NotSupportedException(); } XProvider = dominantRule.XProvider ?? rule.XProvider; YProvider = dominantRule.YProvider ?? rule.YProvider; WidthProvider = dominantRule.WidthProvider ?? rule.WidthProvider; HeightProvider = dominantRule.HeightProvider ?? HeightProvider; BackgroundImageProvider = dominantRule.BackgroundImageProvider ?? rule.BackgroundImageProvider; FontProvider = dominantRule.FontProvider ?? rule.FontProvider; BackgroundColorProvider = dominantRule.BackgroundColorProvider ?? rule.BackgroundColorProvider; TextColorProvider = dominantRule.TextColorProvider ?? rule.TextColorProvider; TextProvider = dominantRule.TextProvider ?? rule.TextProvider; PaddingProvider = dominantRule.PaddingProvider ?? rule.PaddingProvider; BorderProvider = dominantRule.BorderProvider ?? rule.BorderProvider; MarginProvider = dominantRule.MarginProvider ?? rule.MarginProvider; AlignmentProvider = dominantRule.AlignmentProvider ?? rule.AlignmentProvider; }
public void Attach(ElementSelector selector, Action<StylingRule> ruleSet) { var style = new StylingRule(); ResolveSelector(selector, style); ruleSet(style); }
public void Attach(IGuiElement element, Action<StylingRule> ruleSet) { var style = new StylingRule(); AddElement(element, style, SelectorPriority.Default); ruleSet(style); }