Esempio n. 1
0
 //--------------------------------------------------------------------------------------------------------------------
 // Play Animation Sequence (Named, Specified Duration)
 //--------------------------------------------------------------------------------------------------------------------
 public void Play(string sequenceName, float duration)
 {
     if (Sequences.ContainsKey(sequenceName))
     {
         Sequence = Sequences[sequenceName];
         Play(duration);
     }
 }
Esempio n. 2
0
 //--------------------------------------------------------------------------------------------------------------------
 // Play Animation Sequence (Named)
 //--------------------------------------------------------------------------------------------------------------------
 public void Play(string sequenceName, bool loop = false)
 {
     if (Sequences.ContainsKey(sequenceName))
     {
         Sequence = Sequences[sequenceName];
         Play(loop);
     }
 }
Esempio n. 3
0
 public bool Remove(DateTimeOffset item)
 {
     if (Sequences.ContainsKey(item))
     {
         Sequences.Remove(item);
         return(true);
     }
     return(false);
 }
Esempio n. 4
0
 //--------------------------------------------------------------------------------------------------------------------
 // - Add/Set Named Animation Sequence
 //--------------------------------------------------------------------------------------------------------------------
 public void AddSequence(string name, List <uint> sequence)
 {
     if (sequence.Any())
     {
         // If the currently playing animation is being replaced, set the new sequence as the current active and Stop
         if (Sequences.ContainsKey(name) && Sequence == Sequences[name])
         {
             Sequence = sequence;
         }
         Sequences[name] = sequence;
     }
 }
Esempio n. 5
0
 public bool Contains(DateTimeOffset item)
 {
     return(Sequences.ContainsKey(item));
 }
Esempio n. 6
0
        //public Outline(QuoteCollection quotes, int threshold)
        //{
        //    Threshold = threshold;
        //    Sequences = TrendMarker.OutlineOf(quotes, threshold);
        //    Values = Sequences.Values.ToList();
        //    Max = Values.Max();
        //    Min = Values.Min();
        //    Dates = new List<double>();

        //    foreach (DateTimeOffset date in Sequences.Keys)
        //    {
        //        Dates.Add(date.UtcDateTime.ToOADate());
        //    }

        //    Pivots = new List<OutlineItem>();
        //    OutlineItem item = null;

        //    for (int i = 0; i < Count; i++)
        //    {
        //        item = new OutlineItem(Dates[i], Values[i], i, KindOf(i));
        //        if (item.Type == PivotType.Top || item.Type == PivotType.Bottom)
        //            Pivots.Add(item);
        //    }
        //}

        //public Outline(Outline baseOutline, int threshold)
        //{
        //    if (baseOutline.Threshold != 1)
        //        throw new Exception();

        //    Threshold = threshold;
        //    Sequences = TrendMarker.OutlineOf(baseOutline, threshold);
        //    Values = Sequences.Values.ToList();
        //    Max = Values.Max();
        //    Min = Values.Min();

        //    Dates = new List<double>();

        //    foreach (DateTimeOffset date in Sequences.Keys)
        //    {
        //        Dates.Add(date.UtcDateTime.ToOADate());
        //    }

        //    Pivots = new List<OutlineItem>();
        //    OutlineItem item = null;

        //    for (int i = 0; i < Count; i ++ )
        //    {
        //        item = new OutlineItem(Dates[i], Values[i], i, KindOf(i));
        //        if (item.Type == PivotType.Top || item.Type == PivotType.Bottom)
        //            Pivots.Add(item);
        //    }
        //}

        #endregion

        #region Indexer
        public Double this[DateTimeOffset date]
        {
            get { return(Sequences.ContainsKey(date) ? Sequences[date] : Double.MinValue); }
        }
 public bool HasSequence(string unitName)
 {
     return(sequences.ContainsKey(unitName));
 }