コード例 #1
0
 public void RefreshCommandList(int idx)
 {
     ListCurrentSelectedCommands.Clear();
     foreach (var i in Config.Instance.PlayList[idx].Commands)
     {
         ListCurrentSelectedCommands.Add(i);
     }
 }
コード例 #2
0
 public void StartRecording()
 {
     NeedSave = true;
     EnableCommandList.Value = false;
     EnableFileList.Value    = false;
     EnableSettings.Value    = false;
     EnablePlayButton        = false;
     IsRecording             = true;
     ListCurrentSelectedCommands.Clear();
     cn.log("録画開始");
 }
コード例 #3
0
        public void RemovePlayList()
        {
            NeedSave = true;
            InterceptInput.EnableKeyInput = false;
            var idx    = SelectedIndexPlayName;
            var result = MessageBox.Show(Application.Current.MainWindow, $"Are you sure remove a \"{ListPlayListNames[idx]}\"", "Confirm", MessageBoxButton.OKCancel, MessageBoxImage.Question);

            if (result == MessageBoxResult.OK)
            {
                Config.Instance.PlayList.RemoveAt(idx);
                ListPlayListNames.RemoveAt(idx);
                ListCurrentSelectedCommands.Clear();
            }
            InterceptInput.EnableKeyInput = true;
        }
コード例 #4
0
 public string DuplicatePlayList(int srcIndex)
 {
     NeedSave = true;
     if (0 <= srcIndex)
     {
         var copy_name = ListPlayListNames[srcIndex] + "_copy";
         Config.Instance.PlayList.Insert(srcIndex, new PlayData {
             Name = copy_name, Commands = ListCurrentSelectedCommands.ToArray()
         });
         ListPlayListNames.Insert(srcIndex, copy_name);
         SelectedIndexPlayName = srcIndex;
         return(copy_name);
     }
     return(null);
 }
コード例 #5
0
 public void StopRecodring(int selIndex)
 {
     if (!IsRecording)
     {
         return;
     }
     if (selIndex < 0 || ListPlayListNames.Count <= selIndex)
     {
         return;
     }
     EnableCommandList.Value = true;
     EnableFileList.Value    = true;
     EnableSettings.Value    = true;
     EnablePlayButton        = true;
     IsRecording             = false;
     Config.Instance.PlayList[selIndex].Commands = ListCurrentSelectedCommands.ToArray();
     cn.log("録画終了");
 }
コード例 #6
0
 public void Init()
 {
     if (Config.Instance.PlayList.Any())
     {
         var play_list = Config.Instance.PlayList;
         for (int i = 0; i < play_list.Count; ++i)
         {
             ListPlayListNames.Add(play_list[i].Name);
             foreach (var jj in play_list[i].Commands)
             {
                 ListCurrentSelectedCommands.Add(jj);
             }
         }
     }
     NotifyPropertyChanged(nameof(EnablePlayButton));
     RepeatCount.Subscribe(_ => {
         NotifyPropertyChanged("RepeatIntervalEnabled");
     });
     CaptureInterval.Value = Config.Instance.CaptureInterval;
     //RepeatInterval.Value = Config.Instance.RepeatInterval;
 }
コード例 #7
0
 public void AddCommand(CommandChunk newItem)
 {
     ListCurrentSelectedCommands.Add(newItem);
 }