private void Initialize() { if (bw != null) bw.CancelAsync(); UseWaitCursor = true; _oldSubmoduleInfo = null; if (Submodules.SelectedRows.Count == 1) _oldSubmoduleInfo = Submodules.SelectedRows[0].DataBoundItem as GitSubmoduleInfo; lock (modules) modules.Clear(); bw = new BackgroundWorker(); bw.DoWork += bw_DoWork; bw.ProgressChanged += bw_ProgressChanged; bw.RunWorkerCompleted += bw_RunWorkerCompleted; bw.WorkerReportsProgress = true; bw.WorkerSupportsCancellation = true; bw.RunWorkerAsync(); }
private GitSubmoduleInfo GetSubmoduleInfo(string submodule) { var gitSubmodule = new GitSubmoduleInfo(this) { Initialized = submodule[0] != '-', UpToDate = submodule[0] != '+', CurrentCommitGuid = submodule.Substring(1, 40).Trim() }; var localPath = submodule.Substring(42).Trim(); if (localPath.Contains("(")) { gitSubmodule.LocalPath = localPath.Substring(0, localPath.IndexOf("(")).TrimEnd(); gitSubmodule.Branch = localPath.Substring(localPath.IndexOf("(")).Trim(new[] { '(', ')', ' ' }); } else gitSubmodule.LocalPath = localPath; return gitSubmodule; }