Exemplo n.º 1
0
        public EffectsBuilder(IEffectContainer container)
            : base(container)
        {
            Guard.IsNotNull(container, "component");

            this.container = container;
        }
Exemplo n.º 2
0
        public EffectsBuilder(IEffectContainer container)
            : base(container)
        {
            Guard.IsNotNull(container, "component");

            this.container = container;
        }
        public EffectsBuilderBase(IEffectContainer container)
        {
            Guard.IsNotNull(container, "component");

            this.container = container;

            this.container.Container.Clear();
        }
Exemplo n.º 4
0
        public EffectsBuilderBase(IEffectContainer container)
        {
            Guard.IsNotNull(container, "component");

            this.container = container;

            this.container.Container.Clear();
        }
Exemplo n.º 5
0
 public Effect(IEffectContainer container, IAMTimelineObj timelineObj, string name, int priority, double offset,
               double duration,
               EffectDefinition effectDefinition)
 {
     _container = container;
     _timelineObj = timelineObj;
     _name = name;
     _priority = priority;
     _offset = offset;
     _duration = duration;
     _effectDefinition = effectDefinition;
 }
Exemplo n.º 6
0
 public Effect(IEffectContainer container, IAMTimelineObj timelineObj, string name, int priority, double offset,
               double duration,
               EffectDefinition effectDefinition)
 {
     _container        = container;
     _timelineObj      = timelineObj;
     _name             = name;
     _priority         = priority;
     _offset           = offset;
     _duration         = duration;
     _effectDefinition = effectDefinition;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Creates a des effect, wraps it into an IEffect, adds it to a collection
        /// and returns the new IEffect wrapper.
        /// </summary>
        /// <param name="desTimeline"></param>
        /// <param name="desEffectable"></param>
        /// <param name="effects"></param>
        /// <param name="name"></param>
        /// <param name="priority"></param>
        /// <param name="offset"></param>
        /// <param name="duration"></param>
        /// <param name="effectDefinition"></param>
        /// <returns></returns>
        internal static IEffect AddEffectToCollection(IEffectContainer container, IAMTimeline desTimeline,
                                                      IAMTimelineEffectable desEffectable,
                                                      AddOnlyList <IEffect> effects, string name, int priority,
                                                      double offset, double duration, EffectDefinition effectDefinition)
        {
            priority = ReorderPriorities(effects, priority);

            IAMTimelineObj desEffect =
                InsertEffect(desTimeline, desEffectable, name, priority, offset, duration, effectDefinition);

            IEffect effect = new Effect(container, desEffect, name, priority, offset, duration, effectDefinition);

            effects.Add(effect);

            return(effect);
        }
        public static void Serialize(this IClientSideObjectWriter objectWriter, string propertyName, IEffectContainer effects)
        {
            var effectSerialization = new List<string>();

            var propertyAnimations = new List<PropertyAnimation>();

            effects.Container.Each(e =>
            {
                if (e is PropertyAnimation)
                {
                    propertyAnimations.Add(e as PropertyAnimation);
                }
                else
                {
                    effectSerialization.Add(e.Serialize());
                }
            });

            if (propertyAnimations.Count > 0)
            {
                propertyAnimations.Each(e => effects.Container.Remove(e));

                var animatedProperties = new List<string>();

                propertyAnimations.Each(e =>
                    animatedProperties.Add(
                        e.AnimationType.ToString().ToLower(CultureInfo.InvariantCulture)));

                effectSerialization.Add(
                    String.Format("{{name:'property',properties:['{0}']}}",
                        String.Join("','", animatedProperties.ToArray())));
            }

            objectWriter.Append("{0}:{{list:[{1}],openDuration:{2},closeDuration:{3}}}".FormatWith(propertyName,
                                                                                   String.Join(",", effectSerialization.ToArray()),
                                                                                   effects.OpenDuration, effects.CloseDuration));
        }
 public WindowEffectsBuilder(IEffectContainer container) : base(container)
 {
     this.container = container;
 }
        public WindowEffectBuilderTests()
        {
            effects = new Effects();

            builder = new WindowEffectsBuilder(effects);
        }
 public EffectsBuilder Create(IEffectContainer container)
 {
     return(new EffectsBuilder(container));
 }
Exemplo n.º 12
0
        public static void Serialize(this IClientSideObjectWriter objectWriter, string propertyName, IEffectContainer effects)
        {
            var effectSerialization = new List <string>();

            var propertyAnimations = new List <PropertyAnimation>();

            effects.Container.Each(e =>
            {
                if (e is PropertyAnimation)
                {
                    propertyAnimations.Add(e as PropertyAnimation);
                }
                else
                {
                    effectSerialization.Add(e.Serialize());
                }
            });

            if (propertyAnimations.Count > 0)
            {
                propertyAnimations.Each(e => effects.Container.Remove(e));

                var animatedProperties = new List <string>();

                propertyAnimations.Each(e =>
                                        animatedProperties.Add(
                                            e.AnimationType.ToString().ToLower(CultureInfo.InvariantCulture)));

                effectSerialization.Add(
                    String.Format("{{name:'property',properties:['{0}']}}",
                                  String.Join("','", animatedProperties.ToArray())));
            }

            objectWriter.Append("{0}:{{list:[{1}],openDuration:{2},closeDuration:{3}}}".FormatWith(propertyName,
                                                                                                   String.Join(",", effectSerialization.ToArray()),
                                                                                                   effects.OpenDuration, effects.CloseDuration));
        }
 public EffectsBuilder Create(IEffectContainer container)
 {
     return new EffectsBuilder(container);
 }
 public WindowEffectsBuilder(IEffectContainer container)
     : base(container)
 {
     this.container = container;
 }
Exemplo n.º 15
0
        public EffectBuilderTests()
        {
            effects = new Effects();

            builder = new EffectsBuilder(effects);
        }