/// <summary>Parses a <seealso cref="GuidelineEditorPresetEvent"/> from raw data.</summary> /// <param name="s">The raw data of the event that will be parsed.</param> /// <param name="patternPool">The pattern pool from which to retrieve the pattern object that is referred.</param> public static GuidelineEditorPresetEvent Parse(string s, List <GuidelineEditorPresetPattern> patternPool) { var split = s.Split(", "); var position = MeasuredTimePosition.Parse(split[0]); var duration = MeasuredDuration.Parse(split[1]); var eventInfo = GuidelineEditorPresetEventPatternInfo.Parse($"{split[2]}, {split[3]}", patternPool); return(new GuidelineEditorPresetEvent(position, eventInfo, duration)); }
/// <summary>Initializes a new instance of the <seealso cref="GuidelineEditorPresetEvent"/> class from a given time position, event pattern info and duration.</summary> /// <param name="timePosition">The starting time position of the pattern.</param> /// <param name="eventPatternInfo">The <seealso cref="GuidelineEditorPresetEventPatternInfo"/> to use in the event.</param> /// <param name="duration">The duration of the event.</param> public GuidelineEditorPresetEvent(MeasuredTimePosition timePosition, GuidelineEditorPresetEventPatternInfo eventPatternInfo, MeasuredDuration duration) { TimePosition = timePosition; Duration = duration; EventPatternInfo = eventPatternInfo; }
/// <summary>Initializes a new instance of the <seealso cref="GuidelineEditorPresetEvent"/> class from a given time position and event pattern info. The event's duration defaults to the pattern's measure count.</summary> /// <param name="timePosition">The starting time position of the pattern.</param> /// <param name="eventPatternInfo">The <seealso cref="GuidelineEditorPresetEventPatternInfo"/> to use in the event.</param> public GuidelineEditorPresetEvent(MeasuredTimePosition timePosition, GuidelineEditorPresetEventPatternInfo eventPatternInfo) : this(timePosition, eventPatternInfo, new MeasuredDuration(eventPatternInfo.Pattern.Measures.Count)) { }