コード例 #1
0
        public void ConnectTfs()
        {
            var tfs = new TeamFoundationServer("http://tfsny:8080/tfs");

            tfs.Authenticate();
            WorkItems = new WorkItemStore(tfs);
        }
コード例 #2
0
ファイル: Wallboard.cs プロジェクト: preetum/archive
        public Wallboard()
        {
            InitializeComponent();
            teamFoundationServer.Authenticate();

            VersionControlServer s = (VersionControlServer)teamFoundationServer.GetService(typeof(VersionControlServer));
        }
コード例 #3
0
        /// <summary>
        /// Perform the adapter-specific initialization
        /// </summary>
        public virtual void InitializeClient(MigrationSource migrationSource)
        {
            TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(migrationSource.ServerUrl);

            tfs.Authenticate();

            m_workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

            m_projectName = migrationSource.SourceIdentifier;
        }
コード例 #4
0
        void TfsProjectDiff(string[] args)
        {
            // Figure out the workspace information based on the local cache.
            WorkspaceInfo wsInfo = Workstation.Current.GetLocalWorkspaceInfo(Environment.CurrentDirectory);

            if (wsInfo == null)
            {
                Console.Error.WriteLine("The current directory is not mapped.");
                Environment.Exit(1);
            }

            // Now we can get to the workspace.
            TeamFoundationServer tfs = new TeamFoundationServer(wsInfo.ServerUri.AbsoluteUri,
                                                                new System.Net.NetworkCredential(@"snd\alanjmcf_cp", "acpsbjorg"));

            tfs.Authenticate();
            Workspace workspace = wsInfo.GetWorkspace(tfs);

            try {
                // Display the differences for the current directory and all of its descendants
                // (fully recursive).
                if (args.Length == 0)
                {
                    // Display the differences between what's in the workspace compared to latest.
                    DisplayCurrentDiff(workspace);
                }
                else
                {
                    // Display the differences between the two specified versions.
                    if (args.Length != 2)
                    {
                        Console.Error.WriteLine("Usage: projectdiff <versionspec> <versionspec>");
                        Console.Error.WriteLine("Example: projectdiff D04/06/06 T");
                        Console.Error.WriteLine("         compare midnight April 6, 2006 and latest");
                        Console.Error.WriteLine("Example: projectdiff W T");
                        Console.Error.WriteLine("         compare what's in the workspace to latest");
                        Environment.Exit(1);
                    }

                    // Parse the
                    VersionSpec version1 = ParseVersionSpec(args[0], workspace);
                    VersionSpec version2 = ParseVersionSpec(args[1], workspace);

                    DisplayVersionDiff(workspace, version1, version2);
                }
            } catch (TeamFoundationServerException e) {
                // If something goes wrong, such as not having access to the server, display
                // the appropriate error message.
                Console.Error.WriteLine(e.Message);
                Environment.Exit(1);
            }
        }
コード例 #5
0
        /// <summary>
        /// Tests the tfs connection.
        /// </summary>
        /// <returns></returns>
        public static bool TestConnection(LoginInfo info)
        {
            TeamFoundationServer tfs = CreateServer(info);
            bool result = (tfs != null);

            if (result)
            {
                try
                {
                    tfs.Authenticate();
                }
                catch {}

                result = tfs.HasAuthenticated;

                if (result)
                {
                    lastConnectedServer = tfs;
                }
            }

            return(result);
        }