當前位置: 首頁>>代碼示例>>C#>>正文


C# Client.VersionControlServer類代碼示例

本文整理匯總了C#中Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer的典型用法代碼示例。如果您正苦於以下問題:C# VersionControlServer類的具體用法?C# VersionControlServer怎麽用?C# VersionControlServer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VersionControlServer類屬於Microsoft.TeamFoundation.VersionControl.Client命名空間,在下文中一共展示了VersionControlServer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DiffItemVersionedFile

 public DiffItemVersionedFile(Item item, VersionSpec versionSpec)
 {
     this.versionControlServer = item.VersionControlServer;
         this.item = item;
         this.versionSpec = versionSpec;
         this.label = item.ServerItem;
 }
開發者ID:Jeff-Lewis,項目名稱:opentf,代碼行數:7,代碼來源:DiffItemVersionedFile.cs

示例2: 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

示例3: 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

示例4: ProcessWorkItemRelationships

        /// <summary>
        /// Method for processing work items down to the changesets that are related to them
        /// </summary>
        /// <param name="wi">Work Item to process</param>
        /// <param name="outputFile">File to write the dgml to</param>
        /// <param name="vcs">Version Control Server which contains the changesets</param>
        public void ProcessWorkItemRelationships(WorkItem[] wi, 
                                                 string outputFile, 
                                                 bool hideReverse,
                                                 bool groupbyIteration,
                                                 bool dependencyAnalysis,
                                                 List<TempLinkType> selectedLinks,
                                                 VersionControlServer vcs)
        {
            string projectName = wi[0].Project.Name;

            _workItemStubs = new List<WorkItemStub>();
            _wis = wi[0].Store;
            _vcs = vcs;
            _tms = vcs.TeamProjectCollection.GetService<ITestManagementService>();
            _tmp = _tms.GetTeamProject(projectName);
            _selectedLinks = selectedLinks;

            //Store options
            _hideReverse = hideReverse;
            _groupbyIteration = groupbyIteration;
            _dependencyAnalysis = dependencyAnalysis;

            for (int i = 0; i < wi.Length; i++)
            {
                ProcessWorkItemCS(wi[i]);
            }

            WriteChangesetInfo(outputFile, projectName);
        }
開發者ID:amccool,項目名稱:WorkItemVisualization,代碼行數:35,代碼來源:ProcessDGMLData.cs

示例5: 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));

            WorkingFolder[] folders = new WorkingFolder[1];
            string serverItem = String.Format("$/{0}", Environment.GetEnvironmentVariable("TFS_PROJECT"));
            folders[0] = new WorkingFolder(serverItem, Environment.CurrentDirectory);

            workspace = versionControlServer.CreateWorkspace("UpdateWorkspaceInfoCache_Workspace",
                                                                                Environment.GetEnvironmentVariable("TFS_USERNAME"),
                                                                                "My Comment", folders, Environment.MachineName);
        }
開發者ID:Jeff-Lewis,項目名稱:opentf,代碼行數:34,代碼來源:Workstation.cs

示例6: DiffFiles

        public static void DiffFiles(VersionControlServer versionControl,
																	IDiffItem source, IDiffItem target,
																	DiffOptions diffOpts, string fileNameForHeader,
																	bool wait)
        {
            DiffItemUtil aItem = new DiffItemUtil('a', fileNameForHeader, source.GetFile());
            DiffItemUtil bItem = new DiffItemUtil('b', fileNameForHeader, target.GetFile());
            StreamWriter stream = diffOpts.StreamWriter;

            // short circuit for binary file comparisions
            if (source.GetEncoding() == RepositoryConstants.EncodingBinary && target.GetEncoding() == RepositoryConstants.EncodingBinary)
                {
                    stream.WriteLine("Binary files {0} and {1} differ", aItem.Name, bItem.Name);
                    return;
                }

            WriteHeader(aItem, bItem, diffOpts);

            // short circuit new files
            if (aItem.Length == 0)
                {
                    WriteNewFile(stream, bItem.Lines);
                    return;
                }

            Hashtable hashtable = new Hashtable(aItem.Length + bItem.Length);
            bool ignoreWhiteSpace = (diffOpts.Flags & DiffOptionFlags.IgnoreWhiteSpace) ==  DiffOptionFlags.IgnoreWhiteSpace;

            DiffItem[] items = DiffUtil.DiffText(hashtable, aItem.Lines, bItem.Lines,
                                                                                     ignoreWhiteSpace, ignoreWhiteSpace, false);

            WriteUnified(stream, aItem.Lines, bItem.Lines, items);
        }
開發者ID:Jeff-Lewis,項目名稱:opentf,代碼行數:33,代碼來源:Difference.cs

示例7: GetIdsFromHistory

        static List<int> GetIdsFromHistory(string path, VersionControlServer tfsClient)
        {
            if (tfsClient == null)
            {
                tfsClient = GetTfsClient();
            }

            IEnumerable submissions = tfsClient.QueryHistory(
                path,
                VersionSpec.Latest,
                0,
                RecursionType.None, // Assume that the path is to a file, not a directory
                null,
                null,
                null,
                Int32.MaxValue,
                false,
                false);

            List<int> ids = new List<int>();
            foreach(Changeset cs in submissions)
            {
                ids.Add(cs.ChangesetId);
            }
            return ids;
        }
開發者ID:mrcaron,項目名稱:Tfs2010QueryHistoryPerfExp,代碼行數:26,代碼來源:Program.cs

示例8: ReviewItemCollectorStrategy

 public ReviewItemCollectorStrategy(WorkItemStore store, VersionControlServer versionControlServer, IVisualStudioAdapter visualStudioAdapter, IReviewItemFilter filter)
 {
     this.store = store;
     this.versionControlServer = versionControlServer;
     this.visualStudioAdapter = visualStudioAdapter;
     this.filter = filter;
 }
開發者ID:cqse,項目名稱:ScrumPowerTools,代碼行數:7,代碼來源:ReviewItemCollectorStrategy.cs

示例9: Connect

        public override void Connect(string serverUri, string remotePath, string localPath, int fromChangeset, string tfsUsername, string tfsPassword, string tfsDomain)
        {
            this._serverUri = new Uri(serverUri);
            this._remotePath = remotePath;
            this._localPath = localPath;
            this._startingChangeset = fromChangeset;

            try
            {
                NetworkCredential tfsCredential = new NetworkCredential(tfsUsername, tfsPassword, tfsDomain);
                //this._teamFoundationServer = new Microsoft.TeamFoundation.Client.TeamFoundationServer(this._serverUri, tfsCredential);
                this._tfsProjectCollection = new TfsTeamProjectCollection(this._serverUri, tfsCredential);
                this._versionControlServer = this._tfsProjectCollection.GetService<VersionControlServer>();
            }
            catch (Exception ex)
            {
                throw new Exception("Error connecting to TFS", ex);
            }

            //clear hooked eventhandlers
            BeginChangeSet = null;
            EndChangeSet = null;
            FileAdded = null;
            FileEdited = null;
            FileDeleted = null;
            FileUndeleted = null;
            FileBranched = null;
            FileRenamed = null;
            FolderAdded = null;
            FolderDeleted = null;
            FolderUndeleted = null;
            FolderBranched = null;
            FolderRenamed = null;
            ChangeSetsFound = null;
        }
開發者ID:jv42,項目名稱:tfs2svn,代碼行數:35,代碼來源:TfsClientProvider.cs

示例10: SourceControlWrapper

        public SourceControlWrapper(string teamProjectCollectionUrl, string teamProjectName)
        {
            this.tpcollection = new TfsTeamProjectCollection(new Uri(teamProjectCollectionUrl));
            this.teamProjectName = teamProjectName;

            this.vcserver = this.tpcollection.GetService<VersionControlServer>();
        }
開發者ID:HansKindberg-Net,項目名稱:TFS-Branch-Tool,代碼行數:7,代碼來源:SourceControlWrapper.cs

示例11: ShowChangesetDialog

        public ShowChangesetDialog(VersionControlServer vcs, int cid)
            : base("Changeset " + cid.ToString())
        {
            changesetDiffView = new ChangesetDiffView(vcs, cid);
                VBox.Add(changesetDiffView);

                AddCloseButton();
        }
開發者ID:Jeff-Lewis,項目名稱:opentf,代碼行數:8,代碼來源:ShowChangesetDialog.cs

示例12: UsersLocator

 public UsersLocator(IGroupSecurityService groupSecurityService, VersionControlServer versionControlServer,
                          TeamProject teamProject, IGroupsLocator groupsLocator)
 {
     m_groupSecurityService = groupSecurityService;
     m_versionControlServer = versionControlServer;
     m_teamProject = teamProject;
     m_groupsLocator = groupsLocator;
 }
開發者ID:apiddiu,項目名稱:TfsPermissionsWalker,代碼行數:8,代碼來源:UsersLocator.cs

示例13: FolderDiffWrapper

		public FolderDiffWrapper(string assemblyPath, string srcPath, VersionSpec srcSpec, string targetPath, VersionSpec targetSpec, VersionControlServer server, RecursionType recursion)
		{
			_vcControlsAssembly = Assembly.LoadFrom(assemblyPath);
			//internal FolderDiff(string path1, VersionSpec spec1, string path2, VersionSpec spec2, VersionControlServer server, RecursionType recursion);
			FolderDiff = AccessPrivateWrapper.FromType(_vcControlsAssembly, FolderDiffTypeName,
			                                         srcPath, srcSpec, targetPath, targetSpec, server, recursion);
			SetupTypesFromAssembly();
		}
開發者ID:alexcpendleton,項目名稱:Pendletron.Tfs.FolderDiffGet,代碼行數:8,代碼來源:FolderDiffWrapper.cs

示例14: ReviewModel

        public ReviewModel()
        {
            teamProjectCollectionProvider = IoC.GetInstance<IVisualStudioAdapter>();
            var tpc = teamProjectCollectionProvider.GetCurrent();

            workItemStore = tpc.GetService<WorkItemStore>();
            versionControlServer = tpc.GetService<VersionControlServer>();
        }
開發者ID:cqse,項目名稱:ScrumPowerTools,代碼行數:8,代碼來源:ReviewModel.cs

示例15: Connect

 public virtual void Connect()
 {
     WorkspaceInfo wi = Workstation.Current.GetLocalWorkspaceInfo(Environment.CurrentDirectory);
     using (var tfs = new TfsTeamProjectCollection(wi.ServerUri))
     {
         versionControlServer = tfs.GetService<VersionControlServer>();
     }
 }
開發者ID:peterstevens130561,項目名稱:tfsblame,代碼行數:8,代碼來源:Commits.cs


注:本文中的Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。