forked from git-tfs/git-tfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying out an abstract class for the shared parts of the Tfs plugin.
- Loading branch information
Matt Burke
committed
Jan 28, 2011
1 parent
c073f53
commit d4d0cf1
Showing
3 changed files
with
74 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,54 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Microsoft.TeamFoundation.Client; | ||
using Sep.Git.Tfs.Core.TfsInterop; | ||
using Sep.Git.Tfs.VsCommon; | ||
using StructureMap; | ||
|
||
namespace Sep.Git.Tfs.VsCommon | ||
namespace Sep.Git.Tfs.Vs2008 | ||
{ | ||
public partial class TfsHelper : ITfsHelper | ||
public class TfsHelper : TfsHelperBase | ||
{ | ||
private TeamFoundationServer server; | ||
private TeamFoundationServer _server; | ||
|
||
public string TfsClientLibraryVersion | ||
public TfsHelper(TextWriter stdout, TfsApiBridge bridge, IContainer container) : base(stdout, bridge, container) | ||
{ | ||
get { return typeof(TeamFoundationServer).Assembly.GetName().Version.ToString() + " (MS)"; } | ||
} | ||
|
||
public bool CanShowCheckinDialog { get { return false; } } | ||
|
||
public long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment) | ||
public override string TfsClientLibraryVersion | ||
{ | ||
throw new NotImplementedException(); | ||
get { return "" + typeof(TeamFoundationServer).Assembly.GetName().Version + " (MS)"; } | ||
} | ||
|
||
private void UpdateServer() | ||
protected override void UpdateServer() | ||
{ | ||
if (string.IsNullOrEmpty(Url)) | ||
{ | ||
server = null; | ||
_server = null; | ||
} | ||
else | ||
{ | ||
server = new TeamFoundationServer(Url, new UICredentialsProvider()); | ||
server.EnsureAuthenticated(); | ||
_server = new TeamFoundationServer(Url, new UICredentialsProvider()); | ||
_server.EnsureAuthenticated(); | ||
} | ||
} | ||
|
||
private TeamFoundationServer Server | ||
protected override T GetService<T>() | ||
{ | ||
get | ||
{ | ||
return server; | ||
} | ||
return (T) _server.GetService(typeof (T)); | ||
} | ||
|
||
protected override string GetAuthenticatedUser() | ||
{ | ||
return VersionControl.AuthenticatedUser; | ||
} | ||
|
||
public override bool CanShowCheckinDialog { get { return false; } } | ||
|
||
public override long ShowCheckinDialog(IWorkspace workspace, IPendingChange[] pendingChanges, IEnumerable<IWorkItemCheckedInfo> checkedInfos, string checkinComment) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters