public static string GetWorkspaceOwnerNameOrEmpty(Solution solution) { //dynamic vce = Globals.DTE.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt"); //if (vce != null && vce.SolutionWorkspace != null) { // return vce.SolutionWorkspace.OwnerName; //} var sn = solution?.FullName; if (string.IsNullOrEmpty(sn)) { return(string.Empty); } var name = string.Empty; InvokeOnUIThread(() => name = WorkspaceInfoGetter.Instance().GetOwner(sn)); return(name ?? string.Empty); }
public static WorkspaceInfoGetter Instance() { return(_Instance ?? (_Instance = new WorkspaceInfoGetter())); }