Exemple #1
0
        public string CopyCaptureToRemote(string localpath, Form window)
        {
            if (m_Remote != null)
            {
                bool  copied   = false;
                float progress = 0.0f;

                renderdocui.Windows.ProgressPopup modal =
                    new renderdocui.Windows.ProgressPopup(
                        (renderdocui.Windows.ModalCloseCallback)(() => { return(copied); }),
                        true);
                modal.SetModalText("Transferring...");

                Thread progressThread = Helpers.NewThread(new ThreadStart(() =>
                {
                    modal.LogfileProgressBegin();

                    while (!copied)
                    {
                        Thread.Sleep(2);

                        modal.LogfileProgress(progress);
                    }
                }));
                progressThread.Start();

                string remotepath = "";

                // we should never have the thread running at this point, but let's be safe.
                if (Running)
                {
                    BeginInvoke((ReplayRenderer r) =>
                    {
                        remotepath = m_Remote.CopyCaptureToRemote(localpath, ref progress);

                        copied = true;
                    });
                }
                else
                {
                    Helpers.NewThread(new ThreadStart(() =>
                    {
                        // prevent pings while copying off-thread
                        lock (m_Remote)
                        {
                            remotepath = m_Remote.CopyCaptureToRemote(localpath, ref progress);
                        }

                        copied = true;
                    })).Start();
                }

                modal.ShowDialog(window);

                return(remotepath);
            }

            // if we don't have a remote connection we can't copy
            throw new ApplicationException();
        }
Exemple #2
0
        public string CopyCaptureToRemote(string localpath, Form window)
        {
            if (m_Remote != null)
            {
                bool copied = false;
                float progress = 0.0f;

                renderdocui.Windows.ProgressPopup modal =
                    new renderdocui.Windows.ProgressPopup(
                        (renderdocui.Windows.ModalCloseCallback)(() => { return copied; }),
                        true);
                modal.SetModalText("Transferring...");

                Thread progressThread = Helpers.NewThread(new ThreadStart(() =>
                {
                    modal.LogfileProgressBegin();

                    while (!copied)
                    {
                        Thread.Sleep(2);

                        modal.LogfileProgress(progress);
                    }
                }));
                progressThread.Start();

                string remotepath = "";

                // we should never have the thread running at this point, but let's be safe.
                if (Running)
                {
                    BeginInvoke((ReplayRenderer r) =>
                    {
                        remotepath = m_Remote.CopyCaptureToRemote(localpath, ref progress);

                        copied = true;
                    });
                }
                else
                {
                    Helpers.NewThread(new ThreadStart(() =>
                    {
                        // prevent pings while copying off-thread
                        lock (m_Remote)
                        {
                            remotepath = m_Remote.CopyCaptureToRemote(localpath, ref progress);
                        }

                        copied = true;
                    })).Start();
                }

                modal.ShowDialog(window);

                return remotepath;
            }

            // if we don't have a remote connection we can't copy
            throw new ApplicationException();
        }
Exemple #3
0
        public void CopyCaptureFromRemote(string remotepath, string localpath, Form window)
        {
            if (m_Remote != null)
            {
                bool copied = false;
                float progress = 0.0f;

                renderdocui.Windows.ProgressPopup modal =
                    new renderdocui.Windows.ProgressPopup(
                        (renderdocui.Windows.ModalCloseCallback)(() => { return copied; }),
                        true);
                modal.SetModalText("Transferring...");

                Thread progressThread = Helpers.NewThread(new ThreadStart(() =>
                {
                    modal.LogfileProgressBegin();

                    while (!copied)
                    {
                        Thread.Sleep(2);

                        modal.LogfileProgress(progress);
                    }
                }));
                progressThread.Start();

                if (Running)
                {
                    BeginInvoke((ReplayRenderer r) =>
                    {
                        m_Remote.CopyCaptureFromRemote(remotepath, localpath, ref progress);

                        copied = true;
                    });
                }
                else
                {
                    Helpers.NewThread(new ThreadStart(() =>
                    {
                        // prevent pings while copying off-thread
                        lock (m_Remote)
                        {
                            m_Remote.CopyCaptureFromRemote(remotepath, localpath, ref progress);
                        }

                        copied = true;
                    })).Start();
                }

                modal.ShowDialog(window);

                // if the copy didn't succeed, throw
                if (!System.IO.File.Exists(localpath))
                    throw new System.IO.FileNotFoundException("File couldn't be transferred from remote host", remotepath);
            }
            else
            {
                System.IO.File.Copy(remotepath, localpath, true);
            }
        }
Exemple #4
0
        public void CopyCaptureFromRemote(string remotepath, string localpath, Form window)
        {
            if (m_Remote != null)
            {
                bool  copied   = false;
                float progress = 0.0f;

                renderdocui.Windows.ProgressPopup modal =
                    new renderdocui.Windows.ProgressPopup(
                        (renderdocui.Windows.ModalCloseCallback)(() => { return(copied); }),
                        true);
                modal.SetModalText("Transferring...");

                Thread progressThread = Helpers.NewThread(new ThreadStart(() =>
                {
                    modal.LogfileProgressBegin();

                    while (!copied)
                    {
                        Thread.Sleep(2);

                        modal.LogfileProgress(progress);
                    }
                }));
                progressThread.Start();

                if (Running)
                {
                    BeginInvoke((ReplayRenderer r) =>
                    {
                        m_Remote.CopyCaptureFromRemote(remotepath, localpath, ref progress);

                        copied = true;
                    });
                }
                else
                {
                    Helpers.NewThread(new ThreadStart(() =>
                    {
                        // prevent pings while copying off-thread
                        lock (m_Remote)
                        {
                            m_Remote.CopyCaptureFromRemote(remotepath, localpath, ref progress);
                        }

                        copied = true;
                    })).Start();
                }

                modal.ShowDialog(window);

                // if the copy didn't succeed, throw
                if (!System.IO.File.Exists(localpath))
                {
                    throw new System.IO.FileNotFoundException("File couldn't be transferred from remote host", remotepath);
                }
            }
            else
            {
                System.IO.File.Copy(remotepath, localpath, true);
            }
        }