Checkout() public method

public Checkout ( FilePath targetLocalPath, MonoDevelop.VersionControl.Revision rev, bool recurse, MonoDevelop.Core.ProgressMonitor monitor ) : void
targetLocalPath FilePath
rev MonoDevelop.VersionControl.Revision
recurse bool
monitor MonoDevelop.Core.ProgressMonitor
return void
Exemplo n.º 1
0
        protected override void Run()
        {
            if (System.IO.Directory.Exists(path))
            {
                if (MessageService.AskQuestion(GettextCatalog.GetString(
                                                   "Checkout path is not empty. Do you want to delete its contents?"),
                                               path,
                                               AlertButton.Cancel,
                                               AlertButton.Ok) == AlertButton.Cancel)
                {
                    return;
                }
                FileService.DeleteDirectory(path);
            }

            vc.Checkout(path, null, true, Monitor);
            if (Monitor.IsCancelRequested)
            {
                Monitor.ReportSuccess(GettextCatalog.GetString("Checkout operation cancelled"));
                return;
            }

            if (!System.IO.Directory.Exists(path))
            {
                Monitor.ReportError(GettextCatalog.GetString("Checkout folder does not exist"), null);
                return;
            }

            string projectFn = null;

            string[] list = System.IO.Directory.GetFiles(path);
            if (projectFn == null)
            {
                foreach (string str in list)
                {
                    if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile(str))
                    {
                        projectFn = str;
                        break;
                    }
                }
            }

            if (projectFn != null)
            {
                DispatchService.GuiDispatch(delegate {
                    IdeApp.Workspace.OpenWorkspaceItem(projectFn);
                });
            }

            Monitor.ReportSuccess(GettextCatalog.GetString("Solution checked out"));
        }
Exemplo n.º 2
0
            protected override void Run()
            {
                if (System.IO.Directory.Exists(path) && System.IO.Directory.EnumerateFileSystemEntries(path).Any())
                {
                    if (MessageService.AskQuestion(GettextCatalog.GetString(
                                                       "Checkout path is not empty. Do you want to delete its contents?"),
                                                   path,
                                                   AlertButton.Cancel,
                                                   AlertButton.Ok) == AlertButton.Cancel)
                    {
                        return;
                    }
                    FileService.DeleteDirectory(path);
                    FileService.CreateDirectory(path);
                }

                try {
                    vc.Checkout(path, null, true, Monitor);
                } catch (VersionControlException e) {
                    Monitor.ReportError(e.Message, null);
                    return;
                }

                if (Monitor.CancellationToken.IsCancellationRequested)
                {
                    Monitor.ReportSuccess(GettextCatalog.GetString("Checkout operation cancelled"));
                    return;
                }

                if (!System.IO.Directory.Exists(path))
                {
                    Monitor.ReportError(GettextCatalog.GetString("Checkout folder does not exist"), null);
                    return;
                }

                foreach (string str in System.IO.Directory.EnumerateFiles(path, "*", System.IO.SearchOption.AllDirectories))
                {
                    if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile(str))
                    {
                        Runtime.RunInMainThread(delegate {
                            IdeApp.Workspace.OpenWorkspaceItem(str);
                        });
                        break;
                    }
                }

                Monitor.ReportSuccess(GettextCatalog.GetString("Solution checked out"));
            }
Exemplo n.º 3
0
        protected override void Run()
        {
            vc.Checkout(path, null, true, Monitor);
            string projectFn = null;

            string[] list = System.IO.Directory.GetFiles(path);
            foreach (string str in list)
            {
                if (str.EndsWith(".mds"))
                {
                    projectFn = str;
                    break;
                }
            }
            if (projectFn == null)
            {
                foreach (string str in list)
                {
                    if (str.EndsWith(".mdp"))
                    {
                        projectFn = str;
                        break;
                    }
                }
            }
            if (projectFn == null)
            {
                foreach (string str in list)
                {
                    if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile(str))
                    {
                        projectFn = str;
                        break;
                    }
                }
            }

            if (projectFn != null)
            {
                DispatchService.GuiDispatch(delegate
                {
                    IdeApp.Workspace.OpenWorkspaceItem(projectFn);
                });
            }

            Monitor.ReportSuccess(GettextCatalog.GetString("Solution checked out"));
        }
Exemplo n.º 4
0
            protected override void Run()
            {
                if (System.IO.Directory.Exists(path) && System.IO.Directory.EnumerateFileSystemEntries(path).Any())
                {
                    var result = Runtime.RunInMainThread(() => AskForCheckoutPath()).Result;
                    if (result == AlertButton.Cancel)
                    {
                        return;
                    }

                    FileService.DeleteDirectory(path);
                    FileService.CreateDirectory(path);
                }

                vc.Checkout(path, null, true, Monitor);

                if (Monitor.CancellationToken.IsCancellationRequested)
                {
                    Monitor.ReportSuccess(GettextCatalog.GetString("Checkout operation cancelled"));
                    return;
                }

                if (!System.IO.Directory.Exists(path))
                {
                    Monitor.ReportError(GettextCatalog.GetString("Checkout folder does not exist"), null);
                    return;
                }

                foreach (string str in System.IO.Directory.EnumerateFiles(path, "*", System.IO.SearchOption.AllDirectories))
                {
                    if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile(str))
                    {
                        Runtime.RunInMainThread(delegate {
                            IdeApp.Workspace.OpenWorkspaceItem(str);
                        });
                        break;
                    }
                }

                Monitor.ReportSuccess(GettextCatalog.GetString("Solution checked out"));
            }
Exemplo n.º 5
0
        protected override void Run()
        {
            vc.Checkout(path, null, true, Monitor);
            if (Monitor.IsCancelRequested)
            {
                Monitor.ReportSuccess(GettextCatalog.GetString("Checkout operation cancelled"));
                return;
            }

            if (!System.IO.Directory.Exists(path))
            {
                Monitor.ReportError(GettextCatalog.GetString("Checkout folder does not exist"), null);
                return;
            }

            string projectFn = null;

            string[] list = System.IO.Directory.GetFiles(path);
            if (projectFn == null)
            {
                foreach (string str in list)
                {
                    if (MonoDevelop.Projects.Services.ProjectService.IsWorkspaceItemFile(str))
                    {
                        projectFn = str;
                        break;
                    }
                }
            }

            if (projectFn != null)
            {
                DispatchService.GuiDispatch(delegate {
                    IdeApp.Workspace.OpenWorkspaceItem(projectFn);
                });
            }

            Monitor.ReportSuccess(GettextCatalog.GetString("Solution checked out"));
        }