Browse Source

fix item 5 of #553: there should be a "Copy" menu item in the AvalonEdit's popup menu among the "Toggle Folding" menu items

- add proper file header and correct indentation in FoldingCommands.cs
pull/569/head
Siegfried Pammer 11 years ago
parent
commit
ca1dba0e92
  1. 1
      ILSpy/ILSpy.csproj
  2. 44
      ILSpy/TextView/EditorCommands.cs
  3. 26
      ILSpy/TextView/FoldingCommands.cs

1
ILSpy/ILSpy.csproj

@ -180,6 +180,7 @@
<Compile Include="Commands\SimpleCommand.cs" /> <Compile Include="Commands\SimpleCommand.cs" />
<Compile Include="SearchStrategies.cs" /> <Compile Include="SearchStrategies.cs" />
<Compile Include="TaskHelper.cs" /> <Compile Include="TaskHelper.cs" />
<Compile Include="TextView\EditorCommands.cs" />
<Compile Include="TextView\FoldingCommands.cs" /> <Compile Include="TextView\FoldingCommands.cs" />
<Compile Include="TreeNodes\Analyzer\AnalyzeContextMenuEntry.cs" /> <Compile Include="TreeNodes\Analyzer\AnalyzeContextMenuEntry.cs" />
<Compile Include="TreeNodes\Analyzer\AnalyzedAssemblyTreeNode.cs" /> <Compile Include="TreeNodes\Analyzer\AnalyzedAssemblyTreeNode.cs" />

44
ILSpy/TextView/EditorCommands.cs

@ -0,0 +1,44 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ICSharpCode.ILSpy.TextView
{
[ExportContextMenuEntryAttribute(Header = "Copy", Category = "Editor")]
internal sealed class CopyContextMenuEntry : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
{
return context.TextView != null;
}
public bool IsEnabled(TextViewContext context)
{
return context.TextView != null && context.TextView.textEditor.SelectionLength > 0;
}
public void Execute(TextViewContext context)
{
context.TextView.textEditor.Copy();
}
}
}

26
ILSpy/TextView/FoldingCommands.cs

@ -1,11 +1,21 @@
/* // Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
* Created by SharpDevelop. //
* User: Ronny Klier // Permission is hereby granted, free of charge, to any person obtaining a copy of this
* Date: 24.05.2012 // software and associated documentation files (the "Software"), to deal in the Software
* Time: 23:44 // without restriction, including without limitation the rights to use, copy, modify, merge,
* // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* To change this template use Tools | Options | Coding | Edit Standard Headers. // to whom the Software is furnished to do so, subject to the following conditions:
*/ //
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;

Loading…
Cancel
Save