Esempio n. 1
0
        public async void RequestContentUpdate(string[] previewPartIds)
        {
            Log.Instance.WriteMessage($"Requesting content update from memoQ.", SeverityOption.Info);
            if (!previewPartIds.Any())
            {
                return;
            }

            var request = new ContentUpdateRequestFromPreviewTool(previewPartIds, null);
            await ConnectViewModel.CallProxyMethod(new Func <RequestStatus>(() => previewServiceProxy?.RequestContentUpdate(request)));
        }
Esempio n. 2
0
        public async void RequestHighlightChange(SegmentPart segmentPart)
        {
            Log.Instance.WriteMessage($"Requesting highlight from memoQ.", SeverityOption.Info);
            var sourceFocusedRange = new FocusedRange(0, segmentPart.SourceContent.Length);
            var targetFocusedRange = new FocusedRange(0, segmentPart.TargetContent.Length);
            var request            = new ChangeHighlightRequestFromPreviewTool(segmentPart.PreviewPartId, segmentPart.SourceLangCode, segmentPart.TargetLangCode,
                                                                               segmentPart.SourceContent, segmentPart.TargetContent, sourceFocusedRange, targetFocusedRange);

            var requestStatus = await ConnectViewModel.CallProxyMethod(new Func <RequestStatus>(() => previewServiceProxy?.RequestHighlightChange(request)));

            if (requestStatus == null || !requestStatus.RequestAccepted)
            {
                ConnectViewModel.IsConnected = false;
            }
        }
Esempio n. 3
0
 public MainViewModel(IPreviewToolCallback previewToolCallback, Action stopVideoAction)
 {
     Settings.Instance.LoadSettings();
     try
     {
         previewServiceProxy = new PreviewServiceProxy(previewToolCallback, Settings.Instance.NamedPipeAddress, CommunicationProtocols.NamedPipe);
     }
     catch (PreviewServiceUnavailableException)
     {
         Log.Instance.WriteMessage(Log.PreviewUnavailableMessage, SeverityOption.Warning);
     }
     catch (NotSupportedException)
     {
         Settings.Instance.NamedPipeAddress = "MQ_PREVIEW_PIPE";
         Settings.Instance.SaveSettings();
         previewServiceProxy = new PreviewServiceProxy(previewToolCallback, Settings.Instance.NamedPipeAddress, CommunicationProtocols.NamedPipe);
     }
     ConnectViewModel = new ConnectViewModel(previewServiceProxy, previewToolCallback, stopVideoAction, false);
     VideoViewModel   = new VideoViewModel(previewServiceProxy);
 }
Esempio n. 4
0
 public void Disconnect()
 {
     ConnectViewModel.Disconnect();
 }
Esempio n. 5
0
 public void Connect()
 {
     ConnectViewModel.Connect();
 }