Пример #1
0
        private void _searchWindowClosed(object sender, EventArgs e)
        {
            MediaSearchViewmodel mvs = (MediaSearchViewmodel)sender;

            mvs.SearchWindowClosed -= _searchWindowClosed;
            mvs.MediaChoosen       -= _mediaSearchViewModelMediaChoosen;
            _mediaSearchViewModel.Dispose();
            _mediaSearchViewModel = null;
        }
Пример #2
0
 private void _chooseMedia(TMediaType mediaType, IEvent baseEvent, TStartType startType, VideoFormatDescription videoFormatDescription = null)
 {
     if (_mediaSearchViewModel == null)
     {
         _mediaSearchViewModel                     = new MediaSearchViewmodel(_engineViewModel.Engine, _event.Engine.MediaManager, mediaType, VideoLayer.Program, true, videoFormatDescription);
         _mediaSearchViewModel.BaseEvent           = baseEvent;
         _mediaSearchViewModel.NewEventStartType   = startType;
         _mediaSearchViewModel.MediaChoosen       += _mediaSearchViewModelMediaChoosen;
         _mediaSearchViewModel.SearchWindowClosed += _searchWindowClosed;
     }
 }
Пример #3
0
        private void _addLogo(object o)
        {
            var svm = _searchViewmodel;

            if (svm == null)
            {
                svm = new MediaSearchViewmodel(
                    null, // preview
                    MediaManager,
                    TMediaType.Still,
                    VideoLayer.CG1,
                    true, // close ater add
                    MediaExport.Media.FormatDescription());
                svm.MediaChoosen       += _searchMediaChoosen;
                svm.SearchWindowClosed += _searchWindowClosed;
                svm.ExecuteAction       = (e) =>
                {
                    _logos.Add(new ExportMediaLogoViewmodel(this, e.Media));
                    MediaExport.AddLogo(e.Media);
                };
                _searchViewmodel = svm;
            }
        }