@ -0,0 +1,49 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.TreeView; |
||||||
|
using Mono.Cecil; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Represents an event in the TreeView.
|
||||||
|
/// </summary>
|
||||||
|
sealed class EventTreeNode : SharpTreeNode |
||||||
|
{ |
||||||
|
readonly EventDefinition ev; |
||||||
|
|
||||||
|
public EventTreeNode(EventDefinition ev) |
||||||
|
{ |
||||||
|
if (ev == null) |
||||||
|
throw new ArgumentNullException("ev"); |
||||||
|
this.ev = ev; |
||||||
|
this.LazyLoading = true; |
||||||
|
} |
||||||
|
|
||||||
|
public override object Text { |
||||||
|
get { return ev.Name + " : " + Language.Current.TypeToString(ev.EventType); } |
||||||
|
} |
||||||
|
|
||||||
|
public override object Icon { |
||||||
|
get { |
||||||
|
return Images.Event; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected override void LoadChildren() |
||||||
|
{ |
||||||
|
if (ev.AddMethod != null) |
||||||
|
this.Children.Add(new MethodTreeNode(ev.AddMethod)); |
||||||
|
if (ev.RemoveMethod != null) |
||||||
|
this.Children.Add(new MethodTreeNode(ev.RemoveMethod)); |
||||||
|
if (ev.InvokeMethod != null) |
||||||
|
this.Children.Add(new MethodTreeNode(ev.InvokeMethod)); |
||||||
|
if (ev.HasOtherMethods) { |
||||||
|
foreach (var m in ev.OtherMethods) |
||||||
|
this.Children.Add(new MethodTreeNode(m)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
After Width: | Height: | Size: 640 B |
|
After Width: | Height: | Size: 488 B |
|
After Width: | Height: | Size: 449 B |
|
Before Width: | Height: | Size: 789 B |
|
Before Width: | Height: | Size: 776 B |
|
After Width: | Height: | Size: 235 B |
|
Before Width: | Height: | Size: 831 B |
|
Before Width: | Height: | Size: 820 B |
|
After Width: | Height: | Size: 900 B |
|
Before Width: | Height: | Size: 772 B |
|
Before Width: | Height: | Size: 765 B |
|
Before Width: | Height: | Size: 466 B |
@ -1,55 +0,0 @@ |
|||||||
// <file>
|
|
||||||
// <copyright see="prj:///doc/copyright.txt"/>
|
|
||||||
// <license see="prj:///doc/license.txt"/>
|
|
||||||
// <author name="Daniel Grunwald"/>
|
|
||||||
// <version>$Revision$</version>
|
|
||||||
// </file>
|
|
||||||
|
|
||||||
using System; |
|
||||||
using System.Windows.Media.Imaging; |
|
||||||
|
|
||||||
namespace ICSharpCode.ILSpy |
|
||||||
{ |
|
||||||
static class TypeImages |
|
||||||
{ |
|
||||||
static BitmapImage LoadBitmap(string name) |
|
||||||
{ |
|
||||||
BitmapImage image = new BitmapImage(new Uri("pack://application:,,,/Images/" + name + ".png")); |
|
||||||
image.Freeze(); |
|
||||||
return image; |
|
||||||
} |
|
||||||
|
|
||||||
public static readonly BitmapImage Class = LoadBitmap("Class"); |
|
||||||
public static readonly BitmapImage Delegate = LoadBitmap("Delegate"); |
|
||||||
public static readonly BitmapImage Enum = LoadBitmap("Enum"); |
|
||||||
public static readonly BitmapImage Interface = LoadBitmap("Interface"); |
|
||||||
public static readonly BitmapImage Struct = LoadBitmap("Struct"); |
|
||||||
public static readonly BitmapImage Field = LoadBitmap("Field"); |
|
||||||
public static readonly BitmapImage Method = LoadBitmap("Method"); |
|
||||||
public static readonly BitmapImage Literal = LoadBitmap("Literal"); |
|
||||||
|
|
||||||
public static readonly BitmapImage InternalClass = LoadBitmap("InternalClass"); |
|
||||||
public static readonly BitmapImage InternalDelegate = LoadBitmap("InternalDelegate"); |
|
||||||
public static readonly BitmapImage InternalEnum = LoadBitmap("InternalEnum"); |
|
||||||
public static readonly BitmapImage InternalInterface = LoadBitmap("InternalInterface"); |
|
||||||
public static readonly BitmapImage InternalStruct = LoadBitmap("InternalStruct"); |
|
||||||
public static readonly BitmapImage InternalField = LoadBitmap("InternalField"); |
|
||||||
public static readonly BitmapImage InternalMethod = LoadBitmap("InternalMethod"); |
|
||||||
|
|
||||||
public static readonly BitmapImage PrivateClass = LoadBitmap("PrivateClass"); |
|
||||||
public static readonly BitmapImage PrivateDelegate = LoadBitmap("PrivateDelegate"); |
|
||||||
public static readonly BitmapImage PrivateEnum = LoadBitmap("PrivateEnum"); |
|
||||||
public static readonly BitmapImage PrivateInterface = LoadBitmap("PrivateInterface"); |
|
||||||
public static readonly BitmapImage PrivateStruct = LoadBitmap("PrivateStruct"); |
|
||||||
public static readonly BitmapImage PrivateField = LoadBitmap("PrivateField"); |
|
||||||
public static readonly BitmapImage PrivateMethod = LoadBitmap("PrivateMethod"); |
|
||||||
|
|
||||||
public static readonly BitmapImage ProtectedClass = LoadBitmap("ProtectedClass"); |
|
||||||
public static readonly BitmapImage ProtectedDelegate = LoadBitmap("ProtectedDelegate"); |
|
||||||
public static readonly BitmapImage ProtectedEnum = LoadBitmap("ProtectedEnum"); |
|
||||||
public static readonly BitmapImage ProtectedInterface = LoadBitmap("ProtectedInterface"); |
|
||||||
public static readonly BitmapImage ProtectedStruct = LoadBitmap("ProtectedStruct"); |
|
||||||
public static readonly BitmapImage ProtectedField = LoadBitmap("ProtectedField"); |
|
||||||
public static readonly BitmapImage ProtectedMethod = LoadBitmap("ProtectedMethod"); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -0,0 +1,30 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||||
|
|
||||||
|
using System; |
||||||
|
using Mono.Cecil; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of ILanguage.
|
||||||
|
/// </summary>
|
||||||
|
public abstract class Language |
||||||
|
{ |
||||||
|
public static readonly Language Current = Languages.IL; |
||||||
|
|
||||||
|
public virtual string TypeToString(TypeReference t) |
||||||
|
{ |
||||||
|
return t.Name; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static class Languages |
||||||
|
{ |
||||||
|
public static readonly Language IL = new ILLanguage(); |
||||||
|
|
||||||
|
class ILLanguage : Language |
||||||
|
{ |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,49 @@ |
|||||||
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||||
|
// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
|
||||||
|
|
||||||
|
using System; |
||||||
|
using ICSharpCode.TreeView; |
||||||
|
using Mono.Cecil; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Represents a property in the TreeView.
|
||||||
|
/// </summary>
|
||||||
|
sealed class PropertyTreeNode : SharpTreeNode |
||||||
|
{ |
||||||
|
readonly PropertyDefinition property; |
||||||
|
readonly bool isIndexer; |
||||||
|
|
||||||
|
public PropertyTreeNode(PropertyDefinition property, bool isIndexer) |
||||||
|
{ |
||||||
|
if (property == null) |
||||||
|
throw new ArgumentNullException("property"); |
||||||
|
this.property = property; |
||||||
|
this.isIndexer = isIndexer; |
||||||
|
this.LazyLoading = true; |
||||||
|
} |
||||||
|
|
||||||
|
public override object Text { |
||||||
|
get { return property.Name + " : " + Language.Current.TypeToString(property.PropertyType); } |
||||||
|
} |
||||||
|
|
||||||
|
public override object Icon { |
||||||
|
get { |
||||||
|
return isIndexer ? Images.Indexer : Images.Property; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
protected override void LoadChildren() |
||||||
|
{ |
||||||
|
if (property.GetMethod != null) |
||||||
|
this.Children.Add(new MethodTreeNode(property.GetMethod)); |
||||||
|
if (property.SetMethod != null) |
||||||
|
this.Children.Add(new MethodTreeNode(property.SetMethod)); |
||||||
|
if (property.HasOtherMethods) { |
||||||
|
foreach (var m in property.OtherMethods) |
||||||
|
this.Children.Add(new MethodTreeNode(m)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||