LongoMatch.Core.Store.ProjectLongoMatch.AddEvent C# (CSharp) Method

AddEvent() public method

public AddEvent ( EventType type, Time start, Time stop, Time eventTime, Image miniature, bool addToTimeline = true ) : TimelineEvent
type EventType
start Time
stop Time
eventTime Time
miniature Image
addToTimeline bool
return TimelineEvent
        public override TimelineEvent AddEvent(EventType type, Time start, Time stop, Time eventTime, Image miniature,
		                                        bool addToTimeline = true)
        {
            TimelineEventLongoMatch evt;
            string count;
            string name;

            count = String.Format ("{0:000}", EventsByType (type).Count + 1);
            name = String.Format ("{0} {1}", type.Name, count);
            evt = new TimelineEventLongoMatch ();

            evt.Name = name;
            evt.Start = start;
            evt.Stop = stop;
            evt.EventTime = eventTime;
            evt.EventType = type;
            evt.Notes = "";
            evt.Miniature = miniature;
            evt.CamerasConfig = new ObservableCollection<CameraConfig> { new CameraConfig (0) };
            evt.FileSet = Description.FileSet;
            evt.Project = this;

            if (addToTimeline) {
                Timeline.Add (evt);
            }

            if (addToTimeline) {
                if (evt.EventType is ScoreEventType) {
                    UpdateScore ();
                }
            }
            return evt;
        }

Same methods

ProjectLongoMatch::AddEvent ( TimelineEvent play ) : void

Usage Example

Example #1
0
        public void TestSerialization()
        {
            ProjectLongoMatch p = new ProjectLongoMatch ();

            Utils.CheckSerialization (p);

            p = CreateProject ();
            Utils.CheckSerialization (p);
            p.AddEvent (new TimelineEventLongoMatch ());
            Utils.CheckSerialization (p);

            ProjectLongoMatch newp = Utils.SerializeDeserialize (p);
            Assert.AreEqual (newp.CompareTo (p), 0);
            Assert.AreEqual (newp.Timeline.Count, p.Timeline.Count);
        }
All Usage Examples Of LongoMatch.Core.Store.ProjectLongoMatch::AddEvent