예제 #1
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try {
                    InteractiveWindow.CloseAll(this);
                } catch (Exception ex) {
                    Console.WriteLine("Error while closing all interactive windows");
                    Console.WriteLine(ex);
                }

                if (_deletePerformanceSessions)
                {
                    try {
                        dynamic profiling = Dte.GetObject("PythonProfiling");

                        for (dynamic session = profiling.GetSession(1);
                             session != null;
                             session = profiling.GetSession(1))
                        {
                            profiling.RemoveSession(session, true);
                        }
                    } catch (Exception ex) {
                        Console.WriteLine("Error while cleaning up profiling sessions");
                        Console.WriteLine(ex);
                    }
                }
            }
            base.Dispose(disposing);
        }
        public void ShowWorkItem(int id)
        {
            try
            {
                DocumentService          doc   = Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.WorkItemTracking.DocumentService") as DocumentService;
                TfsTeamProjectCollection col   = (TfsTeamProjectCollection)Repository.Instance.TfsBridgeProvider.TfsTeamProjectCollection;
                IWorkItemDocument        wiDoc = doc.GetWorkItem(col, id, this);


                try
                {
                    if (!wiDoc.IsLoaded)
                    {
                        wiDoc.Load();
                    }
                    doc.ShowWorkItem(wiDoc);
                }
                finally
                {
                    wiDoc.Release(this);
                }
            }
            catch (Exception ex)
            {
                SimpleLogger.Log(ex, true);
            }
        }
예제 #3
0
 public void TrackChangeset(int id)
 {
     try
     {
         var ext = Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;
         ext.BranchVisualizer.TrackChangeset(id);
     }
     catch (Exception)
     {
     }
 }
예제 #4
0
 public void ShowChangeset(int id)
 {
     try
     {
         var ext = Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;
         ext.ViewChangesetDetails(id);
     }
     catch (Exception)
     {
     }
 }
 public void TrackWorkItem(int id)
 {
     try
     {
         var ext = Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;
         ext.BranchVisualizer.TrackWorkItem(id);
     }
     catch (Exception ex)
     {
         SimpleLogger.Log(ex, true);
     }
 }
예제 #6
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try {
                    ServiceProvider.GetUIThread().Invoke(() => {
                        var iwp = ComponentModel.GetService <InteractiveWindowProvider>();
                        if (iwp != null)
                        {
                            foreach (var w in iwp.AllOpenWindows)
                            {
                                w.InteractiveWindow.Close();
                            }
                        }
                    });
                } catch (Exception ex) {
                    Console.WriteLine("Error while closing all interactive windows");
                    Console.WriteLine(ex);
                }

                if (_deletePerformanceSessions)
                {
                    try {
                        dynamic profiling = Dte.GetObject("PythonProfiling");

                        for (dynamic session = profiling.GetSession(1);
                             session != null;
                             session = profiling.GetSession(1))
                        {
                            profiling.RemoveSession(session, true);
                        }
                    } catch (Exception ex) {
                        Console.WriteLine("Error while cleaning up profiling sessions");
                        Console.WriteLine(ex);
                    }
                }
            }
            base.Dispose(disposing);
        }
        public string BrowseForTfsFolder(string startFrom)
        {
            var ext = Dte.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt") as VersionControlExt;

            VersionControlServer versionControlServer = Repository.Instance.TfsBridgeProvider.VersionControlServer;
            Assembly             controlsAssembly     = Assembly.GetAssembly(typeof(Microsoft.TeamFoundation.VersionControl.Controls.ControlAddItemsExclude));
            Type vcChooseItemDialogType = controlsAssembly.GetType("Microsoft.TeamFoundation.VersionControl.Controls.DialogChooseItem");

            ConstructorInfo ci = vcChooseItemDialogType.GetConstructor(
                BindingFlags.Instance | BindingFlags.NonPublic,
                null,
                new Type[] { typeof(VersionControlServer), typeof(string), typeof(string) },
                null);
            var chooseItemDialog = (Form)ci.Invoke(new object[] { versionControlServer, startFrom, startFrom });

            var selectedItemProperty = vcChooseItemDialogType.GetProperty("SelectedItem", BindingFlags.Instance | BindingFlags.NonPublic);

            if (chooseItemDialog.ShowDialog() == DialogResult.OK)
            {
                var itemResult = (Item)selectedItemProperty.GetValue(chooseItemDialog, null);
                return(itemResult.ServerItem);
            }
            return(null);
        }