private void SetupMarks() { if (MarkCollections == null || !MarkCollections.Any()) { LipSyncMode = LipSyncMode.Phoneme; return; } if (string.IsNullOrEmpty(MarkCollectionId)) { var dmc = MarkCollections.FirstOrDefault(x => x.CollectionType == MarkCollectionType.Phoneme); if (dmc != null && string.IsNullOrEmpty(MarkCollectionId)) { MarkCollectionId = dmc.Name; } } IMarkCollection mc = MarkCollections.FirstOrDefault(x => x.Id == _data.MarkCollectionId); if (mc != null) { _marks = mc.MarksInclusiveOfTime(StartTime, StartTime + TimeSpan); } else { _marks = new List <IMark>(); } }
/// <summary> /// Method to invoke when the AddCollection command is executed. /// </summary> private void AddCollection() { var mc = new MarkCollection(); if (!MarkCollections.Any()) { mc.IsDefault = true; } MarkCollections.Add(mc); }
/// <summary> /// Gets the mark collection with the specified Guid. /// </summary> private IMarkCollection GetMarkCollection(Guid markCollectionGuid) { IMarkCollection markCollection = null; // If the mark collection contains the specified Guid then... if (MarkCollections.Any(item => item.Id == markCollectionGuid)) { // Find the specified mark collection markCollection = MarkCollections.First(item => item.Id == markCollectionGuid); } return(markCollection); }
/// <summary> /// Updates the selected mark collection drop down. /// This method allows for the associated mark collection to be renamed. /// </summary> public void UpdateSelectedMarkCollectionName() { // If the selected mark collection no longer exists then... if (MarkCollections != null && !MarkCollections.Any(mc => mc.Id == _markCollectionId)) { // Make the mark collection drop down blank MarkCollectionId = new Guid(); } OnPropertyChanged("MarkCollections"); OnPropertyChanged("MarkCollectionName"); }
/// <summary> /// Method to check whether the ToggleMarkBarState command can be executed. /// </summary> /// <returns><c>true</c> if the command can be executed; otherwise <c>false</c></returns> private bool CanToggleMarkBarState() { return(MarkCollections.Any()); }
/// <summary> /// Method to check whether the ExportCollection command can be executed. /// </summary> /// <returns><c>true</c> if the command can be executed; otherwise <c>false</c></returns> private bool CanExportCollection() { return(MarkCollections.Any()); }