internal Frame AdvanceFrame() { switch (SequenceCycleType) { case CycleType.PingPong: currentFrameIdx += curFrameIncrement; if ((currentFrameIdx <= 0) || (currentFrameIdx >= frameList.Count - 1)) { curFrameIncrement *= -1; } if (currentFrameIdx < 0) { currentFrameIdx = 0; } if (currentFrameIdx > frameList.Count - 1) { currentFrameIdx = frameList.Count - 1; } cycleFinished = false; break; case CycleType.Repeating: if (++currentFrameIdx >= frameList.Count) { currentFrameIdx = 0; } cycleFinished = false; break; case CycleType.Simple: if (++currentFrameIdx > frameList.Count - 1) { currentFrameIdx = frameList.Count - 1; cycleFinished = true; } else { cycleFinished = false; } break; default: throw new Exception("Invalid CycleType: " + SequenceCycleType.ToString()); } return(frameList[currentFrameIdx]); }
public override void SaveAdditionals(XmlWriter writer) { base.SaveAdditionals(writer); writer.WriteStartElement("RangeParameters"); writer.WriteAttributeString("MinimumValue", GetMinimumValueFormula()); writer.WriteAttributeString("MaximumValue", GetMaximumValueFormula()); if (EnableDefaultValue) { writer.WriteAttributeString("DefaultValue", GetDefaultValueFormula()); } writer.WriteAttributeString("Step", GetStepFormula()); writer.WriteAttributeString("GetValueFormula", GetReceiveValueFormula()); if (_cycleType != CycleType.None) { writer.WriteAttributeString("CycleType", _cycleType.ToString()); } writer.WriteEndElement(); }