private void Delete(Lowerthird lowerthird) { Lowerthirds.Remove(lowerthird); if (lowerthird.IsActive) { Deactivate(); } }
public async void Deactivate() { if (await casparCGService.SendCommandsAsync(placeholder.ReplacePlaceholders(configuration.LowerthirdsDeactivateCommands, currentlyActive))) { currentlyActive.IsActive = false; currentlyActive = null; DeactivateCommand.RaiseCanExecuteChanged(); ActivateCommand.RaiseCanExecuteChanged(); } }
private void Edit(Lowerthird lowerthird) { Confirmation confirmation = new Confirmation() { Content = lowerthird, Title = "" }; EditDialogRequest.Raise(confirmation); placeholder.Placeholders[lowerthird.Title] = lowerthird.Text; if (lowerthird.IsActive) { Activate(lowerthird); } }
private void Add() { Lowerthird lowerthird = new Lowerthird(); Confirmation confirmation = new Confirmation() { Content = lowerthird, Title = "" }; EditDialogRequest.Raise(confirmation); if (confirmation.Confirmed) { Lowerthirds.Add(lowerthird); placeholder.Placeholders[lowerthird.Title] = lowerthird.Text; } }
public async void Activate(Lowerthird lowerthird) { bool worked; if (currentlyActive != null) { if (worked = await casparCGService.SendCommandsAsync(placeholder.ReplacePlaceholders(configuration.LowerthirdsChangeCommands, lowerthird))) { currentlyActive.IsActive = false; } } else { worked = await casparCGService.SendCommandsAsync(placeholder.ReplacePlaceholders(configuration.LowerthirdsActivateCommands, lowerthird)); } if (worked) { currentlyActive = lowerthird; lowerthird.IsActive = true; DeactivateCommand.RaiseCanExecuteChanged(); ActivateCommand.RaiseCanExecuteChanged(); } }