Browse Source

Fixed NullReferenceException in ShowErrorHelpCommand.Run.

Hide "Show error" command from Task List.
Fixed potential InvalidCastException in CSharpOutputVisitor.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5599 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
2f6ade9faf
  1. 8
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 3
      src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs
  3. 7
      src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs
  4. 4
      src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs
  5. 4
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs
  6. 9
      src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskView.cs
  7. 5
      src/Main/Base/Project/Src/Services/Tasks/Task.cs

8
AddIns/ICSharpCode.SharpDevelop.addin

@ -2203,6 +2203,14 @@ @@ -2203,6 +2203,14 @@
type = "ComboBox"/>
</Path>
<Path name="/SharpDevelop/Pads/TaskList/TaskContextMenu">
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
type = "Item"
icon = "Icons.16x16.CopyIcon"
class = "ICSharpCode.SharpDevelop.Commands.Copy"/>
</Path>
<Path name="/SharpDevelop/Services/ParserService/SingleFileGacReferences">
<String id = "System" text = "System"/>
<String id = "System.Core" text = "System.Core"/>

3
src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs

@ -29,6 +29,9 @@ namespace HtmlHelp2.Commands @@ -29,6 +29,9 @@ namespace HtmlHelp2.Commands
// Search all selected tasks
foreach (Task t in new List<Task>(view.SelectedTasks)) {
if (t.BuildError == null)
continue;
string code = t.BuildError.ErrorCode;
if (string.IsNullOrEmpty(code))

7
src/Libraries/NRefactory/Project/Src/PrettyPrinter/CSharp/CSharpOutputVisitor.cs

@ -358,7 +358,12 @@ namespace ICSharpCode.NRefactory.PrettyPrinter @@ -358,7 +358,12 @@ namespace ICSharpCode.NRefactory.PrettyPrinter
void OutputEnumMembers(TypeDeclaration typeDeclaration, object data)
{
for (int i = 0; i < typeDeclaration.Children.Count; i++) {
FieldDeclaration fieldDeclaration = (FieldDeclaration)typeDeclaration.Children[i];
FieldDeclaration fieldDeclaration = typeDeclaration.Children[i] as FieldDeclaration;
if (fieldDeclaration == null) {
// not a field?
TrackVisit(typeDeclaration.Children[i], data);
continue;
}
BeginVisit(fieldDeclaration);
VariableDeclaration f = (VariableDeclaration)fieldDeclaration.Fields[0];
VisitAttributes(fieldDeclaration.Attributes, data);

4
src/Main/Base/Project/Src/Gui/Pads/ErrorList/ErrorListPad.cs

@ -15,6 +15,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -15,6 +15,8 @@ namespace ICSharpCode.SharpDevelop.Gui
{
public class ErrorListPad : AbstractPadContent, IClipboardHandler
{
public const string DefaultContextMenuAddInTreeEntry = "/SharpDevelop/Pads/ErrorList/TaskContextMenu";
static ErrorListPad instance;
public static ErrorListPad Instance {
get {
@ -24,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -24,7 +26,7 @@ namespace ICSharpCode.SharpDevelop.Gui
ToolStrip toolStrip;
Panel contentPanel = new Panel();
TaskView taskView = new TaskView();
TaskView taskView = new TaskView() { DefaultContextMenuAddInTreeEntry = ErrorListPad.DefaultContextMenuAddInTreeEntry };
Properties properties;

4
src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskListPad.cs

@ -19,6 +19,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -19,6 +19,8 @@ namespace ICSharpCode.SharpDevelop.Gui
{
public class TaskListPad : AbstractPadContent, IClipboardHandler
{
public const string DefaultContextMenuAddInTreeEntry = "/SharpDevelop/Pads/TaskList/TaskContextMenu";
static TaskListPad instance;
Dictionary<string, bool> displayedTokens;
IClass oldClass;
@ -32,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -32,7 +34,7 @@ namespace ICSharpCode.SharpDevelop.Gui
ToolStrip toolStrip;
Panel contentPanel = new Panel();
TaskView taskView = new TaskView();
TaskView taskView = new TaskView() { DefaultContextMenuAddInTreeEntry = TaskListPad.DefaultContextMenuAddInTreeEntry };
public Dictionary<string, bool> DisplayedTokens {
get { return displayedTokens; }

9
src/Main/Base/Project/Src/Gui/Pads/TaskList/TaskView.cs

@ -41,6 +41,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -41,6 +41,8 @@ namespace ICSharpCode.SharpDevelop.Gui
ColumnHeader path = new ColumnHeader();
ToolTip taskToolTip = new ToolTip();
public string DefaultContextMenuAddInTreeEntry { get; set; }
public Task SelectedTask {
get {
if (this.FocusedItem==null) {
@ -243,11 +245,14 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -243,11 +245,14 @@ namespace ICSharpCode.SharpDevelop.Gui
for (int i = 1; i < this.SelectedItems.Count; i++) {
string entry2 = ((Task)this.SelectedItems[i].Tag).ContextMenuAddInTreeEntry;
if (entry2 != entry) {
entry = Task.DefaultContextMenuAddInTreeEntry;
entry = null;
break;
}
}
MenuService.ShowContextMenu(this, entry, this, pos.X, pos.Y);
if (entry == null)
entry = DefaultContextMenuAddInTreeEntry;
if (entry != null)
MenuService.ShowContextMenu(this, entry, this, pos.X, pos.Y);
}
}
base.WndProc(ref m);

5
src/Main/Base/Project/Src/Services/Tasks/Task.cs

@ -20,14 +20,15 @@ namespace ICSharpCode.SharpDevelop @@ -20,14 +20,15 @@ namespace ICSharpCode.SharpDevelop
public class Task
{
public const string DefaultContextMenuAddInTreeEntry = "/SharpDevelop/Pads/ErrorList/TaskContextMenu";
[Obsolete("Default path now depends on parent pad, use ErrorListPad.DefaultContextMenuAddInTreeEntry instead.")]
public const string DefaultContextMenuAddInTreeEntry = Gui.ErrorListPad.DefaultContextMenuAddInTreeEntry;
string description;
string fileName;
TaskType type;
int line;
int column;
string contextMenuAddInTreeEntry = DefaultContextMenuAddInTreeEntry;
string contextMenuAddInTreeEntry;
object tag;
public override string ToString()

Loading…
Cancel
Save