コード例 #1
0
        private void PlayBtn_Click(object sender, RoutedEventArgs e)
        {
            // XP: avoid message "Could not establish trust relationship for SSL/TLS secure channel"
            // Packager.exe -Play doesn't work on XP: "CHttpClient:SetLocation: InternetOpenUrl failed, LE=12031"
            if (Environment.OSVersion.Version.Major == 5)
            {
                MessageBox.Show("Playing apps is not supported on Windows XP");
                return;
            }

            borderMain.Opacity = 0.3;
            var playing = new Playing((AppDisplay)lvApps.SelectedItem, Playing.AppAction.Play, null);

            playing.Owner = this;
            playing.ShowDialog();
            borderMain.Opacity = 1;
        }
コード例 #2
0
        void StartRdpCapturePlay(object data)
        {
            var resp = (string)data;

            // Transmit resulting JSON to Packager
            var rdpAuthJsonFile = System.IO.Path.GetTempFileName();
            var rdpAuth         = ServerClient.DeserializeJson <RdpAuthData>(resp);

            if (rdpAuth == null)
            {
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
                {
                    DisplayError("Failed starting session.");
                }));
                return;
            }
            string rdpTokenId = rdpAuth.parameters.rdp_token;

            File.WriteAllText(rdpAuthJsonFile, resp);   // Transmit to Packager, he'll know what to do with it...

            // Start Play session
            Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
            {
                borderMain.Opacity = 0.3;
                var serverApp      = new ServerApp()
                {
                    PkgId = rdpAuthJsonFile
                };
                var appDisplay = new AppDisplay(serverApp);
                var playing    = new Playing(appDisplay, Playing.AppAction.Play, null);
                playing.Owner  = this;
                playing.ShowDialog();
                borderMain.Opacity = 1;
            }));

            // Wait for resulting package or failure
            var thread = new Thread(new ParameterizedThreadStart(WaitForRdpCapturePkg));

            thread.Start(rdpTokenId);
            //WaitForRdpCapturePkg(rdpTokenId);
            //Close();
        }
コード例 #3
0
ファイル: MainWindow.xaml.cs プロジェクト: Rorymon/cameyo
        private void PlayBtn_Click(object sender, RoutedEventArgs e)
        {
            // XP: avoid message "Could not establish trust relationship for SSL/TLS secure channel"
            // Packager.exe -Play doesn't work on XP: "CHttpClient:SetLocation: InternetOpenUrl failed, LE=12031"
            if (Environment.OSVersion.Version.Major == 5)
            {
                MessageBox.Show("Playing apps is not supported on Windows XP");
                return;
            }

            borderMain.Opacity = 0.3;
            var playing = new Playing((AppDisplay)lvApps.SelectedItem, Playing.AppAction.Play, null);
            playing.Owner = this;
            playing.ShowDialog();
            borderMain.Opacity = 1;
        }
コード例 #4
0
ファイル: PkgCreateWin.xaml.cs プロジェクト: Rorymon/cameyo
        void StartRdpCapturePlay(object data)
        {
            var resp = (string)data;

            // Transmit resulting JSON to Packager
            var rdpAuthJsonFile = System.IO.Path.GetTempFileName();
            var rdpAuth = ServerClient.DeserializeJson<RdpAuthData>(resp);
            if (rdpAuth == null)
            {
                Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
                {
                    DisplayError("Failed starting session.");
                }));
                return;
            }
            string rdpTokenId = rdpAuth.parameters.rdp_token;
            File.WriteAllText(rdpAuthJsonFile, resp);   // Transmit to Packager, he'll know what to do with it...

            // Start Play session
            Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(() =>
            {
                borderMain.Opacity = 0.3;
                var serverApp = new ServerApp() { PkgId = rdpAuthJsonFile };
                var appDisplay = new AppDisplay(serverApp);
                var playing = new Playing(appDisplay, Playing.AppAction.Play, null);
                playing.Owner = this;
                playing.ShowDialog();
                borderMain.Opacity = 1;
            }));

            // Wait for resulting package or failure
            var thread = new Thread(new ParameterizedThreadStart(WaitForRdpCapturePkg));
            thread.Start(rdpTokenId);
            //WaitForRdpCapturePkg(rdpTokenId);
            //Close();
        }