/// <summary>Initializes a new instance of the TeamExplorerIntegrator class, The constructor for the Add-in object. Place your initialization code within this method.</summary>
        public void Initialize(IVsExtensibility extensibility)
        {
            if (m_applicationObject != null)
            {
                throw new ApplicationException("TeamExplorerIntegrator already initialized");
            }

            if (extensibility == null)
            {
                throw new ArgumentNullException(nameof(extensibility));
            }

            // get IDE Globals object and DTE from that
            var dte2 = extensibility.GetGlobalsObject(null).DTE as DTE2;

            m_applicationObject = dte2;

            if (dte2 == null)
            {
                throw new ApplicationException("No DTE2");
            }

            var tfsExt = (TeamFoundationServerExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");

            m_srcCtrlExplorer = (VersionControlExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt");

            //            var events = m_applicationObject.Events;

            DoConnect(tfsExt);
        }
 public override void ShowChangesetDetails(int changesetId)
 {
     if (VersionControlExt != null)
     {
         VersionControlExt.ViewChangesetDetails(changesetId);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FindForm"/> class.
 /// </summary>
 /// <param name="automationObject">The automation object.</param>
 public FindForm(DTE2 automationObject) : this()
 {
     this.AutomationObject        = automationObject;
     this.versionControlExt       = (VersionControlExt)this.AutomationObject.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt");
     this.versionControlServer    = this.versionControlExt.Explorer.Workspace.VersionControlServer;
     this.ContainingFileText.Text = this.versionControlExt.Explorer.CurrentFolderItem.SourceServerPath;
     this.FromDatePicker.Value    = DateTime.Now - new TimeSpan(28, 0, 0, 0);
     this.ToDatePicker.Value      = DateTime.Now;
 }
Exemplo n.º 4
0
        private void findChangeset(object sender, RoutedEventArgs e)
        {
            VersionControlExt vce = CheckoutAndBuild2Package.GetGlobalService <VersionControlExt>();

            if (vce != null)
            {
                vce.FindChangeset();
            }
        }
        /// <summary>
        /// Default constructor of the package.
        /// Inside this method you can place any initialization code that does not require
        /// any Visual Studio service because at this point the package object is created but
        /// not sited yet inside Visual Studio environment. The place to do all the other
        /// initialization is the Initialize method.
        /// </summary>
        public TfsProjectInfoPackage()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));

            _extensibility = (IVsExtensibility)Package.GetGlobalService(typeof(IVsExtensibility));
            _dte2          = (DTE2)_extensibility.GetGlobalsObject(null).DTE;

            _vcExt = _dte2.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;

            // The SolutionEvents is an *instance* variable that must be kept around for the events to work!
            _solutionEvents               = _dte2.Events.SolutionEvents;
            _solutionEvents.Opened       += () => ReadSolutionInfo();
            _solutionEvents.AfterClosing += () => ReadSolutionInfo();
        }
        /// <summary>
        /// Default constructor of the package.
        /// Inside this method you can place any initialization code that does not require 
        /// any Visual Studio service because at this point the package object is created but 
        /// not sited yet inside Visual Studio environment. The place to do all the other 
        /// initialization is the Initialize method.
        /// </summary>
        public TfsProjectInfoPackage()
        {
            Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString()));

            _extensibility = (IVsExtensibility)Package.GetGlobalService(typeof(IVsExtensibility));
            _dte2 = (DTE2)_extensibility.GetGlobalsObject(null).DTE;

            _vcExt = _dte2.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;

            // The SolutionEvents is an *instance* variable that must be kept around for the events to work!
            _solutionEvents = _dte2.Events.SolutionEvents;
            _solutionEvents.Opened += () => ReadSolutionInfo();
            _solutionEvents.AfterClosing += () => ReadSolutionInfo();
        }
        /// <summary>Implements the constructor for the Add-in object. Place your initialization code within this method.</summary>
        public TeamExplorerIntergator(EnvDTE.IVsExtensibility extensibility, IVsTeamExplorer te)
        {
            IvsTeamExpl = te;

            // get IDE Globals object and DTE from that
            EnvDTE80.DTE2 dte2 = extensibility.GetGlobalsObject(null).DTE as EnvDTE80.DTE2;
            _applicationobject = dte2;

            Debug.Assert(dte2 != null, "No DTE2");

            TeamFoundationServerExt tfsExt = (TeamFoundationServerExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");

            this.srcCtrlExplorer = (VersionControlExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt");

            DoConnect(tfsExt);
        }
Exemplo n.º 8
0
        public void ViewHistory()
        {
            ITeamFoundationContext context = this.CurrentContext;

            if (context != null && context.HasCollection && context.HasTeamProject)
            {
                VersionControlServer vcs = context.TeamProjectCollection.GetService <VersionControlServer>();
                if (vcs != null)
                {
                    string            path = "$/" + context.TeamProjectName;
                    VersionControlExt vc   = GetVersionControlExt(this.ServiceProvider);
                    if (vc != null)
                    {
                        vc.History.Show(path, VersionSpec.Latest, 0, RecursionType.Full, this.UserAccountName, null, null, 250, true);
                    }
                }
            }
        }
Exemplo n.º 9
0
 private void EnsurePendingChangesService()
 {
     if (_pendingChangesExt == null)
     {
         var dte = Package.GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
         TeamFoundationServerExt ext = dte.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt") as TeamFoundationServerExt;
         _pendingChangesExt = GetService <IPendingChangesExt>();
         if (_pendingChangesExt == null)
         {
             //var dte = Package.GetGlobalService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
             VersionControlExt ex = dte.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;
             _pendingChangesExt = ex.PendingChanges;
         }
         if (_pendingChangesExt != null)
         {
             _pendingChangesExt.PropertyChanged += svc_PropertyChanged;
         }
     }
 }
Exemplo n.º 10
0
        public void ViewHistory()
        {
            ITeamFoundationContext context = this.CurrentContext;

            if (context != null && context.HasCollection && context.HasTeamProject)
            {
                VersionControlServer vcs = context.TeamProjectCollection.GetService <VersionControlServer>();
                if (vcs != null)
                {
                    // Ask the derived section for the history parameters
                    string user;
                    int    maxCount;
                    this.GetHistoryParameters(vcs, out user, out maxCount);
                    string            path = "$/" + context.TeamProjectName;
                    VersionControlExt vc   = GetVersionControlExt(this.ServiceProvider);
                    if (vc != null)
                    {
                        vc.History.Show(path, VersionSpec.Latest, 0, RecursionType.Full, user, null, null, int.MaxValue, true);
                    }
                }
            }
        }
        /// <summary>Initializes a new instance of the TeamExplorerIntegrator class, The constructor for the Add-in object. Place your initialization code within this method.</summary> 
        public TeamExplorerIntegrator(EnvDTE.IVsExtensibility extensibility, ITeamFoundationContextManager te)
        {
            this.dirtyPath = new List<string>();
            this.tfsContextManager = te;

            // get IDE Globals object and DTE from that
            EnvDTE80.DTE2 dte2 = extensibility.GetGlobalsObject(null).DTE as EnvDTE80.DTE2;
            this.applicationObject = dte2;

            Debug.Assert(dte2 != null, "No DTE2");

            TeamFoundationServerExt tfsExt = (TeamFoundationServerExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt");
            this.srcCtrlExplorer = (VersionControlExt)dte2.Application.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt");

            this.DoConnect(tfsExt);
        }