当前位置: 首页>>代码示例>>C#>>正文


C# Client.Workspace类代码示例

本文整理汇总了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"));
        }
开发者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


注:本文中的Microsoft.TeamFoundation.VersionControl.Client.Workspace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。