Author: toshok
Date: 2008-01-02 12:16:45 -0500 (Wed, 02 Jan 2008)
New Revision: 92118
Modified:
trunk/mono-tools/gui-compare/CecilMetadata.cs
trunk/mono-tools/gui-compare/ChangeLog
trunk/mono-tools/gui-compare/MainWindow.cs
trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs
Log:
* MainWindow.cs: hide the summary when we start refreshing
* CecilMetadata.cs: add generic parameters to the method name, and
remove all those Replace('/','+')'s from everywhere and stick them
in CecilUtils.FormatTypeLikeCorCompare.
* gtk-gui/MainWindow.cs: add a separator to the file menu
Modified: trunk/mono-tools/gui-compare/CecilMetadata.cs
===================================================================
--- trunk/mono-tools/gui-compare/CecilMetadata.cs 2008-01-02 16:55:59 UTC
(rev 92117)
+++ trunk/mono-tools/gui-compare/CecilMetadata.cs 2008-01-02 17:16:45 UTC
(rev 92118)
@@ -10,6 +10,14 @@
namespace GuiCompare {
static class CecilUtils {
+ public static string FormatTypeLikeCorCompare (string type)
+ {
+ string rv = type.Replace ('/', '+');
+ rv = rv.Replace ('<', '[');
+ rv = rv.Replace ('>', ']');
+ return rv;
+ }
+
public static void PopulateMemberLists (TypeDefinition fromDef,
List<CompNamed>
interface_list,
List<CompNamed>
constructor_list,
@@ -293,7 +301,7 @@
public class CecilInterface : CompInterface {
public CecilInterface (TypeDefinition type_def)
- : base (type_def.Name)
+ : base (CecilUtils.FormatTypeLikeCorCompare
(type_def.Name))
{
interfaces = new List<CompNamed>();
constructors = new List<CompNamed>();
@@ -314,7 +322,7 @@
}
public CecilInterface (TypeReference type_ref)
- : base (type_ref.FullName)
+ : base (CecilUtils.FormatTypeLikeCorCompare
(type_ref.FullName))
{
interfaces = new List<CompNamed>();
constructors = new List<CompNamed>();
@@ -537,7 +545,7 @@
public override string GetMemberType ()
{
- return field_def.FieldType.FullName.Replace ('/','+');
+ return CecilUtils.FormatTypeLikeCorCompare
(field_def.FieldType.FullName);
}
const FieldAttributes masterInfoFieldMask =
(FieldAttributes.FieldAccessMask |
@@ -573,7 +581,7 @@
if (method_def.IsConstructor)
return null;
- return
method_def.ReturnType.ReturnType.FullName.Replace ('/','+');
+ return CecilUtils.FormatTypeLikeCorCompare
(method_def.ReturnType.ReturnType.FullName);
}
const MethodAttributes masterInfoMethodMask =
(MethodAttributes.MemberAccessMask |
@@ -597,20 +605,31 @@
{
StringBuilder sb = new StringBuilder ();
if (!method_def.IsConstructor)
- sb.Append
(method_def.ReturnType.ReturnType.FullName.Replace('/','+'));
+ sb.Append (CecilUtils.FormatTypeLikeCorCompare
(method_def.ReturnType.ReturnType.FullName));
sb.Append (" ");
sb.Append (method_def.Name);
+ if (method_def.GenericParameters.Count > 0) {
+ sb.Append ("<");
+ bool first_gp = true;
+ foreach (GenericParameter gp in
method_def.GenericParameters) {
+ if (!first_gp)
+ sb.Append (',');
+ first_gp = false;
+ sb.Append (gp.Name);
+ }
+ sb.Append (">");
+ }
sb.Append ('(');
- bool comma = false;
+ bool first_p = true;
foreach (ParameterDefinition p in
method_def.Parameters) {
- if (comma)
+ if (!first_p)
sb.Append (", ");
+ first_p = false;
if (p.IsIn)
sb.Append ("in ");
else if (p.IsOut)
sb.Append ("out ");
- sb.Append
(p.ParameterType.FullName.Replace('/','+'));
- comma = true;
+ sb.Append (CecilUtils.FormatTypeLikeCorCompare
(p.ParameterType.FullName));
}
sb.Append (')');
Modified: trunk/mono-tools/gui-compare/ChangeLog
===================================================================
--- trunk/mono-tools/gui-compare/ChangeLog 2008-01-02 16:55:59 UTC (rev
92117)
+++ trunk/mono-tools/gui-compare/ChangeLog 2008-01-02 17:16:45 UTC (rev
92118)
@@ -1,3 +1,11 @@
+2008-01-02 Chris Toshok <[EMAIL PROTECTED]>
+
+ * MainWindow.cs: hide the summary when we start refreshing
+ * CecilMetadata.cs: add generic parameters to the method name, and
remove
+ all those Replace('/','+')'s from everywhere and stick them in
+ CecilUtils.FormatTypeLikeCorCompare.
+ * gtk-gui/MainWindow.cs: add a separator to the file menu
+
2008-01-01 Chris Toshok <[EMAIL PROTECTED]>
* MainWindow.cs: Remove the checks of the Show* actions in our populate
Modified: trunk/mono-tools/gui-compare/MainWindow.cs
===================================================================
--- trunk/mono-tools/gui-compare/MainWindow.cs 2008-01-02 16:55:59 UTC (rev
92117)
+++ trunk/mono-tools/gui-compare/MainWindow.cs 2008-01-02 17:16:45 UTC (rev
92118)
@@ -406,7 +406,6 @@
treeFilter.Refilter();
}
-
protected virtual void OnShowTodoToggled (object sender,
System.EventArgs e)
{
treeFilter.Refilter();
@@ -414,6 +413,7 @@
protected virtual void OnRefreshActivated (object sender,
System.EventArgs e)
{
+ summary.Visible = false;
StartCompare (delegate {});
}
}
\ No newline at end of file
Modified: trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs
===================================================================
--- trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs 2008-01-02 16:55:59 UTC
(rev 92117)
+++ trunk/mono-tools/gui-compare/gtk-gui/MainWindow.cs 2008-01-02 17:16:45 UTC
(rev 92118)
@@ -119,7 +119,7 @@
this.vbox1.Name = "vbox1";
this.vbox1.Spacing = 6;
// Container child vbox1.Gtk.Box+BoxChild
- w1.AddUiFromString("<ui><menubar name='menubar1'><menu
action='File'><menuitem action='Refresh'/><menuitem action='quit'/></menu><menu
action='Compare'><menuitem action='Custom'/><separator/></menu><menu
action='View'><menuitem action='ShowErrors'/><menuitem
action='ShowMissing'/><menuitem action='ShowExtra'/><menuitem
action='ShowTodo'/><menuitem action='ShowPresent'/></menu></menubar></ui>");
+ w1.AddUiFromString("<ui><menubar name='menubar1'><menu
action='File'><menuitem action='Refresh'/><separator/><menuitem
action='quit'/></menu><menu action='Compare'><menuitem
action='Custom'/><separator/></menu><menu action='View'><menuitem
action='ShowErrors'/><menuitem action='ShowMissing'/><menuitem
action='ShowExtra'/><menuitem action='ShowTodo'/><menuitem
action='ShowPresent'/></menu></menubar></ui>");
this.menubar1 = ((Gtk.MenuBar)(w1.GetWidget("/menubar1")));
this.menubar1.Name = "menubar1";
this.vbox1.Add(this.menubar1);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches