mirror of https://github.com/icsharpcode/ILSpy.git
79 changed files with 1882 additions and 1839 deletions
@ -1,123 +0,0 @@
@@ -1,123 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Windows.Media; |
||||
|
||||
using ICSharpCode.ILSpy.Debugger.Bookmarks; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger.AvalonEdit |
||||
{ |
||||
/// <summary>
|
||||
/// Represents a text marker.
|
||||
/// </summary>
|
||||
public interface ITextMarker |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the start offset of the marked text region.
|
||||
/// </summary>
|
||||
int StartOffset { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the end offset of the marked text region.
|
||||
/// </summary>
|
||||
int EndOffset { get; } |
||||
|
||||
/// <summary>
|
||||
/// Gets the length of the marked region.
|
||||
/// </summary>
|
||||
int Length { get; } |
||||
|
||||
/// <summary>
|
||||
/// Deletes the text marker.
|
||||
/// </summary>
|
||||
void Delete(); |
||||
|
||||
/// <summary>
|
||||
/// Gets whether the text marker was deleted.
|
||||
/// </summary>
|
||||
bool IsDeleted { get; } |
||||
|
||||
/// <summary>
|
||||
/// Event that occurs when the text marker is deleted.
|
||||
/// </summary>
|
||||
event EventHandler Deleted; |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the background color.
|
||||
/// </summary>
|
||||
Color? BackgroundColor { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the foreground color.
|
||||
/// </summary>
|
||||
Color? ForegroundColor { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the type of the marker. Use TextMarkerType.None for normal markers.
|
||||
/// </summary>
|
||||
TextMarkerType MarkerType { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets the color of the marker.
|
||||
/// </summary>
|
||||
Color MarkerColor { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets an object with additional data for this text marker.
|
||||
/// </summary>
|
||||
object Tag { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets/Sets an object that will be displayed as tooltip in the text editor.
|
||||
/// </summary>
|
||||
object ToolTip { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets if the marker is visible or not.
|
||||
/// </summary>
|
||||
Predicate<object> IsVisible { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the bookmark.
|
||||
/// </summary>
|
||||
IBookmark Bookmark { get; set; } |
||||
} |
||||
|
||||
public enum TextMarkerType |
||||
{ |
||||
/// <summary>
|
||||
/// Use no marker
|
||||
/// </summary>
|
||||
None, |
||||
/// <summary>
|
||||
/// Use squiggly underline marker
|
||||
/// </summary>
|
||||
SquigglyUnderline |
||||
} |
||||
|
||||
public interface ITextMarkerService |
||||
{ |
||||
/// <summary>
|
||||
/// Creates a new text marker. The text marker will be invisible at first,
|
||||
/// you need to set one of the Color properties to make it visible.
|
||||
/// </summary>
|
||||
ITextMarker Create(int startOffset, int length); |
||||
|
||||
/// <summary>
|
||||
/// Gets the list of text markers.
|
||||
/// </summary>
|
||||
IEnumerable<ITextMarker> TextMarkers { get; } |
||||
|
||||
/// <summary>
|
||||
/// Removes the specified text marker.
|
||||
/// </summary>
|
||||
void Remove(ITextMarker marker); |
||||
|
||||
/// <summary>
|
||||
/// Removes all text markers that match the condition.
|
||||
/// </summary>
|
||||
void RemoveAll(Predicate<ITextMarker> predicate); |
||||
} |
||||
} |
||||
@ -1,35 +0,0 @@
@@ -1,35 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger.AvalonEdit |
||||
{ |
||||
/// <summary>
|
||||
/// Content of text editor tooltip (used as <see cref="ToolTipRequestEventArgs.ContentToShow"/>),
|
||||
/// specifying whether it should be displayed in a WPF Popup.
|
||||
/// </summary>
|
||||
internal interface ITooltip |
||||
{ |
||||
/// <summary>
|
||||
/// If true, this ITooltip will be displayed in a WPF Popup.
|
||||
/// Otherwise it will be displayed in a WPF Tooltip.
|
||||
/// WPF Popups are (unlike WPF Tooltips) focusable.
|
||||
/// </summary>
|
||||
bool ShowAsPopup { get; } |
||||
|
||||
/// <summary>
|
||||
/// Closes this tooltip.
|
||||
/// </summary>
|
||||
/// <param name="mouseClick">True if close request is raised
|
||||
/// because of mouse click on some SharpDevelop GUI element.</param>
|
||||
/// <returns>True if Close succeeded (that is, can close). False otherwise.</returns>
|
||||
bool Close(bool mouseClick); |
||||
|
||||
/// <summary>
|
||||
/// Occurs when this tooltip decides to close.
|
||||
/// </summary>
|
||||
event RoutedEventHandler Closed; |
||||
} |
||||
} |
||||
@ -1,333 +0,0 @@
@@ -1,333 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel.Composition; |
||||
using System.Diagnostics; |
||||
using System.Linq; |
||||
using System.Windows; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
|
||||
using ICSharpCode.AvalonEdit.Editing; |
||||
using ICSharpCode.AvalonEdit.Rendering; |
||||
using ICSharpCode.AvalonEdit.Utils; |
||||
using ICSharpCode.Decompiler; |
||||
using ICSharpCode.ILSpy.Debugger.Bookmarks; |
||||
using ICSharpCode.ILSpy.Debugger.Services; |
||||
using ICSharpCode.NRefactory.CSharp; |
||||
using Mono.Cecil; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger.AvalonEdit |
||||
{ |
||||
[Export("IconMargin"), PartCreationPolicy(CreationPolicy.Shared)] |
||||
public class IconBarMargin : AbstractMargin, IDisposable |
||||
{ |
||||
public IconBarMargin() |
||||
{ |
||||
BookmarkManager.Added += delegate { InvalidateVisual(); }; |
||||
BookmarkManager.Removed += delegate { InvalidateVisual(); }; |
||||
} |
||||
|
||||
public virtual void Dispose() |
||||
{ |
||||
this.TextView = null; // detach from TextView (will also detach from manager)
|
||||
} |
||||
|
||||
/// <inheritdoc/>
|
||||
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters) |
||||
{ |
||||
// accept clicks even when clicking on the background
|
||||
return new PointHitTestResult(this, hitTestParameters.HitPoint); |
||||
} |
||||
|
||||
/// <inheritdoc/>
|
||||
protected override Size MeasureOverride(Size availableSize) |
||||
{ |
||||
return new Size(18, 0); |
||||
} |
||||
|
||||
protected override void OnRender(DrawingContext drawingContext) |
||||
{ |
||||
Size renderSize = this.RenderSize; |
||||
drawingContext.DrawRectangle(SystemColors.ControlBrush, null, |
||||
new Rect(0, 0, renderSize.Width, renderSize.Height)); |
||||
drawingContext.DrawLine(new Pen(SystemColors.ControlDarkBrush, 1), |
||||
new Point(renderSize.Width - 0.5, 0), |
||||
new Point(renderSize.Width - 0.5, renderSize.Height)); |
||||
|
||||
TextView textView = this.TextView; |
||||
if (textView != null && textView.VisualLinesValid) { |
||||
// create a dictionary line number => first bookmark
|
||||
Dictionary<int, BookmarkBase> bookmarkDict = new Dictionary<int, BookmarkBase>(); |
||||
foreach (var bm in BookmarkManager.Bookmarks) { |
||||
if (DebugData.DecompiledMemberReferences == null || DebugData.DecompiledMemberReferences.Count == 0 || |
||||
!DebugData.DecompiledMemberReferences.ContainsKey(bm.MemberReference.MetadataToken.ToInt32())) |
||||
continue; |
||||
|
||||
int line = bm.LineNumber; |
||||
BookmarkBase existingBookmark; |
||||
if (!bookmarkDict.TryGetValue(line, out existingBookmark) || bm.ZOrder > existingBookmark.ZOrder) |
||||
bookmarkDict[line] = bm; |
||||
} |
||||
Size pixelSize = PixelSnapHelpers.GetPixelSize(this); |
||||
foreach (VisualLine line in textView.VisualLines) { |
||||
int lineNumber = line.FirstDocumentLine.LineNumber; |
||||
BookmarkBase bm; |
||||
if (bookmarkDict.TryGetValue(lineNumber, out bm)) { |
||||
Rect rect = new Rect(0, PixelSnapHelpers.Round(line.VisualTop - textView.VerticalOffset, pixelSize.Height), 16, 16); |
||||
if (dragDropBookmark == bm && dragStarted) |
||||
drawingContext.PushOpacity(0.5); |
||||
drawingContext.DrawImage(bm.Image, rect); |
||||
if (dragDropBookmark == bm && dragStarted) |
||||
drawingContext.Pop(); |
||||
} |
||||
} |
||||
if (dragDropBookmark != null && dragStarted) { |
||||
Rect rect = new Rect(0, PixelSnapHelpers.Round(dragDropCurrentPoint - 8, pixelSize.Height), 16, 16); |
||||
drawingContext.DrawImage(dragDropBookmark.Image, rect); |
||||
} |
||||
} |
||||
} |
||||
|
||||
IBookmark dragDropBookmark; // bookmark being dragged (!=null if drag'n'drop is active)
|
||||
double dragDropStartPoint; |
||||
double dragDropCurrentPoint; |
||||
bool dragStarted; // whether drag'n'drop operation has started (mouse was moved minimum distance)
|
||||
|
||||
protected override void OnMouseDown(MouseButtonEventArgs e) |
||||
{ |
||||
base.OnMouseDown(e); |
||||
int line = GetLineFromMousePosition(e); |
||||
if (!e.Handled && line > 0) { |
||||
IBookmark bm = GetBookmarkFromLine(line); |
||||
if (bm != null) { |
||||
bm.MouseDown(e); |
||||
if (!e.Handled) { |
||||
if (e.ChangedButton == MouseButton.Left && bm.CanDragDrop && CaptureMouse()) { |
||||
StartDragDrop(bm, e); |
||||
e.Handled = true; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
// don't allow selecting text through the IconBarMargin
|
||||
if (e.ChangedButton == MouseButton.Left) |
||||
e.Handled = true; |
||||
} |
||||
|
||||
BookmarkBase GetBookmarkFromLine(int line) |
||||
{ |
||||
BookmarkBase result = null; |
||||
foreach (BookmarkBase bm in BookmarkManager.Bookmarks) { |
||||
if (bm.LineNumber == line && |
||||
DebugData.DecompiledMemberReferences != null && DebugData.DecompiledMemberReferences.ContainsKey(bm.MemberReference.MetadataToken.ToInt32())) { |
||||
if (result == null || bm.ZOrder > result.ZOrder) |
||||
result = bm; |
||||
} |
||||
} |
||||
return result; |
||||
} |
||||
|
||||
protected override void OnLostMouseCapture(MouseEventArgs e) |
||||
{ |
||||
CancelDragDrop(); |
||||
base.OnLostMouseCapture(e); |
||||
} |
||||
|
||||
void StartDragDrop(IBookmark bm, MouseEventArgs e) |
||||
{ |
||||
dragDropBookmark = bm; |
||||
dragDropStartPoint = dragDropCurrentPoint = e.GetPosition(this).Y; |
||||
if (TextView != null) { |
||||
TextArea area = TextView.Services.GetService(typeof(TextArea)) as TextArea; |
||||
if (area != null) |
||||
area.PreviewKeyDown += TextArea_PreviewKeyDown; |
||||
} |
||||
} |
||||
|
||||
void CancelDragDrop() |
||||
{ |
||||
if (dragDropBookmark != null) { |
||||
dragDropBookmark = null; |
||||
dragStarted = false; |
||||
if (TextView != null) { |
||||
TextArea area = TextView.Services.GetService(typeof(TextArea)) as TextArea; |
||||
if (area != null) |
||||
area.PreviewKeyDown -= TextArea_PreviewKeyDown; |
||||
} |
||||
ReleaseMouseCapture(); |
||||
InvalidateVisual(); |
||||
} |
||||
} |
||||
|
||||
void TextArea_PreviewKeyDown(object sender, KeyEventArgs e) |
||||
{ |
||||
// any key press cancels drag'n'drop
|
||||
CancelDragDrop(); |
||||
if (e.Key == Key.Escape) |
||||
e.Handled = true; |
||||
} |
||||
|
||||
int GetLineFromMousePosition(MouseEventArgs e) |
||||
{ |
||||
TextView textView = this.TextView; |
||||
if (textView == null) |
||||
return 0; |
||||
VisualLine vl = textView.GetVisualLineFromVisualTop(e.GetPosition(textView).Y + textView.ScrollOffset.Y); |
||||
if (vl == null) |
||||
return 0; |
||||
return vl.FirstDocumentLine.LineNumber; |
||||
} |
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e) |
||||
{ |
||||
base.OnMouseMove(e); |
||||
if (dragDropBookmark != null) { |
||||
dragDropCurrentPoint = e.GetPosition(this).Y; |
||||
if (Math.Abs(dragDropCurrentPoint - dragDropStartPoint) > SystemParameters.MinimumVerticalDragDistance) |
||||
dragStarted = true; |
||||
InvalidateVisual(); |
||||
} |
||||
|
||||
BreakpointBookmark bm = BookmarkManager.Bookmarks.Find( |
||||
b => DebugData.CodeMappings != null && DebugData.CodeMappings.ContainsKey(b.MemberReference.MetadataToken.ToInt32()) && |
||||
b.LineNumber == GetLineFromMousePosition(e) |
||||
&& b is BreakpointBookmark) as BreakpointBookmark; |
||||
|
||||
this.ToolTip = (bm != null) ? bm.Tooltip : null; |
||||
} |
||||
|
||||
protected override void OnMouseUp(MouseButtonEventArgs e) |
||||
{ |
||||
base.OnMouseUp(e); |
||||
int line = GetLineFromMousePosition(e); |
||||
if (!e.Handled && dragDropBookmark != null) { |
||||
if (dragStarted) { |
||||
if (line != 0) |
||||
dragDropBookmark.Drop(line); |
||||
e.Handled = true; |
||||
} |
||||
CancelDragDrop(); |
||||
} |
||||
if (!e.Handled && line != 0) { |
||||
BookmarkBase bm = GetBookmarkFromLine(line); |
||||
if (bm != null) { |
||||
bm.MouseUp(e); |
||||
|
||||
if (bm.CanToggle) { |
||||
BookmarkManager.RemoveMark(bm); |
||||
InvalidateVisual(); |
||||
} |
||||
|
||||
if (e.Handled) |
||||
return; |
||||
} |
||||
if (e.ChangedButton == MouseButton.Left) { |
||||
if (DebugData.CodeMappings != null && DebugData.CodeMappings.Count > 0) { |
||||
|
||||
// check if the codemappings exists for this line
|
||||
var storage = DebugData.CodeMappings; |
||||
int token = 0; |
||||
foreach (var key in storage.Keys) { |
||||
var instruction = storage[key].GetInstructionByLineNumber(line, out token); |
||||
|
||||
if (instruction == null) { |
||||
continue; |
||||
} |
||||
|
||||
// no bookmark on the line: create a new breakpoint
|
||||
DebuggerService.ToggleBreakpointAt( |
||||
DebugData.DecompiledMemberReferences[key], |
||||
line, |
||||
instruction.ILInstructionOffset, |
||||
DebugData.Language); |
||||
break; |
||||
} |
||||
|
||||
if (token == 0) { |
||||
MessageBox.Show(string.Format("Missing code mappings at line {0}.", line), |
||||
"Code mappings", MessageBoxButton.OK, MessageBoxImage.Information); |
||||
return; |
||||
} |
||||
} |
||||
} |
||||
InvalidateVisual(); |
||||
} |
||||
} |
||||
|
||||
public void SyncBookmarks() |
||||
{ |
||||
var storage = DebugData.CodeMappings; |
||||
if (storage == null || storage.Count == 0) |
||||
return; |
||||
|
||||
//remove existing bookmarks and create new ones
|
||||
List<BreakpointBookmark> newBookmarks = new List<BreakpointBookmark>(); |
||||
for (int i = BookmarkManager.Bookmarks.Count - 1; i >= 0; --i) { |
||||
var breakpoint = BookmarkManager.Bookmarks[i] as BreakpointBookmark; |
||||
if (breakpoint == null) |
||||
continue; |
||||
|
||||
var key = breakpoint.MemberReference.MetadataToken.ToInt32(); |
||||
if (!storage.ContainsKey(key)) |
||||
continue; |
||||
|
||||
var member = DebugData.DecompiledMemberReferences[key]; |
||||
|
||||
bool isMatch; |
||||
SourceCodeMapping map = storage[key].GetInstructionByTokenAndOffset( |
||||
member.MetadataToken.ToInt32(), breakpoint.ILRange.From, out isMatch); |
||||
|
||||
if (map != null) { |
||||
newBookmarks.Add(new BreakpointBookmark( |
||||
member, new AstLocation(map.SourceCodeLine, 0), |
||||
map.ILInstructionOffset, BreakpointAction.Break, DebugData.Language)); |
||||
|
||||
BookmarkManager.RemoveMark(breakpoint); |
||||
} |
||||
} |
||||
|
||||
newBookmarks.ForEach(m => BookmarkManager.AddMark(m)); |
||||
|
||||
SyncCurrentLineBookmark(); |
||||
} |
||||
|
||||
void SyncCurrentLineBookmark() |
||||
{ |
||||
// checks
|
||||
if (CurrentLineBookmark.Instance == null) |
||||
return; |
||||
|
||||
var oldMappings = DebugData.OldCodeMappings; |
||||
var newMappings = DebugData.CodeMappings; |
||||
|
||||
if (oldMappings == null || newMappings == null) |
||||
return; |
||||
|
||||
// 1. Save it's data
|
||||
int line = CurrentLineBookmark.Instance.LineNumber; |
||||
var markerType = CurrentLineBookmark.Instance.MemberReference; |
||||
|
||||
if (!oldMappings.ContainsKey(markerType.MetadataToken.ToInt32()) || !newMappings.ContainsKey(markerType.MetadataToken.ToInt32())) |
||||
return; |
||||
|
||||
// 2. Remove it
|
||||
CurrentLineBookmark.Remove(); |
||||
|
||||
// 3. map the marker line
|
||||
int token; |
||||
var instruction = oldMappings[markerType.MetadataToken.ToInt32()].GetInstructionByLineNumber(line, out token); |
||||
if (instruction == null) |
||||
return; |
||||
|
||||
MemberReference memberReference; |
||||
int newline; |
||||
if (newMappings[markerType.MetadataToken.ToInt32()].GetInstructionByTokenAndOffset(token, instruction.ILInstructionOffset.From, out memberReference, out newline)) { |
||||
// 4. create breakpoint for new languages
|
||||
CurrentLineBookmark.SetPosition(memberReference, newline, 0, newline, 0); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -1,67 +0,0 @@
@@ -1,67 +0,0 @@
|
||||
// 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.Windows; |
||||
using ICSharpCode.AvalonEdit; |
||||
using ICSharpCode.AvalonEdit.Utils; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger.AvalonEdit |
||||
{ |
||||
public static class TextEditorWeakEventManager |
||||
{ |
||||
public sealed class MouseHover : WeakEventManagerBase<MouseHover, TextEditor> |
||||
{ |
||||
protected override void StopListening(TextEditor source) |
||||
{ |
||||
source.MouseHover -= DeliverEvent; |
||||
} |
||||
|
||||
protected override void StartListening(TextEditor source) |
||||
{ |
||||
source.MouseHover += DeliverEvent; |
||||
} |
||||
} |
||||
|
||||
public sealed class MouseHoverStopped : WeakEventManagerBase<MouseHoverStopped, TextEditor> |
||||
{ |
||||
protected override void StopListening(TextEditor source) |
||||
{ |
||||
source.MouseHoverStopped -= DeliverEvent; |
||||
} |
||||
|
||||
protected override void StartListening(TextEditor source) |
||||
{ |
||||
source.MouseHoverStopped += DeliverEvent; |
||||
} |
||||
} |
||||
|
||||
public sealed class MouseDown : WeakEventManagerBase<MouseDown, TextEditor> |
||||
{ |
||||
protected override void StopListening(TextEditor source) |
||||
{ |
||||
source.MouseDown -= DeliverEvent; |
||||
} |
||||
|
||||
protected override void StartListening(TextEditor source) |
||||
{ |
||||
source.MouseDown += DeliverEvent; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -1,319 +0,0 @@
@@ -1,319 +0,0 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.ComponentModel.Composition; |
||||
using System.Linq; |
||||
using System.Windows; |
||||
using System.Windows.Media; |
||||
using System.Windows.Threading; |
||||
|
||||
using ICSharpCode.AvalonEdit; |
||||
using ICSharpCode.AvalonEdit.Document; |
||||
using ICSharpCode.AvalonEdit.Rendering; |
||||
using ICSharpCode.ILSpy.Debugger.Bookmarks; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger.AvalonEdit |
||||
{ |
||||
/// <summary>
|
||||
/// Handles the text markers for a code editor.
|
||||
/// </summary>
|
||||
[Export("TextMarkerService"), PartCreationPolicy(CreationPolicy.Shared)] |
||||
public sealed class TextMarkerService : DocumentColorizingTransformer, IBackgroundRenderer, ITextMarkerService |
||||
{ |
||||
TextEditor codeEditor; |
||||
|
||||
TextSegmentCollection<TextMarker> markers = new TextSegmentCollection<TextMarker>(); |
||||
|
||||
public TextMarkerService() |
||||
{ |
||||
BookmarkManager.Added += new BookmarkEventHandler(BookmarkManager_Added); |
||||
BookmarkManager.Removed += new BookmarkEventHandler(BookmarkManager_Removed); |
||||
} |
||||
|
||||
public TextEditor CodeEditor { |
||||
get { return codeEditor; } |
||||
set { codeEditor = value; } |
||||
} |
||||
|
||||
void BookmarkManager_Removed(object sender, BookmarkEventArgs e) |
||||
{ |
||||
if (e.Bookmark is BreakpointBookmark) { |
||||
var bm = (MarkerBookmark)e.Bookmark; |
||||
Remove(bm.Marker); |
||||
} |
||||
|
||||
if (e.Bookmark is CurrentLineBookmark) { |
||||
RemoveAll(m => m.Bookmark is CurrentLineBookmark); |
||||
} |
||||
} |
||||
|
||||
void BookmarkManager_Added(object sender, BookmarkEventArgs e) |
||||
{ |
||||
if (e.Bookmark is MarkerBookmark) { |
||||
var bm = (MarkerBookmark)e.Bookmark; |
||||
// add bookmark for the current type
|
||||
if (bm.LineNumber < codeEditor.Document.LineCount) { |
||||
DocumentLine line = codeEditor.Document.GetLineByNumber(bm.LineNumber); |
||||
bm.CreateMarker(this, line.Offset, line.Length); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#region ITextMarkerService
|
||||
public ITextMarker Create(int startOffset, int length) |
||||
{ |
||||
int textLength = codeEditor.TextArea.TextView.Document.TextLength; |
||||
if (startOffset < 0 || startOffset > textLength) |
||||
throw new ArgumentOutOfRangeException("startOffset", startOffset, "Value must be between 0 and " + textLength); |
||||
if (length < 0 || startOffset + length > textLength) |
||||
throw new ArgumentOutOfRangeException("length", length, "length must not be negative and startOffset+length must not be after the end of the document"); |
||||
|
||||
TextMarker m = new TextMarker(this, startOffset, length); |
||||
markers.Add(m); |
||||
// no need to mark segment for redraw: the text marker is invisible until a property is set
|
||||
return m; |
||||
} |
||||
|
||||
public IEnumerable<ITextMarker> GetMarkersAtOffset(int offset) |
||||
{ |
||||
return markers.FindSegmentsContaining(offset); |
||||
} |
||||
|
||||
public IEnumerable<ITextMarker> TextMarkers { |
||||
get { return markers; } |
||||
} |
||||
|
||||
public void RemoveAll(Predicate<ITextMarker> predicate) |
||||
{ |
||||
if (predicate == null) |
||||
throw new ArgumentNullException("predicate"); |
||||
foreach (TextMarker m in markers.ToArray()) { |
||||
if (predicate(m)) |
||||
Remove(m); |
||||
} |
||||
} |
||||
|
||||
public void Remove(ITextMarker marker) |
||||
{ |
||||
if (marker == null) |
||||
return; |
||||
|
||||
TextMarker m = marker as TextMarker; |
||||
if (markers.Remove(m)) { |
||||
Redraw(m); |
||||
m.OnDeleted(); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Redraws the specified text segment.
|
||||
/// </summary>
|
||||
public void Redraw(ISegment segment) |
||||
{ |
||||
codeEditor.TextArea.TextView.Redraw(segment, DispatcherPriority.Normal); |
||||
} |
||||
#endregion
|
||||
|
||||
#region DocumentColorizingTransformer
|
||||
protected override void ColorizeLine(DocumentLine line) |
||||
{ |
||||
if (markers == null) |
||||
return; |
||||
int lineStart = line.Offset; |
||||
int lineEnd = lineStart + line.Length; |
||||
foreach (TextMarker marker in markers.FindOverlappingSegments(lineStart, line.Length).Reverse()) { |
||||
if (!marker.IsVisible(marker.Bookmark)) |
||||
continue; |
||||
|
||||
Brush foregroundBrush = null; |
||||
if (marker.ForegroundColor != null) { |
||||
foregroundBrush = new SolidColorBrush(marker.ForegroundColor.Value); |
||||
foregroundBrush.Freeze(); |
||||
} |
||||
ChangeLinePart( |
||||
Math.Max(marker.StartOffset, lineStart), |
||||
Math.Min(marker.EndOffset, lineEnd), |
||||
element => { |
||||
if (foregroundBrush != null) { |
||||
element.TextRunProperties.SetForegroundBrush(foregroundBrush); |
||||
} |
||||
} |
||||
); |
||||
} |
||||
} |
||||
#endregion
|
||||
|
||||
#region IBackgroundRenderer
|
||||
public KnownLayer Layer { |
||||
get { |
||||
// draw behind selection
|
||||
return KnownLayer.Selection; |
||||
} |
||||
} |
||||
|
||||
public void Draw(TextView textView, DrawingContext drawingContext) |
||||
{ |
||||
if (textView == null) |
||||
throw new ArgumentNullException("textView"); |
||||
if (drawingContext == null) |
||||
throw new ArgumentNullException("drawingContext"); |
||||
if (markers == null || !textView.VisualLinesValid) |
||||
return; |
||||
var visualLines = textView.VisualLines; |
||||
if (visualLines.Count == 0) |
||||
return; |
||||
int viewStart = visualLines.First().FirstDocumentLine.Offset; |
||||
int viewEnd = visualLines.Last().LastDocumentLine.Offset + visualLines.Last().LastDocumentLine.Length; |
||||
foreach (TextMarker marker in markers.FindOverlappingSegments(viewStart, viewEnd - viewStart).Reverse()) { |
||||
if (!marker.IsVisible(marker.Bookmark)) |
||||
continue; |
||||
|
||||
if (marker.BackgroundColor != null) { |
||||
BackgroundGeometryBuilder geoBuilder = new BackgroundGeometryBuilder(); |
||||
geoBuilder.AlignToWholePixels = true; |
||||
geoBuilder.CornerRadius = 3; |
||||
geoBuilder.AddSegment(textView, marker); |
||||
Geometry geometry = geoBuilder.CreateGeometry(); |
||||
if (geometry != null) { |
||||
Color color = marker.BackgroundColor.Value; |
||||
SolidColorBrush brush = new SolidColorBrush(color); |
||||
brush.Freeze(); |
||||
drawingContext.DrawGeometry(brush, null, geometry); |
||||
} |
||||
} |
||||
if (marker.MarkerType != TextMarkerType.None) { |
||||
foreach (Rect r in BackgroundGeometryBuilder.GetRectsForSegment(textView, marker)) { |
||||
Point startPoint = r.BottomLeft; |
||||
Point endPoint = r.BottomRight; |
||||
|
||||
Pen usedPen = new Pen(new SolidColorBrush(marker.MarkerColor), 1); |
||||
usedPen.Freeze(); |
||||
switch (marker.MarkerType) { |
||||
case TextMarkerType.SquigglyUnderline: |
||||
double offset = 2.5; |
||||
|
||||
int count = Math.Max((int)((endPoint.X - startPoint.X) / offset) + 1, 4); |
||||
|
||||
StreamGeometry geometry = new StreamGeometry(); |
||||
|
||||
using (StreamGeometryContext ctx = geometry.Open()) { |
||||
ctx.BeginFigure(startPoint, false, false); |
||||
ctx.PolyLineTo(CreatePoints(startPoint, endPoint, offset, count).ToArray(), true, false); |
||||
} |
||||
|
||||
geometry.Freeze(); |
||||
|
||||
drawingContext.DrawGeometry(Brushes.Transparent, usedPen, geometry); |
||||
break; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
IEnumerable<Point> CreatePoints(Point start, Point end, double offset, int count) |
||||
{ |
||||
for (int i = 0; i < count; i++) |
||||
yield return new Point(start.X + i * offset, start.Y - ((i + 1) % 2 == 0 ? offset : 0)); |
||||
} |
||||
#endregion
|
||||
} |
||||
|
||||
sealed class TextMarker : TextSegment, ITextMarker |
||||
{ |
||||
readonly TextMarkerService service; |
||||
|
||||
public TextMarker(TextMarkerService service, int startOffset, int length) |
||||
{ |
||||
if (service == null) |
||||
throw new ArgumentNullException("service"); |
||||
this.service = service; |
||||
this.StartOffset = startOffset; |
||||
this.Length = length; |
||||
this.markerType = TextMarkerType.None; |
||||
} |
||||
|
||||
public event EventHandler Deleted; |
||||
|
||||
public bool IsDeleted { |
||||
get { return !this.IsConnectedToCollection; } |
||||
} |
||||
|
||||
public void Delete() |
||||
{ |
||||
service.Remove(this); |
||||
} |
||||
|
||||
internal void OnDeleted() |
||||
{ |
||||
if (Deleted != null) |
||||
Deleted(this, EventArgs.Empty); |
||||
} |
||||
|
||||
void Redraw() |
||||
{ |
||||
service.Redraw(this); |
||||
} |
||||
|
||||
Color? backgroundColor; |
||||
|
||||
public Color? BackgroundColor { |
||||
get { return backgroundColor; } |
||||
set { |
||||
if (backgroundColor != value) { |
||||
backgroundColor = value; |
||||
Redraw(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
Color? foregroundColor; |
||||
|
||||
public Color? ForegroundColor { |
||||
get { return foregroundColor; } |
||||
set { |
||||
if (foregroundColor != value) { |
||||
foregroundColor = value; |
||||
Redraw(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public object Tag { get; set; } |
||||
|
||||
TextMarkerType markerType; |
||||
|
||||
public TextMarkerType MarkerType { |
||||
get { return markerType; } |
||||
set { |
||||
if (markerType != value) { |
||||
markerType = value; |
||||
Redraw(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
Color markerColor; |
||||
|
||||
public Color MarkerColor { |
||||
get { return markerColor; } |
||||
set { |
||||
if (markerColor != value) { |
||||
markerColor = value; |
||||
Redraw(); |
||||
} |
||||
} |
||||
|
||||
} |
||||
/// <inheritdoc/>
|
||||
public object ToolTip { get; set; } |
||||
|
||||
/// <inheritdoc/>
|
||||
public Predicate<object> IsVisible { get; set; } |
||||
|
||||
/// <inheritdoc/>
|
||||
public IBookmark Bookmark { get; set; } |
||||
} |
||||
} |
||||
@ -1,105 +0,0 @@
@@ -1,105 +0,0 @@
|
||||
// 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.Concurrent; |
||||
using System.Collections.Generic; |
||||
|
||||
using ICSharpCode.Decompiler; |
||||
using ICSharpCode.Decompiler.ILAst; |
||||
using Mono.Cecil; |
||||
|
||||
namespace ICSharpCode.ILSpy.Debugger |
||||
{ |
||||
/// <summary>
|
||||
/// Contains the data important for debugger from the main application.
|
||||
/// </summary>
|
||||
public static class DebugData |
||||
{ |
||||
static DecompiledLanguages language; |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the decompiled language.
|
||||
/// </summary>
|
||||
public static DecompiledLanguages Language { |
||||
get { return language; } |
||||
set { |
||||
var oldLanguage = language; |
||||
if (value != language) { |
||||
language = value; |
||||
OnLanguageChanged(new LanguageEventArgs(oldLanguage, language)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// List of loaded assemblies.
|
||||
/// </summary>
|
||||
public static IEnumerable<AssemblyDefinition> LoadedAssemblies { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the current code mappings.
|
||||
/// </summary>
|
||||
public static Dictionary<int, List<MemberMapping>> CodeMappings { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the local variables of the current decompiled type, method, etc.
|
||||
/// </summary>
|
||||
public static ConcurrentDictionary<int, IEnumerable<ILVariable>> LocalVariables { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// (internal) Gets or sets the old code mappings.
|
||||
/// </summary>
|
||||
public static Dictionary<int, List<MemberMapping>> OldCodeMappings { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// (internal) Gets or sets the MembeReference that was decompiled (a TypeDefinition, MethodDefinition, etc)
|
||||
/// </summary>
|
||||
public static Dictionary<int, MemberReference> DecompiledMemberReferences { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Gets or (internal) sets the current token, IL offset and member reference. Used for step in/out.
|
||||
/// </summary>
|
||||
public static Tuple<int, int, MemberReference> DebugStepInformation { get; set; } |
||||
|
||||
/// <summary>
|
||||
/// Occures when the language is changed.
|
||||
/// </summary>
|
||||
public static event EventHandler<LanguageEventArgs> LanguageChanged; |
||||
|
||||
private static void OnLanguageChanged(LanguageEventArgs e) |
||||
{ |
||||
if (LanguageChanged != null) { |
||||
LanguageChanged(null, e); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public class LanguageEventArgs : EventArgs |
||||
{ |
||||
public DecompiledLanguages OldLanguage { get; private set; } |
||||
|
||||
public DecompiledLanguages NewLanguage { get; private set; } |
||||
|
||||
public LanguageEventArgs(DecompiledLanguages oldLanguage, DecompiledLanguages newLanguage) |
||||
{ |
||||
this.OldLanguage = oldLanguage; |
||||
this.NewLanguage = newLanguage; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team
|
||||
// This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Ricciolo.StylesExplorer.MarkupReflection |
||||
{ |
||||
public class KeyMapping |
||||
{ |
||||
List<object> staticResources; |
||||
|
||||
public List<object> StaticResources { |
||||
get { return staticResources; } |
||||
} |
||||
|
||||
public bool HasStaticResources { |
||||
get { return staticResources != null && staticResources.Count > 0; } |
||||
} |
||||
|
||||
public string KeyString { get; set; } |
||||
public bool Shared { get; set; } |
||||
public bool SharedSet { get; set; } |
||||
|
||||
public int Position { get; set; } |
||||
|
||||
public KeyMapping() |
||||
{ |
||||
this.staticResources = new List<object>(); |
||||
this.Position = -1; |
||||
} |
||||
|
||||
public KeyMapping(string key) |
||||
{ |
||||
this.KeyString = key; |
||||
this.staticResources = new List<object>(); |
||||
this.Position = -1; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
<Window x:Class="ILSpy.BamlDecompiler.Tests.Cases.AttachedEvent" Title="ILSpy.BamlDecompiler.Tests.Cases" Height="300" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
<Grid AccessKeyManager.AccessKeyPressed="GridAccessKeyPressed" /> |
||||
</Window> |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
|
||||
namespace ILSpy.BamlDecompiler.Tests.Cases |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for AttachedEvent.xaml
|
||||
/// </summary>
|
||||
public partial class AttachedEvent : Window |
||||
{ |
||||
public AttachedEvent() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
|
||||
void GridAccessKeyPressed(object sender, AccessKeyPressedEventArgs e) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ad="clr-namespace:AvalonDock"> |
||||
<SolidColorBrush x:Key="ManagedContentTabControlNormalBorderBrush" Color="#919B9C" /> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DefaultBackgroundBrush}}" Color="#FFF4F2E8" /> |
||||
<LinearGradientBrush x:Key="ManagedContentTabItemNormalBackground" StartPoint="0,0" EndPoint="0,1"> |
||||
<LinearGradientBrush.GradientStops> |
||||
<GradientStop Color="#FFECEBE6" Offset="0" /> |
||||
<GradientStop Color="#FFFFFFFF" Offset="1" /> |
||||
</LinearGradientBrush.GradientStops> |
||||
</LinearGradientBrush> |
||||
<LinearGradientBrush x:Key="ManagedContentTabItemInvNormalBackground" StartPoint="0,0" EndPoint="0,1"> |
||||
<LinearGradientBrush.GradientStops> |
||||
<GradientStop Color="#FFFFFFFF" Offset="0" /> |
||||
<GradientStop Color="#FFECEBE6" Offset="1" /> |
||||
</LinearGradientBrush.GradientStops> |
||||
</LinearGradientBrush> |
||||
<LinearGradientBrush x:Key="ManagedContentTabItemHotBackground" StartPoint="0,0" EndPoint="0,1"> |
||||
<LinearGradientBrush.GradientStops> |
||||
<GradientStop Color="#FFFFFFFF" Offset="0" /> |
||||
<GradientStop Color="#FFECEBE6" Offset="1" /> |
||||
</LinearGradientBrush.GradientStops> |
||||
</LinearGradientBrush> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBackground" Color="#FFFCFCFE" /> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBackground" Color="#FFF5F4EA" /> |
||||
<LinearGradientBrush x:Key="ManagedContentTabItemSelectedBorderBackround" StartPoint="0,0" EndPoint="0,1"> |
||||
<GradientStop Color="#FFFFC73C" Offset="0" /> |
||||
<GradientStop Color="#FFE68B2C" Offset="1" /> |
||||
</LinearGradientBrush> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemSelectedBorderBrush" Color="#FFE68B2C" /> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBackround" Color="#FFFFC73C" /> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemHotBorderBrush" Color="#FFE68B2C" /> |
||||
<SolidColorBrush x:Key="ManagedContentTabItemDisabledBorderBrush" Color="#FFC9C7BA" /> |
||||
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackgroundSelected}}" StartPoint="0,0" EndPoint="0,1"> |
||||
<LinearGradientBrush.GradientStops> |
||||
<GradientStop Color="#FF3B80ED" Offset="0" /> |
||||
<GradientStop Color="#FF316AC5" Offset="1" /> |
||||
</LinearGradientBrush.GradientStops> |
||||
</LinearGradientBrush> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleBackground}}" Color="#FFCCC5BA" /> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForeground}}" Color="Black" /> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DockablePaneTitleForegroundSelected}}" Color="White" /> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}" Color="{x:Static SystemColors.ControlLightLightColor}" Opacity="0.5" /> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}" Color="{x:Static SystemColors.ControlDarkColor}" /> |
||||
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackground}}" StartPoint="0,0" EndPoint="0,1"> |
||||
<GradientStop Color="#FFFFFFFF" Offset="0" /> |
||||
<GradientStop Color="#FFE0E0E0" Offset="1" /> |
||||
</LinearGradientBrush> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderForeground}}" Color="{x:Static SystemColors.WindowTextColor}" /> |
||||
<LinearGradientBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackgroundSelected}}" StartPoint="0,0" EndPoint="0,1"> |
||||
<GradientStop Color="#FFFFFFFF" Offset="0" /> |
||||
<GradientStop Color="#FFC1D2EE" Offset="1" /> |
||||
</LinearGradientBrush> |
||||
<SolidColorBrush x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:AvalonDockBrushes.DocumentHeaderBackgroundMouseOver}}" Color="White" /> |
||||
</ResourceDictionary> |
||||
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ad="clr-namespace:AvalonDock"> |
||||
<ResourceDictionary.MergedDictionaries> |
||||
<ResourceDictionary Source="/AvalonDock;component/Resources/Brushes.xaml" /> |
||||
</ResourceDictionary.MergedDictionaries> |
||||
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.DockableFloatingWindow}}"> |
||||
<MenuItem Command="ad:ManagedContentCommands.Show" /> |
||||
<MenuItem Command="ad:ManagedContentCommands.Hide" /> |
||||
<MenuItem Command="ad:DockableContentCommands.ShowAsDocument" /> |
||||
<Separator /> |
||||
<MenuItem Command="ad:DockableFloatingWindowCommands.SetAsFloatingWindow" /> |
||||
<MenuItem Command="ad:DockableFloatingWindowCommands.SetAsDockableWindow" /> |
||||
</ContextMenu> |
||||
<ContextMenu x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type ad:DockingManager}, ResourceId={x:Static ad:ContextMenuElement.DocumentFloatingWindow}}"> |
||||
<MenuItem Command="ad:ManagedContentCommands.Close" /> |
||||
<Separator /> |
||||
<MenuItem Command="ad:DocumentContentCommands.FloatingDocument" /> |
||||
<MenuItem Command="ad:DocumentContentCommands.TabbedDocument" /> |
||||
</ContextMenu> |
||||
<Style x:Key="{x:Type ad:Resizer}" TargetType="{x:Type ad:Resizer}"> |
||||
<Setter Property="Background" Value="#00FFFFFF" /> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type ad:Resizer}"> |
||||
<Border Background="{TemplateBinding Control.Background}" /> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="PaneHeaderCommandStyle" TargetType="{x:Type Button}"> |
||||
<Setter Property="Template"> |
||||
<Setter.Value> |
||||
<ControlTemplate TargetType="{x:Type Button}"> |
||||
<Border Name="PaneHeaderCommandIntBorder" Background="#00FFFFFF" BorderThickness="1" Margin="0" Opacity="0.8"> |
||||
<ContentPresenter /> |
||||
</Border> |
||||
<ControlTemplate.Triggers> |
||||
<Trigger Property="IsMouseOver" Value="True"> |
||||
<Setter TargetName="PaneHeaderCommandIntBorder" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" Property="BorderBrush" /> |
||||
<Setter TargetName="PaneHeaderCommandIntBorder" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" Property="Background" /> |
||||
<Setter TargetName="PaneHeaderCommandIntBorder" Property="Opacity" Value="1" /> |
||||
</Trigger> |
||||
</ControlTemplate.Triggers> |
||||
</ControlTemplate> |
||||
</Setter.Value> |
||||
</Setter> |
||||
</Style> |
||||
<Style x:Key="PaneHeaderContextMenuCommandStyle" TargetType="{x:Type Border}"> |
||||
<Setter Property="Background" Value="#00FFFFFF" /> |
||||
<Setter Property="BorderThickness" Value="1" /> |
||||
<Style.Triggers> |
||||
<Trigger Property="IsMouseOver" Value="True"> |
||||
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBorderBrush}}}" /> |
||||
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey {x:Type ad:DockingManager}, {x:Static ad:AvalonDockBrushes.PaneHeaderCommandBackground}}}" /> |
||||
<Setter Property="Opacity" Value="1" /> |
||||
</Trigger> |
||||
</Style.Triggers> |
||||
</Style> |
||||
</ResourceDictionary> |
||||
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<UserControl x:Class="ILSpy.BamlDecompiler.Tests.Cases.MyControl" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
<Grid> |
||||
|
||||
</Grid> |
||||
</UserControl> |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
|
||||
namespace ILSpy.BamlDecompiler.Tests.Cases |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for MyControl.xaml
|
||||
/// </summary>
|
||||
public partial class MyControl : UserControl |
||||
{ |
||||
public MyControl() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
<Window x:Class="ILSpy.BamlDecompiler.Tests.Cases.Resources" Title="ILSpy.BamlDecompiler.Tests.Cases" Height="300" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
<Grid> |
||||
<Canvas> |
||||
<Canvas.Resources> |
||||
<ResourceDictionary> |
||||
<BooleanToVisibilityConverter x:Key="b" /> |
||||
</ResourceDictionary> |
||||
</Canvas.Resources> |
||||
</Canvas> |
||||
<Canvas> |
||||
<Canvas.Resources> |
||||
<BooleanToVisibilityConverter x:Key="b" /> |
||||
</Canvas.Resources> |
||||
</Canvas> |
||||
</Grid> |
||||
</Window> |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
|
||||
namespace ILSpy.BamlDecompiler.Tests.Cases |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for Resources.xaml
|
||||
/// </summary>
|
||||
public partial class Resources : Window |
||||
{ |
||||
public Resources() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,6 @@
@@ -0,0 +1,6 @@
|
||||
<Window x:Class="ILSpy.BamlDecompiler.Tests.Cases.SimpleNames" Title="ILSpy.BamlDecompiler.Tests.Cases" Height="300" Width="300" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="clr-namespace:ILSpy.BamlDecompiler.Tests.Cases"> |
||||
<Grid> |
||||
<Button Name="test" /> |
||||
<mc:MyControl x:Name="test2" /> |
||||
</Grid> |
||||
</Window> |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
|
||||
namespace ILSpy.BamlDecompiler.Tests.Cases |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for SimpleNames.xaml
|
||||
/// </summary>
|
||||
public partial class SimpleNames : Window |
||||
{ |
||||
public SimpleNames() |
||||
{ |
||||
InitializeComponent(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows; |
||||
using System.Windows.Controls.Primitives; |
||||
|
||||
namespace AvalonDock |
||||
{ |
||||
public class DockingManager |
||||
{ |
||||
public DockingManager() |
||||
{ |
||||
} |
||||
} |
||||
|
||||
public class Resizer : Thumb |
||||
{ |
||||
static Resizer() |
||||
{ |
||||
//This OverrideMetadata call tells the system that this element wants to provide a style that is different than its base class.
|
||||
//This style is defined in themes\generic.xaml
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(typeof(Resizer))); |
||||
MinWidthProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); |
||||
MinHeightProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(6.0, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); |
||||
HorizontalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(HorizontalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); |
||||
VerticalAlignmentProperty.OverrideMetadata(typeof(Resizer), new FrameworkPropertyMetadata(VerticalAlignment.Stretch, FrameworkPropertyMetadataOptions.AffectsParentMeasure)); |
||||
} |
||||
|
||||
} |
||||
|
||||
public enum AvalonDockBrushes |
||||
{ |
||||
DefaultBackgroundBrush, |
||||
DockablePaneTitleBackground, |
||||
DockablePaneTitleBackgroundSelected, |
||||
DockablePaneTitleForeground, |
||||
DockablePaneTitleForegroundSelected, |
||||
PaneHeaderCommandBackground, |
||||
PaneHeaderCommandBorderBrush, |
||||
DocumentHeaderBackground, |
||||
DocumentHeaderForeground, |
||||
DocumentHeaderForegroundSelected, |
||||
DocumentHeaderForegroundSelectedActivated, |
||||
DocumentHeaderBackgroundSelected, |
||||
DocumentHeaderBackgroundSelectedActivated, |
||||
DocumentHeaderBackgroundMouseOver, |
||||
DocumentHeaderBorderBrushMouseOver, |
||||
DocumentHeaderBorder, |
||||
DocumentHeaderBorderSelected, |
||||
DocumentHeaderBorderSelectedActivated, |
||||
NavigatorWindowTopBackground, |
||||
NavigatorWindowTitleForeground, |
||||
NavigatorWindowDocumentTypeForeground, |
||||
NavigatorWindowInfoTipForeground, |
||||
NavigatorWindowForeground, |
||||
NavigatorWindowBackground, |
||||
NavigatorWindowSelectionBackground, |
||||
NavigatorWindowSelectionBorderbrush, |
||||
NavigatorWindowBottomBackground |
||||
} |
||||
|
||||
public enum ContextMenuElement |
||||
{ |
||||
DockablePane, |
||||
DocumentPane, |
||||
DockableFloatingWindow, |
||||
DocumentFloatingWindow |
||||
} |
||||
} |
||||
@ -1,20 +1,5 @@
@@ -1,20 +1,5 @@
|
||||
// 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.
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows; |
||||
@ -1,20 +1,5 @@
@@ -1,20 +1,5 @@
|
||||
// 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.
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Collections.Concurrent; |
||||
@ -0,0 +1,97 @@
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{704F66F1-5C7F-4326-A7AA-C604A3896D4E}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.ILSpy.SharpDevelop</RootNamespace> |
||||
<AssemblyName>ILSpy.SharpDevelop.LGPL</AssemblyName> |
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> |
||||
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Platform)' == 'x86' "> |
||||
<PlatformTarget>x86</PlatformTarget> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<DebugSymbols>True</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<Optimize>False</Optimize> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>bin\Release\</OutputPath> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<Optimize>True</Optimize> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="PresentationCore"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="PresentationFramework"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Core"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xaml"> |
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System.Xml" /> |
||||
<Reference Include="System.Xml.Linq"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="WindowsBase"> |
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework> |
||||
</Reference> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="AvalonEdit\IconBarManager.cs" /> |
||||
<Compile Include="AvalonEdit\IconBarMargin.cs" /> |
||||
<Compile Include="AvalonEdit\ITextEditorListener.cs" /> |
||||
<Compile Include="AvalonEdit\ITextMarker.cs" /> |
||||
<Compile Include="AvalonEdit\IToolTip.cs" /> |
||||
<Compile Include="AvalonEdit\TextEditorWeakEventManager.cs" /> |
||||
<Compile Include="AvalonEdit\TextMarkerService.cs" /> |
||||
<Compile Include="Bookmarks\BookmarkBase.cs" /> |
||||
<Compile Include="Bookmarks\BookmarkEventHandler.cs" /> |
||||
<Compile Include="Bookmarks\BookmarkManager.cs" /> |
||||
<Compile Include="Bookmarks\BreakpointBookmark.cs" /> |
||||
<Compile Include="Bookmarks\BreakpointBookmarkEventArgs.cs" /> |
||||
<Compile Include="Bookmarks\CurrentLineBookmark.cs" /> |
||||
<Compile Include="Bookmarks\IBookmark.cs" /> |
||||
<Compile Include="Bookmarks\MarkerBookmark.cs" /> |
||||
<Compile Include="DebugInformation.cs" /> |
||||
<Compile Include="Images.cs" /> |
||||
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Folder Include="AvalonEdit" /> |
||||
<Folder Include="Bookmarks" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\AvalonEdit\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj"> |
||||
<Project>{6C55B776-26D4-4DB3-A6AB-87E783B2F3D1}</Project> |
||||
<Name>ICSharpCode.AvalonEdit</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj"> |
||||
<Project>{984CC812-9470-4A13-AFF9-CC44068D666C}</Project> |
||||
<Name>ICSharpCode.Decompiler</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\Mono.Cecil\Mono.Cecil.csproj"> |
||||
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project> |
||||
<Name>Mono.Cecil</Name> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\NRefactory\ICSharpCode.NRefactory\ICSharpCode.NRefactory.csproj"> |
||||
<Project>{3B2A5653-EC97-4001-BB9B-D90F1AF2C371}</Project> |
||||
<Name>ICSharpCode.NRefactory</Name> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows.Media; |
||||
using System.Windows.Media.Imaging; |
||||
|
||||
namespace ICSharpCode.ILSpy.SharpDevelop |
||||
{ |
||||
static class Images |
||||
{ |
||||
static BitmapImage LoadBitmap(string name) |
||||
{ |
||||
try { |
||||
BitmapImage image = new BitmapImage(new Uri("pack://application:,,,/ILSpy;component/Images/" + name + ".png")); |
||||
if (image == null) |
||||
return null; |
||||
image.Freeze(); |
||||
return image; |
||||
} |
||||
catch { |
||||
// resource not found
|
||||
return null; |
||||
} |
||||
} |
||||
|
||||
public static readonly BitmapImage Breakpoint = LoadBitmap("Breakpoint"); |
||||
public static readonly BitmapImage CurrentLine = LoadBitmap("CurrentLine"); |
||||
|
||||
public static ImageSource GetImage(string imageName) |
||||
{ |
||||
return LoadBitmap(imageName); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
#region Using directives
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
#endregion
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("ILSpy.SharpDevelop.LGPL")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("ILSpy.SharpDevelop.LGPL")] |
||||
[assembly: AssemblyCopyright("Copyright 2011")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")] |
||||
@ -1,31 +0,0 @@
@@ -1,31 +0,0 @@
|
||||
// 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; |
||||
|
||||
namespace ICSharpCode.ILSpy |
||||
{ |
||||
[ExportMainMenuCommand(Menu = "_View", Header = "_Analyzer", MenuCategory = "ShowPane", MenuOrder = 100)] |
||||
sealed class ShowAnalyzerCommand : SimpleCommand |
||||
{ |
||||
public override void Execute(object parameter) |
||||
{ |
||||
AnalyzerTreeView.Instance.Show(); |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue