当前位置: 首页>>代码示例>>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;未经允许,请勿转载。