Exemple #1
0
 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);
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 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;
 }
Exemple #4
0
 public void Attach(ElementSelector selector, Action<StylingRule> ruleSet)
 {
     var style = new StylingRule();
     ResolveSelector(selector, style);
     ruleSet(style);
 }
Exemple #5
0
 public void Attach(IGuiElement element, Action<StylingRule> ruleSet)
 {
     var style = new StylingRule();
     AddElement(element, style, SelectorPriority.Default);
     ruleSet(style);
 }