CheckVersionControlInstalled() публичный статический Метод

public static CheckVersionControlInstalled ( ) : bool
Результат bool
Пример #1
0
        public static async Task <bool> CanPublishAsync(Repository vc, string path, bool isDir)
        {
            if (!VersionControlService.CheckVersionControlInstalled())
            {
                return(false);
            }

            return(!(vc.TryGetVersionInfo(path, out var info) && info.IsVersioned && isDir));
        }
Пример #2
0
        public static bool CanPublish(Repository vc, string path, bool isDir)
        {
            if (!VersionControlService.CheckVersionControlInstalled())
            {
                return(false);
            }

            if (!vc.GetVersionInfo(path).IsVersioned&& isDir)
            {
                return(true);
            }
            return(false);
        }
Пример #3
0
        public static async Task <bool> CanPublishAsync(Repository vc, string path, bool isDir)
        {
            if (!VersionControlService.CheckVersionControlInstalled())
            {
                return(false);
            }

            if (!(await vc.GetVersionInfoAsync(path)).IsVersioned && isDir)
            {
                return(true);
            }
            return(false);
        }
Пример #4
0
        protected override void Run()
        {
            if (!VersionControlService.CheckVersionControlInstalled())
            {
                return;
            }

            SelectRepositoryDialog del = new SelectRepositoryDialog(SelectRepositoryMode.Checkout);

            try {
                if (MessageService.RunCustomDialog(del) == (int)Gtk.ResponseType.Ok && del.Repository != null)
                {
                    CheckoutWorker w = new CheckoutWorker(del.Repository, del.TargetPath);
                    w.Start();
                }
            } finally {
                del.Destroy();
            }
        }
Пример #5
0
        public static bool Publish(IWorkspaceObject entry, FilePath localPath, bool test)
        {
            if (test)
            {
                return(VersionControlService.CheckVersionControlInstalled() && VersionControlService.GetRepository(entry) == null);
            }

            List <FilePath> files = new List <FilePath> ();

            // Build the list of files to be checked in
            string moduleName = entry.Name;

            if (localPath == entry.BaseDirectory)
            {
                GetFiles(files, entry);
            }
            else if (entry is Project)
            {
                foreach (ProjectFile file in ((Project)entry).Files.GetFilesInPath(localPath))
                {
                    if (file.Subtype != Subtype.Directory)
                    {
                        files.Add(file.FilePath);
                    }
                }
            }
            else
            {
                return(false);
            }

            if (files.Count == 0)
            {
                return(false);
            }

            SelectRepositoryDialog dlg = new SelectRepositoryDialog(SelectRepositoryMode.Publish);

            try {
                dlg.ModuleName = moduleName;
                dlg.Message    = GettextCatalog.GetString("Initial check-in of module {0}", moduleName);
                do
                {
                    if (MessageService.RunCustomDialog(dlg) == (int)Gtk.ResponseType.Ok && dlg.Repository != null)
                    {
                        AlertButton publishButton = new AlertButton("_Publish");
                        if (MessageService.AskQuestion(GettextCatalog.GetString("Are you sure you want to publish the project?"), GettextCatalog.GetString("The project will be published to the repository '{0}', module '{1}'.", dlg.Repository.Name, dlg.ModuleName), AlertButton.Cancel, publishButton) == publishButton)
                        {
                            PublishWorker w = new PublishWorker(dlg.Repository, dlg.ModuleName, localPath, files.ToArray(), dlg.Message);
                            w.Start();
                            break;
                        }
                    }
                    else
                    {
                        break;
                    }
                } while (true);
            } finally {
                dlg.Destroy();
            }
            return(true);
        }
Пример #6
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = VersionControlService.CheckVersionControlInstalled();
     info.Visible = !VersionControlService.IsGloballyDisabled;
 }
Пример #7
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = VersionControlService.CheckVersionControlInstalled();
 }