コード例 #1
0
 private void Delete(Lowerthird lowerthird)
 {
     Lowerthirds.Remove(lowerthird);
     if (lowerthird.IsActive)
     {
         Deactivate();
     }
 }
コード例 #2
0
 public async void Deactivate()
 {
     if (await casparCGService.SendCommandsAsync(placeholder.ReplacePlaceholders(configuration.LowerthirdsDeactivateCommands, currentlyActive)))
     {
         currentlyActive.IsActive = false;
         currentlyActive          = null;
         DeactivateCommand.RaiseCanExecuteChanged();
         ActivateCommand.RaiseCanExecuteChanged();
     }
 }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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;
            }
        }
コード例 #5
0
        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();
            }
        }