public void TestProject() { LMProject p = new LMProject(); p.Dashboard = LMDashboard.DefaultTemplate(10); p.UpdateEventTypesAndTimers(); p.LocalTeamTemplate = LMTeam.DefaultTemplate(10); p.VisitorTeamTemplate = LMTeam.DefaultTemplate(12); MediaFile mf = new MediaFile("path", 34000, 25, true, true, "mp4", "h264", "aac", 320, 240, 1.3, null, "Test asset"); var pd = new ProjectDescription(); pd.FileSet = new MediaFileSet(); pd.FileSet.Add(mf); p.Description = pd; p.AddEvent(new LMTimelineEvent()); storage.Store <LMProject> (p); Assert.AreEqual(45, db.DocumentCount); p = storage.RetrieveAll <LMProject> ().First(); Assert.IsNotNull(p.DocumentID); p.Load(); Assert.IsTrue(Object.ReferenceEquals(p.Description.FileSet, p.Timeline [0].FileSet)); storage.Store(p); Assert.AreEqual(45, db.DocumentCount); storage.Delete(p); Assert.AreEqual(1, db.DocumentCount); }
public void TestPreloadPropertiesArePreserved() { LMProject p1 = Utils.CreateProject(true); storage.Store(p1); LMProject p2 = storage.RetrieveAll <LMProject> ().First(); Assert.IsFalse(p2.IsLoaded); Assert.IsNotNull(p2.DocumentID); p2.Description.Competition = "NEW NAME"; p2.Load(); Assert.AreEqual("NEW NAME", p2.Description.Competition); storage.Store(p2); LMProject p3 = storage.RetrieveAll <LMProject> ().First(); Assert.IsNotNull(p3.DocumentID); Assert.AreEqual(p2.Description.Competition, p3.Description.Competition); }
void HandleResyncClicked(object sender, EventArgs e) { if (!loadedProject.Description.FileSet.CheckFiles()) { // Show message in order to load video. if (!gkit.SelectMediaFiles(loadedProject.Description.FileSet)) { return; } } loadedProject.Load(); App.Current.StateController.MoveTo(CameraSynchronizationEditorState.NAME, new LMProjectVM { Model = loadedProject }); edited = true; }