示例#1
0
        public async Task <bool> ChangeFrame(TimeSpan time, VideoActionType afterVideoActionType)
        {
            await DispatcherHelper.UIDispatcher.InvokeAsync(() =>
            {
                var mediaElement = ((MainView)Application.Current.MainWindow).Vc;
                mediaElement.ChangeFrame(time);
                switch (afterVideoActionType)
                {
                case VideoActionType.Play:
                    mediaElement.Play();
                    break;

                case VideoActionType.Pause:
                    mediaElement.Play();
                    mediaElement.Pause();
                    break;

                case VideoActionType.Stop:
                    mediaElement.Play();
                    mediaElement.Stop();
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(afterVideoActionType), afterVideoActionType, null);
                }
            });

            return(true);
        }
示例#2
0
        public static async Task <bool> ChangeFrame(TimeSpan time, VideoActionType afterVideoActionType, string serviceAddress)
        {
            var notificationService = new NetTcpWcfClientService <ITLVideo>(serviceAddress);

            RegWcfEvents(notificationService);
            var result = await notificationService.SendAsync(async proxy => await proxy.ChangeFrame(time, afterVideoActionType));

            UnregWcfEvents(notificationService);
            return(result);
        }
示例#3
0
        public static async Task <bool> InvokerAction(VideoActionType videoActionType, string serviceAddress)
        {
            var notificationService = new NetTcpWcfClientService <ITLVideo>(serviceAddress);

            RegWcfEvents(notificationService);
            var result = await notificationService.SendAsync(async proxy => await proxy.InvokerAction(videoActionType));

            UnregWcfEvents(notificationService);
            return(result);
        }