public ImportInfoProxy(IRemoteUrl ui) { _ui = ui; _imgBytes = imageToBytes(Resources.DefaultThumbnail); if (!string.IsNullOrWhiteSpace(ui.LocalPath)) { _proxy = new VideoDataInfoProxy(); _proxy.TreeNodesReceived += proxy_TreeNodesReceived; _proxy.MessageReceived += proxy_MessageReceived; _proxy.UpdateSource(new VideoDataSource() { SrcType = SourceType.Local, LocalSourcePath = ui.LocalPath }); try { _proxy.GetVideoTreeNodesAsync(); } catch (Exception ex) { Logger.Default.Error("获取视频信息失败!", ex); string msg = "获取视频信息失败!\n" + ex.Message; DialogUtil.ShowError(msg); } } else { buildNodeRoot(ui.VideoInfos); } }
public void UpdateSource(VideoDataSource src) { _diProxy.UpdateSource(src); if (src.SrcType == SourceType.Local) { try { _diProxy.GetVideoTreeNodesAsync(); } catch (Exception ex) { Logger.Default.Error("刷新本地数据源视频录像信息失败!", ex); string msg = "刷新本地数据源视频录像信息失败!\n" + ex.Message; DialogUtil.ShowError(msg); return; } } RefreshVideoDataSummary(); }
public LocalInfoProxy(string localPath) { _src = new VideoDataSource() { SrcType = SourceType.Local, LocalSourcePath = localPath }; _imgBytes = imageToBytes(Resources.DefaultThumbnail); _proxy = new VideoDataInfoProxy(); _proxy.TreeNodesReceived += proxy_TreeNodesReceived; _proxy.MessageReceived += proxy_MessageReceived; _proxy.UpdateSource(_src); try { _proxy.GetVideoTreeNodesAsync(); } catch (Exception e) { Logger.Default.Error("加载本地视频信息失败!", e); string msg = "加载本地视频信息失败!\n" + e.Message; DialogUtil.ShowError(msg); } }