本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.Workspace类的典型用法代码示例。如果您正苦于以下问题:C# Workspace类的具体用法?C# Workspace怎么用?C# Workspace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Workspace类属于Microsoft.TeamFoundation.VersionControl.Client命名空间,在下文中一共展示了Workspace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FixtureSetUp
public void FixtureSetUp()
{
tfsUrl = Environment.GetEnvironmentVariable("TFS_URL");
if (String.IsNullOrEmpty(tfsUrl))
{
Console.WriteLine("Warning: Environment variable TFS_URL not set.");
Console.WriteLine(" Some tests cannot be executed without TFS_URL.");
return;
}
string username = Environment.GetEnvironmentVariable("TFS_USERNAME");
if (String.IsNullOrEmpty(username))
{
Console.WriteLine("Warning: No TFS user credentials specified.");
return;
}
credentials = new NetworkCredential(username,
Environment.GetEnvironmentVariable("TFS_PASSWORD"),
Environment.GetEnvironmentVariable("TFS_DOMAIN"));
// need TFS_ envvars for this test
if (String.IsNullOrEmpty(tfsUrl)) return;
TeamFoundationServer tfs = new TeamFoundationServer(tfsUrl, credentials);
versionControlServer = (VersionControlServer) tfs.GetService(typeof(VersionControlServer));
workspace = versionControlServer.CreateWorkspace("WorkspaceTest",
Environment.GetEnvironmentVariable("TFS_USERNAME"));
}
示例2: ShelveWindow
public ShelveWindow(ObservableCollection<changeItem> changeCollection, Workspace activeWorkspace)
{
InitializeComponent();
this.DataContext = this;
shelveCollection = changeCollection;
this.activeWorkspace = activeWorkspace;
}
示例3: ChangesetVisitEventArgs
public ChangesetVisitEventArgs(Changeset changeset, IEnumerable<string> localizedServerItems, Workspace workspace)
{
LocalizedServerItems = localizedServerItems;
Workspace = workspace;
Changeset = changeset;
Committer = changeset.Committer;
}
示例4: AddToTFVC
public bool AddToTFVC(string[] _files, WorkItem _wi, Workspace _ws)
{
try
{
_ws.Get();
// Now add everything.
_ws.PendAdd(_files, false);
WorkItemCheckinInfo[] _wici = new WorkItemCheckinInfo[1];
_wici[0] = new WorkItemCheckinInfo(_wi, WorkItemCheckinAction.Associate);
if (_ws.CheckIn(_ws.GetPendingChanges(), null, null, _wici, null) > 0)
{
_ws.Delete();
return true;
}
else
{
return false;
}
}
catch
{
return false;
}
}
示例5: GettingDialog
public GettingDialog(VersionControlServer vcs, Workspace workspace, GetRequest[] requests)
: base("Progress")
{
VBox.Spacing = 10;
VBox.Add(new Label("Getting files from the server..."));
progressBar = new ProgressBar();
VBox.Add(progressBar);
fileLabel = new Label("");
VBox.Add(fileLabel);
AddCloseButton("Cancel");
DefaultResponse = ResponseType.Cancel;
ShowAll();
getLatestList.Clear();
vcs.Getting += MyGettingEventHandler;
GetStatus status = workspace.Get(requests, GetOptions.GetAll|GetOptions.Overwrite);
foreach (string file in getLatestList)
{
Console.WriteLine(file);
Pulse("Setting permissions: " + file);
if (! FileTypeDatabase.ShouldBeExecutable(file)) continue;
FileType.MakeExecutable(file);
}
}
示例6: ConflictEventArgs
internal ConflictEventArgs(Workspace workspace, string message,
string serverItem)
{
this.workspace = workspace;
this.message = message;
this.serverItem = serverItem;
}
示例7: TfsWorkspace
public TfsWorkspace(Workspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote)
{
_workspace = workspace;
_contextVersion = contextVersion;
_remote = remote;
_localDirectory = localDirectory;
_stdout = stdout;
}
示例8: GettingEventArgs
internal GettingEventArgs(Workspace workspace, GetOperation operation)
{
this.workspace = workspace;
this.operation = operation;
if (operation.ChangeType == ChangeType.Delete)
status = OperationStatus.Deleting;
else status = OperationStatus.Getting;
}
示例9: WorkspaceServiceModel
public WorkspaceServiceModel(ITeamPilgrimServiceModelProvider teamPilgrimServiceModelProvider, ITeamPilgrimVsService teamPilgrimVsService, ProjectCollectionServiceModel projectCollectionServiceModel, Workspace workspace)
: base(teamPilgrimServiceModelProvider, teamPilgrimVsService)
{
_projectCollectionServiceModel = projectCollectionServiceModel;
Workspace = workspace;
var versionControlServer = _projectCollectionServiceModel.TfsTeamProjectCollection.GetVersionControlServer();
this.Logger().Debug("VersionControlServer - WebServiceLevel: {0}, SupportedFeatures: {1}", versionControlServer.WebServiceLevel, versionControlServer.SupportedFeatures);
versionControlServer.PendingChangesChanged += VersionControlServerOnPendingChangesChanged;
checkinNotesCacheWrapper = new CheckinNotesCacheWrapper(versionControlServer);
ShelveCommand = new RelayCommand(Shelve, CanShelve);
UnshelveCommand = new RelayCommand(Unshelve, CanUnshelve);
CheckInCommand = new RelayCommand(CheckIn, CanCheckIn);
RefreshPendingChangesCommand = new RelayCommand(RefreshPendingChanges, CanRefreshPendingChanges);
RefreshSelectedDefinitionWorkItemsCommand = new RelayCommand(RefreshSelectedDefinitionWorkItems, CanRefreshSelectedDefinitionWorkItems);
ShowSelectWorkItemQueryCommand = new RelayCommand(ShowSelectWorkItemQuery, CanShowSelectWorkItemQuery);
EvaluateCheckInCommand = new RelayCommand(EvaluateCheckIn, CanEvaluateCheckIn);
SelectPendingChangesCommand = new RelayCommand<SelectPendingChangesCommandArgument>(SelectPendingChanges, CanSelectPendingChanges);
SelectWorkItemsCommand = new RelayCommand<SelectWorkItemsCommandArgument>(SelectWorkItems, CanSelectWorkItems);
ViewWorkItemCommand = new RelayCommand<ObservableCollection<object>>(ViewWorkItem, CanViewWorkItem);
ViewPendingChangeCommand = new RelayCommand<ObservableCollection<object>>(ViewPendingChange, CanViewPendingChange);
CompareWithLatestCommand = new RelayCommand<ObservableCollection<object>>(CompareWithLatest, CanCompareWithLatest);
CompareWithWorkspaceCommand = new RelayCommand<ObservableCollection<object>>(CompareWithWorkspace, CanCompareWithWorkspace);
UndoPendingChangeCommand = new RelayCommand<ObservableCollection<object>>(UndoPendingChange, CanUndoPendingChange);
PendingChangePropertiesCommand = new RelayCommand<ObservableCollection<object>>(PendingChangeProperties, CanPendingChangeProperties);
CheckinNotes = new ObservableCollection<CheckinNoteModel>();
PendingChanges = new ObservableCollection<PendingChangeModel>();
_backgroundFunctionPreventDataUpdate = true;
PendingChanges.CollectionChanged += PendingChangesOnCollectionChanged;
_populatePendingChangedBackgroundWorker = new BackgroundWorker();
_populatePendingChangedBackgroundWorker.DoWork += PopulatePendingChangedBackgroundWorkerOnDoWork;
_populatePendingChangedBackgroundWorker.RunWorkerAsync();
SolutionIsOpen = teamPilgrimVsService.Solution.IsOpen && !string.IsNullOrEmpty(teamPilgrimVsService.Solution.FileName);
teamPilgrimVsService.SolutionStateChanged += () =>
{
FilterSolution = false;
SolutionIsOpen = teamPilgrimVsService.Solution.IsOpen && !string.IsNullOrEmpty(teamPilgrimVsService.Solution.FileName);
};
WorkItems = new ObservableCollection<WorkItemModel>();
WorkItems.CollectionChanged += WorkItemsOnCollectionChanged;
PopulatePreviouslySelectedWorkItemQueryModels();
_backgroundFunctionPreventDataUpdate = false;
}
示例10: InternalServerInfo
public InternalServerInfo(string uri, Guid repositoryGuid, Workspace workspace)
{
this.uri = new Uri(uri);
this.repositoryGuid = repositoryGuid;
List<WorkspaceInfo> infos = new List<WorkspaceInfo>();
infos.Add(new WorkspaceInfo(this, workspace));
Workspaces = infos.ToArray();
}
示例11: TfsWorkspaceWrapper
public TfsWorkspaceWrapper(Workspace workspace)
{
if (workspace == null)
{
throw new ArgumentNullException("workspace");
}
_workspace = workspace;
}
示例12: ElPackager
public ElPackager(string root, TfsChangesets changesets)
{
_root = root;
var tpc = new TfsTeamProjectCollection(new Uri(TfsUrl));
var vc = tpc.GetService<VersionControlServer>();
_workspace = vc.GetWorkspace(root);
var serverFolder = _workspace.GetServerItemForLocalItem(root);
changesets.LoadChangesets(vc, serverFolder);
_changesets = changesets;
}
示例13: GetBranchNameForItem
public string GetBranchNameForItem(string localFullPath, out Workspace workspace, out BranchObject branchObject)
{
workspace = null;
branchObject = null;
return GetBranchNameForItem(
localFullPath,
waitForConnection: true,
timeout: TimeSpan.FromSeconds(5),
workspace: out workspace,
branchObject: out branchObject);
}
示例14: WorkspaceAddEditDialog
public WorkspaceAddEditDialog(Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace, Microsoft.TeamFoundation.Client.ProjectCollection projectCollection)
{
this.projectCollection = projectCollection;
if (workspace == null)
{
_action = DialogAction.Create;
}
else
{
this._workspace = workspace;
_action = DialogAction.Edit;
}
_workingFoldersStore = new ListStore(_tfsFolder, _localFolder);
BuildGui();
}
示例15: TfsSourceControlProvider
public TfsSourceControlProvider()
{
var info = Workstation.Current.GetLocalWorkspaceInfo(Vs.Helper.SolutionFolder);
if (info == null)
{
Console.WriteLine("Cannot Find Tfs Workspace at " + Vs.Helper.SolutionFolder);
return;
}
var uri = info.ServerUri;
var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(uri);
var cssService = projectCollection.GetService<ICommonStructureService4>();
workspace = info.GetWorkspace(projectCollection);
IsActive = true;
}