本文整理汇总了C#中Microsoft.TeamFoundation.VersionControl.Client.Workspace类的典型用法代码示例。如果您正苦于以下问题:C# Workspace类的具体用法?C# Workspace怎么用?C# Workspace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Workspace类属于Microsoft.TeamFoundation.VersionControl.Client命名空间,在下文中一共展示了Workspace类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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"));
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:29,代码来源:WorkspaceTest2.cs
示例2: ShelveWindow
public ShelveWindow(ObservableCollection<changeItem> changeCollection, Workspace activeWorkspace)
{
InitializeComponent();
this.DataContext = this;
shelveCollection = changeCollection;
this.activeWorkspace = activeWorkspace;
}
开发者ID:btripp,项目名称:SeniorCapstoneList,代码行数:7,代码来源:ShelveWindow.xaml.cs
示例3: ChangesetVisitEventArgs
public ChangesetVisitEventArgs(Changeset changeset, IEnumerable<string> localizedServerItems, Workspace workspace)
{
LocalizedServerItems = localizedServerItems;
Workspace = workspace;
Changeset = changeset;
Committer = changeset.Committer;
}
开发者ID:cqse,项目名称:ScrumPowerTools,代码行数:7,代码来源:ChangesetVisitEventArgs.cs
示例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;
}
}
开发者ID:hopenbr,项目名称:HopDev,代码行数:28,代码来源:TFVC.cs
示例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);
}
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:29,代码来源:GettingDialog.cs
示例6: ConflictEventArgs
internal ConflictEventArgs(Workspace workspace, string message,
string serverItem)
{
this.workspace = workspace;
this.message = message;
this.serverItem = serverItem;
}
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:7,代码来源:ConflictEventArgs.cs
示例7: TfsWorkspace
public TfsWorkspace(Workspace workspace, string localDirectory, TextWriter stdout, TfsChangesetInfo contextVersion, IGitTfsRemote remote)
{
_workspace = workspace;
_contextVersion = contextVersion;
_remote = remote;
_localDirectory = localDirectory;
_stdout = stdout;
}
开发者ID:ElegantCode,项目名称:git-tfs,代码行数:8,代码来源:TfsWorkspace.cs
示例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;
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:9,代码来源:GettingEventArgs.cs
示例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;
}
开发者ID:BruceMellows,项目名称:TeamPilgrim,代码行数:57,代码来源:WorkspaceServiceModel.cs
示例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();
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:9,代码来源:InternalServerInfo.cs
示例11: TfsWorkspaceWrapper
public TfsWorkspaceWrapper(Workspace workspace)
{
if (workspace == null)
{
throw new ArgumentNullException("workspace");
}
_workspace = workspace;
}
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:9,代码来源:TfsWorkspaceWrapper.cs
示例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;
}
开发者ID:kocubinski,项目名称:TfsPackage,代码行数:10,代码来源:ElPackager.cs
示例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);
}
开发者ID:gandarez,项目名称:VSCommands,代码行数:12,代码来源:TeamFoundationHelper.cs
示例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();
}
开发者ID:Indomitable,项目名称:monodevelop-tfs-addin,代码行数:15,代码来源:WorkspaceAddEditDialog.cs
示例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;
}
开发者ID:MiniverCheevy,项目名称:Spawn,代码行数:15,代码来源:TfsSourceControlProvider.cs
示例16: TryCheckin
public bool TryCheckin(Workspace workspace, PendingChange[] changes, string comment, CheckinNote checkinNote = null, WorkItemCheckinInfo[] workItemChanges = null, PolicyOverrideInfo policyOverride = null)
{
try
{
_teamPilgrimTfsService.WorkspaceCheckin(workspace, changes, comment, checkinNote, workItemChanges, policyOverride);
return true;
}
catch (Exception ex)
{
this.Logger().DebugException(ex);
LastException = ex;
}
return false;
}
开发者ID:BruceMellows,项目名称:TeamPilgrim,代码行数:15,代码来源:TeamPilgrimServiceModelProvider.cs
示例17: WorkspaceInfo
internal WorkspaceInfo(InternalServerInfo server, Workspace workspace)
{
this.server = server;
comment = workspace.Comment;
computer = workspace.Computer;
name = workspace.Name;
ownerName = workspace.OwnerName;
List<string> paths = new List<string>();
foreach (WorkingFolder folder in workspace.Folders)
{
paths.Add(folder.LocalItem);
}
mappedPaths = paths.ToArray();
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:16,代码来源:WorkspaceInfo.cs
示例18: CachedWorkspace
public CachedWorkspace(string solutionFilePath)
{
WorkspaceInfo workspaceInfo = Workstation.Current.GetLocalWorkspaceInfo(solutionFilePath);
var server = new TfsTeamProjectCollection(workspaceInfo.ServerUri);
this.workspace = workspaceInfo.GetWorkspace(server);
this.changedFilePaths = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (PendingChange pendingChange in this.workspace.GetPendingChangesEnumerable())
{
if (!String.IsNullOrEmpty(pendingChange.LocalItem) &&
(pendingChange.IsAdd || pendingChange.IsEdit))
{
this.changedFilePaths.Add(Path.GetFullPath(pendingChange.LocalItem));
}
}
}
开发者ID:nicholjy,项目名称:stylize,代码行数:16,代码来源:CachedWorkspace.cs
示例19: RepositoryDialog
public RepositoryDialog(Workspace workspace)
: base((workspace == null)? "Add Repository" : "Edit Repository")
{
Table table = new Table(3, 2, false);
table.RowSpacing = ((uint)(6));
table.ColumnSpacing = ((uint)(6));
table.BorderWidth = ((uint)(12));
name = AddLabeledEntry(table, "_Name:", 1, 2);
server = AddLabeledEntry(table, "_Server:", 2, 3);
table.Attach(new Gtk.HSeparator(), 0, 2, 3, 4);
username = AddLabeledEntry(table, "_Username:", 4, 5);
password = AddLabeledEntry(table, "_Password:", 5, 6);
VBox.Add(table);
okButton = AddButton ("OK", ResponseType.Ok) as Button;
AddCloseButton("Cancel");
DefaultResponse = ResponseType.Ok;
if (workspace != null)
{
name.Text = workspace.Name;
Uri uri = workspace.VersionControlServer.TeamFoundationServer.Uri;
server.Text = uri.Host.ToString();
string creds = Keyring.GetCredentials(uri.ToString());
int comma = creds.IndexOf(",");
if (comma != -1)
{
username.Text = creds.Substring(0, comma);
password.Text = creds.Substring(comma+1);
}
else username.Text = creds;
}
else
{
name.Text = "CodePlex";
server.Text = "https://tfs01.codeplex.com";
username.Text = "snd\\";
}
ShowAll();
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:45,代码来源:RepositoryDialog.cs
示例20: WorkingFolderDialog
public WorkingFolderDialog(Workspace workspace, string serverPath)
: base("Working Folder Mapping")
{
this.serverPath = serverPath;
Table table = new Table(3, 3, false);
table.RowSpacing = ((uint)(6));
table.ColumnSpacing = ((uint)(6));
table.BorderWidth = ((uint)(12));
Label label = new Label("_Server Path: ");
table.Attach(label, 0, 1, 1, 2);
Label labelPath = new Label(serverPath);
labelPath.Xalign = 0;
table.Attach(labelPath, 1, 2, 1, 2);
localPath = AddLabeledEntry(table, "_Local Path:", 2, 3);
localPath.WidthChars = 32;
browseButton = new Button("Browse...");
table.Attach(browseButton, 2, 3, 2, 3);
string lpath = workspace.TryGetLocalItemForServerItem(serverPath);
if (!String.IsNullOrEmpty(lpath))
{
localPath.Text = lpath;
deleteButton = AddButton("Remove Mapping", ResponseType.Reject) as Button;
}
VBox.Add(table);
okButton = AddButton("OK", ResponseType.Ok) as Button;
browseButton.Pressed += OnBrowseButtonPressed;
AddCloseButton("Cancel");
DefaultResponse = ResponseType.Ok;
ShowAll();
}
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:37,代码来源:WorkingFolderDialog.cs
注:本文中的Microsoft.TeamFoundation.VersionControl.Client.Workspace类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论