[Monodevelop-patches-list] r2672 - trunk/MonoDevelop/Extras/BooBinding
Peter Johanson <latexer@gentoo.org>
pjohanson at mono-cvs.ximian.com
Tue Jul 19 22:56:39 EDT 2005
Author: pjohanson
Date: 2005-07-19 22:56:39 -0400 (Tue, 19 Jul 2005)
New Revision: 2672
Modified:
trunk/MonoDevelop/Extras/BooBinding/BooAmbience.boo
trunk/MonoDevelop/Extras/BooBinding/ChangeLog
Log:
Some code cleanup to consolidate things, and actually markup the text if IncludePangoMarkup is set.
Modified: trunk/MonoDevelop/Extras/BooBinding/BooAmbience.boo
===================================================================
--- trunk/MonoDevelop/Extras/BooBinding/BooAmbience.boo 2005-07-19 02:00:39 UTC (rev 2671)
+++ trunk/MonoDevelop/Extras/BooBinding/BooAmbience.boo 2005-07-20 02:56:39 UTC (rev 2672)
@@ -85,7 +85,7 @@
private def GetModifier(decoration as IDecoration) as string:
ret as string = ''
- if IncludeHTMLMarkup:
+ if IncludeHTMLMarkup or IncludePangoMarkup:
ret += '<i>'
if decoration.IsStatic:
@@ -99,7 +99,7 @@
elif decoration.IsNew:
ret += 'new '
- if IncludeHTMLMarkup:
+ if IncludeHTMLMarkup or IncludePangoMarkup:
ret += '</i>'
return ret
@@ -107,9 +107,7 @@
override def Convert(c as IClass) as string:
builder as StringBuilder = StringBuilder()
builder.Append(Convert(c.Modifiers))
- if IncludeHTMLMarkup:
- builder.Append('<i>')
-
+
cType = c.ClassType
if ShowModifiers:
@@ -117,13 +115,12 @@
if cType == ClassType.Delegate or cType == ClassType.Enum:
pass
else:
- builder.Append('final ')
+ //builder.Append('final ')
+ AppendPangoHtmlTag (builder, 'final ', 'i')
elif c.IsAbstract and cType != ClassType.Interface:
- builder.Append('abstract ')
+ //builder.Append('abstract ')
+ AppendPangoHtmlTag (builder, 'abstract ', 'i')
- if IncludeHTMLMarkup:
- builder.Append('</i>')
-
if ShowModifiers:
if cType == ClassType.Delegate:
builder.Append('callable ')
@@ -142,17 +139,11 @@
builder.Append(Convert(m.ReturnType))
builder.Append(' ')
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if UseFullyQualifiedMemberNames:
- builder.Append(c.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, c.FullyQualifiedName, 'b')
else:
- builder.Append(c.Name)
+ AppendPangoHtmlTag (builder, c.Name, 'b')
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
if c.ClassType == ClassType.Delegate:
builder.Append(' (')
if IncludeHTMLMarkup:
@@ -192,37 +183,24 @@
override def Convert(field as IField) as string:
builder as StringBuilder = StringBuilder()
builder.Append(Convert(field.Modifiers))
- if IncludeHTMLMarkup:
- builder.Append('<i>')
if ShowModifiers:
if field.IsStatic and field.IsLiteral:
- builder.Append('const ')
+ AppendPangoHtmlTag (builder, 'const ', 'i')
elif field.IsStatic:
- builder.Append('static ')
+ AppendPangoHtmlTag (builder, 'static ', 'i')
if field.IsReadonly:
- builder.Append('readonly ')
-
+ AppendPangoHtmlTag (builder, 'readonly ', 'i')
- if IncludeHTMLMarkup:
- builder.Append('</i>')
-
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if UseFullyQualifiedMemberNames:
- builder.Append(field.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, field.FullyQualifiedName, 'b')
else:
- builder.Append(field.Name)
+ AppendPangoHtmlTag (builder, field.Name, 'b')
if field.ReturnType != null:
- builder.Append(' as ')
- builder.Append(Convert(field.ReturnType))
+ AppendPangoHtmlTag (builder, ' as ' + Convert (field.ReturnType), 'b')
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
return builder.ToString()
override def Convert(property as IProperty) as string:
@@ -231,17 +209,11 @@
if ShowModifiers:
builder.Append(GetModifier(property))
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if UseFullyQualifiedMemberNames:
- builder.Append(property.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, property.FullyQualifiedName, 'b')
else:
- builder.Append(property.Name)
+ AppendPangoHtmlTag (builder, property.Name, 'b')
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
if property.Parameters.Count > 0:
builder.Append('(')
if IncludeHTMLMarkup:
@@ -280,17 +252,11 @@
if ShowModifiers:
builder.Append(GetModifier(e))
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if UseFullyQualifiedMemberNames:
- builder.Append(e.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, e.FullyQualifiedName, 'b')
else:
- builder.Append(e.Name)
+ AppendPangoHtmlTag (builder, e.Name, 'b')
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
if e.ReturnType != null:
builder.Append(' as ')
builder.Append(Convert(e.ReturnType))
@@ -300,30 +266,19 @@
override def Convert(m as IIndexer) as string:
builder as StringBuilder = StringBuilder()
builder.Append(Convert(m.Modifiers))
- if IncludeHTMLMarkup:
- builder.Append('<i>')
if ShowModifiers and m.IsStatic:
- builder.Append('static ')
+ AppendPangoHtmlTag (builder, 'static ', 'i')
- if IncludeHTMLMarkup:
- builder.Append('</i>')
-
if m.ReturnType != null:
builder.Append(Convert(m.ReturnType))
builder.Append(' ')
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if UseFullyQualifiedMemberNames:
- builder.Append(m.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, m.FullyQualifiedName, 'b')
else:
- builder.Append(m.Name)
-
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
+ AppendPangoHtmlTag (builder, m.Name, 'b')
+
builder.Append('Indexer(')
if IncludeHTMLMarkup:
builder.Append('<br>')
@@ -351,20 +306,14 @@
//builder.Append('def ') if ShowReturnType
- if IncludeHTMLMarkup:
- builder.Append('<b>')
-
if m.IsConstructor:
- builder.Append('constructor')
+ AppendPangoHtmlTag (builder, 'constructor', 'b')
else:
if UseFullyQualifiedMemberNames:
- builder.Append(m.FullyQualifiedName)
+ AppendPangoHtmlTag (builder, m.FullyQualifiedName, 'b')
else:
- builder.Append(m.Name)
+ AppendPangoHtmlTag (builder, m.Name, 'b')
- if IncludeHTMLMarkup:
- builder.Append('</b>')
-
builder.Append('(')
if IncludeHTMLMarkup:
builder.Append('<br>')
@@ -446,19 +395,14 @@
override def Convert(param as IParameter) as string:
builder as StringBuilder = StringBuilder()
- if IncludeHTMLMarkup:
- builder.Append('<i>')
if param.IsRef:
- builder.Append('ref ')
+ AppendPangoHtmlTag (builder, 'ref ', 'i')
elif param.IsOut:
- builder.Append('out ')
+ AppendPangoHtmlTag (builder, 'out ', 'i')
elif param.IsParams:
- builder.Append('params ')
+ AppendPangoHtmlTag (builder, 'params ', 'i')
- if IncludeHTMLMarkup:
- builder.Append('</i>')
-
if ShowParameterNames:
builder.Append(param.Name)
builder.Append(' as ')
@@ -466,6 +410,11 @@
return builder.ToString()
+ private def AppendPangoHtmlTag (sb as StringBuilder, text as string, tag as string):
+ sb.Append ('<').Append (tag).Append ('>') if IncludeHTMLMarkup or IncludePangoMarkup
+ sb.Append (text)
+ sb.Append ('</').Append (tag).Append ('>') if IncludeHTMLMarkup or IncludePangoMarkup
+
override def WrapAttribute(attribute as string) as string:
return '[' + attribute + ']'
Modified: trunk/MonoDevelop/Extras/BooBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/Extras/BooBinding/ChangeLog 2005-07-19 02:00:39 UTC (rev 2671)
+++ trunk/MonoDevelop/Extras/BooBinding/ChangeLog 2005-07-20 02:56:39 UTC (rev 2672)
@@ -1,3 +1,8 @@
+2005-07-19 Peter Johanson <latexer at gentoo.org>
+
+ * BooAmbience: Changes to consolidate code, and actually markup the
+ items if IncludePangoMarkup is set.
+
2005-07-18 Peter Johanson <latexer at gentoo.org>
* BooBinding.addin.xml: Put the boo shell on the bottom by default.
More information about the Monodevelop-patches-list
mailing list