public static WriteLine ( string format ) : void | ||
format | string | |
return | void |
protected ILocalRepositoryModel GetRepositoryByPath(string path) { try { if (!string.IsNullOrEmpty(path)) { var repo = ServiceProvider.TryGetService <IGitService>().GetRepository(path); return(new LocalRepositoryModel(repo.Info.WorkingDirectory.TrimEnd('\\'))); } } catch (Exception ex) { VsOutputLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, "Error loading the repository from '{0}'. {1}", path, ex)); } return(null); }
void RefreshRepo() { ActiveRepo = ServiceProvider.GetExportedValue <ITeamExplorerServiceHolder>().ActiveRepo; if (ActiveRepo == null) { var vsservices = ServiceProvider.GetExportedValue <IVSServices>(); string path = vsservices?.GetActiveRepoPath() ?? String.Empty; try { ActiveRepo = !String.IsNullOrEmpty(path) ? new SimpleRepositoryModel(path) : null; } catch (Exception ex) { VsOutputLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, "{0}: Error loading the repository from '{1}'. {2}", GetType(), path, ex)); } } }
public Task Save(IEnumerable <ConnectionDetails> connections) { var data = SimpleJson.SerializeObject(new CacheData { connections = connections.Select(ToCache).ToList(), }); try { os.File.WriteAllText(cachePath, data); } catch (Exception e) { VsOutputLogger.WriteLine("Failed to write connection cache to {0}: {1}", cachePath, e); } return(Task.CompletedTask); }
protected ISimpleRepositoryModel GetActiveRepo() { var activeRepo = ServiceProvider.GetExportedValue <ITeamExplorerServiceHolder>()?.ActiveRepo; // activeRepo can be null at this point because it is set elsewhere as the result of async operation that may not have completed yet. if (activeRepo == null) { var path = ServiceProvider.GetExportedValue <IVSServices>()?.GetActiveRepoPath() ?? String.Empty; try { activeRepo = !string.IsNullOrEmpty(path) ? new SimpleRepositoryModel(path) : null; } catch (Exception ex) { VsOutputLogger.WriteLine(string.Format(CultureInfo.CurrentCulture, "Error loading the repository from '{0}'. {1}", path, ex)); } } return(activeRepo); }
public override void WriteLine(string message) { VsOutputLogger.WriteLine(message); }