當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。