WriteLine() public static method

public static WriteLine ( string format ) : void
format string
return void
Beispiel #1
0
        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);
        }
Beispiel #2
0
        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));
                }
            }
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 public override void WriteLine(string message)
 {
     VsOutputLogger.WriteLine(message);
 }