Browse Source

Debugger visualizers are loaded from AddInTree.

NullReferenceException fix in GenerateCode context action.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6430 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Martin Koníček 15 years ago
parent
commit
99a3286f72
  1. 7
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin
  2. 2
      src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj
  3. 0
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/IVisualizerDescriptor.cs
  4. 18
      src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/VisualizerDescriptors.cs
  5. 2
      src/AddIns/Misc/SharpRefactoring/Project/Src/GenerateCode.cs
  6. 2
      src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/ContextActionsBulbControl.xaml

7
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.addin

@ -158,4 +158,11 @@ @@ -158,4 +158,11 @@
<ToolbarItem class="ICSharpCode.SharpDevelop.Gui.Pads.SelectLanguageCommand"
type="ComboBox" id="SelectLanguageCommand" />
</Path>
<Path name="/SharpDevelop/Services/DebuggerService/Visualizers">
<Class class="Debugger.AddIn.Visualizers.TextVisualizerDescriptor" />
<Class class="Debugger.AddIn.Visualizers.XmlVisualizerDescriptor" />
<Class class="Debugger.AddIn.Visualizers.ObjectGraphVisualizerDescriptor" />
<Class class="Debugger.AddIn.Visualizers.GridVisualizerDescriptor" />
</Path>
</AddIn>

2
src/AddIns/Debugger/Debugger.AddIn/Debugger.AddIn.csproj

@ -138,7 +138,7 @@ @@ -138,7 +138,7 @@
<Compile Include="TreeModel\DebuggerResourceService.cs" />
<Compile Include="Visualizers\Commands\ExpressionVisualizerCommand.cs" />
<Compile Include="Visualizers\Commands\GridVisualizerCommand.cs" />
<Compile Include="Visualizers\Commands\IVisualizerCommandDescriptor.cs" />
<Compile Include="Visualizers\Commands\IVisualizerDescriptor.cs" />
<Compile Include="Visualizers\Commands\ObjectGraphVisualizerCommand.cs" />
<Compile Include="Visualizers\Commands\GridVisualizerMenuCommand.cs" />
<Compile Include="Visualizers\Commands\ObjectGraphVisualizerMenuCommand.cs" />

0
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/IVisualizerCommandDescriptor.cs → src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/IVisualizerDescriptor.cs

18
src/AddIns/Debugger/Debugger.AddIn/Visualizers/Commands/VisualizerDescriptors.cs

@ -9,6 +9,7 @@ using System; @@ -9,6 +9,7 @@ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using ICSharpCode.Core;
namespace Debugger.AddIn.Visualizers
{
@ -17,23 +18,18 @@ namespace Debugger.AddIn.Visualizers @@ -17,23 +18,18 @@ namespace Debugger.AddIn.Visualizers
/// </summary>
public static class VisualizerDescriptors
{
static ReadOnlyCollection<IVisualizerDescriptor> allDescriptors;
static IEnumerable<IVisualizerDescriptor> CreateAllDescriptors()
static IList<IVisualizerDescriptor> CreateAllDescriptors()
{
// these should be obtained from AddIn tree so that it is possible to write add-in for Debugger.AddIn with new visualizers
yield return new TextVisualizerDescriptor();
yield return new XmlVisualizerDescriptor();
yield return new ObjectGraphVisualizerDescriptor();
yield return new GridVisualizerDescriptor();
return AddInTree.BuildItems<IVisualizerDescriptor>("/SharpDevelop/Services/DebuggerService/Visualizers", null);
}
static ReadOnlyCollection<IVisualizerDescriptor> descriptors;
public static ReadOnlyCollection<IVisualizerDescriptor> GetAllDescriptors()
{
if (allDescriptors == null) {
allDescriptors = CreateAllDescriptors().ToList().AsReadOnly();
if (descriptors == null) {
descriptors = CreateAllDescriptors().ToList().AsReadOnly();
}
return allDescriptors;
return descriptors;
}
}
}

2
src/AddIns/Misc/SharpRefactoring/Project/Src/GenerateCode.cs

@ -44,7 +44,7 @@ namespace SharpRefactoring @@ -44,7 +44,7 @@ namespace SharpRefactoring
} catch (FormatException) {
}
if (unknownMethodCall.Target.IsUserCode()) {
if (unknownMethodCall.Target != null && unknownMethodCall.Target.IsUserCode()) {
// Don't introduce method on non-modyfiable types
return new IntroduceMethodContextAction(unknownMethodCall, expression, context.Editor) {
Title = title

2
src/Main/Base/Project/Src/Services/RefactoringService/ContextActions/ContextActionsBulbControl.xaml

@ -236,7 +236,7 @@ @@ -236,7 +236,7 @@
<DataTemplate>
<DockPanel HorizontalAlignment="Stretch" LastChildFill="True">
<Image Source="{Binding Image}" Margin="3 2 4 2" DockPanel.Dock="Left" />
<!-- Command of every checkbox is the command on the main DataContext (ContextActionsBulbViewModel) -->
<!-- Command of every checkbox points to the command on the main DataContext (ContextActionsBulbViewModel) -->
<CheckBox IsChecked="{Binding IsVisible}" VerticalAlignment="Center" DockPanel.Dock="Right"
Command="{Binding Path=DataContext.ActionVisibleChangedCommand,
RelativeSource={RelativeSource AncestorType={x:Type local:ContextActionsBulbControl}}}"

Loading…
Cancel
Save