private bool ValidateBeforeSave()
        {
            if (_playItemCollection.GetStopTime().Value < DateTime.Now.AddMinutes(5))
            {
                this.RaiseDisplayMessageInteractionRequest(
                    "错误",
                    "不能保存时间已经过期或即将过期的节目单。");
                return(false);
            }

            for (int i = 0; i < _playItemCollection.Count; i++)
            {
                BindablePlayItem item = _playItemCollection[i];
                if (!item.Skipped() && item.PlayDuration < _playoutConfig.MinPlayDuration)
                {
                    this.RaiseDisplayMessageInteractionRequest(
                        "错误",
                        string.Format("播放项{0}的时长太短,最低时长不能小于{1},请修复错误后再保存。", item.Title, _playoutConfig.MinPlayDuration));
                    return(false);
                }
            }

            //TODO: 是否需要一些其他提示?
            return(true);
        }
Exemple #2
0
 private void GainMenuItem_SubmenuOpened(object sender, RoutedEventArgs e)
 {
     if (ctxMenu.Tag != null)
     {
         BindablePlayItem item     = ctxMenu.Tag as BindablePlayItem;
         MenuItem         menuItem = (MenuItem)sender;
         if (item != null && object.Equals(menuItem.Tag, "Gain"))
         {
             var audioGain = item.AudioGain; //.Parameters.AudioGain;
             foreach (MenuItem subItem in menuItem.Items)
             {
                 subItem.IsChecked = audioGain == int.Parse(subItem.Tag.ToString());
             }
         }
     }
 }
Exemple #3
0
        private void GainMenuItem_Click(object sender, RoutedEventArgs e)
        {
            if (ctxMenu.Tag != null)
            {
                BindablePlayItem item     = ctxMenu.Tag as BindablePlayItem;
                MenuItem         menuItem = e.Source as MenuItem;

                if (item != null && menuItem != null)
                {
                    try
                    {
                        int volume = int.Parse(menuItem.Tag.ToString());
                        //TODO: 修改AudioGain

                        //item.Parameters.AudioGain = volume;
                    }
                    catch
                    {
                    }
                }
            }
        }