Exemplo n.º 1
0
        private void btnCommitWorkspace_Click(object sender, EventArgs e)
        {
            string path = @"E:\数字工厂数据\workspace.smwu";
            FTPControllerForWorkspacceForWorkspace ftp = new FTPControllerForWorkspacceForWorkspace();

            ftp.OnCommitCompleted += Ftp_OnCommitCompleted;
            ftp.OnCommitProcess   += Ftp_OnCommitProcess;
            if (!ftp.Exist(path))
            {
                ftp.Commit(path);
            }
            else
            {
                ftp.Delete(path);
                ftp.Commit(path);
            }
        }
        private void Workspace_Closed(object sender, WorkspaceClosedEventArgs args)
        {
            try
            {
                m_Count = 0;
                FTPControllerForWorkspacceForWorkspace ftp = new FTPControllerForWorkspacceForWorkspace();
                ftp.OnCommitCompleted += Ftp_OnCommitCompleted;
                ftp.OnCommitProcess   += Ftp_OnCommitProcess;
                ftp.Commit(m_WorkspacePath);
                m_TotleCount = ftp.CommitFilesCount;

                Application.ActiveApplication.Output.IsTimePrefixAdded = true;
                Application.ActiveApplication.Output.Visible           = true;

                Application.ActiveApplication.Workspace.Closed -= Workspace_Closed;
            }
            catch (Exception ex)
            {
                Log.OutputBox(ex);
            }
        }