: CodeGenerator
{
#if NET_2_0
- Dictionary <string, string> providerOptions;
+ IDictionary <string, string> providerOptions;
#endif
// It is used for beautiful "for" syntax
}
#if NET_2_0
- public CSharpCodeGenerator (Dictionary <string, string> providerOptions)
+ public CSharpCodeGenerator (IDictionary <string, string> providerOptions)
{
this.providerOptions = providerOptions;
}
- protected Dictionary <string, string> ProviderOptions {
+ protected IDictionary <string, string> ProviderOptions {
get { return providerOptions; }
}
#endif
{
Output.WriteLine ();
Output.WriteLine ("#line default");
+#if NET_2_0
+ Output.WriteLine ("#line hidden");
+#endif
}
protected override void GenerateEvent (CodeMemberEvent eventRef, CodeTypeDeclaration declaration)
GenerateGenericsConstraints (method.TypeParameters);
#endif
- if ((attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract || declaration.IsInterface)
+ if (IsAbstract (attributes) || declaration.IsInterface)
output.WriteLine (';');
else {
OutputStartBrace ();
static bool IsAbstract (MemberAttributes attributes)
{
- return (attributes & MemberAttributes.Abstract) == MemberAttributes.Abstract;
+ return (attributes & MemberAttributes.ScopeMask) == MemberAttributes.Abstract;
}
protected override void GenerateProperty (CodeMemberProperty property,
private void OutputAttributes (CodeAttributeDeclarationCollection attributes, string prefix, bool inline)
{
+#if NET_2_0
+ bool params_set = false;
+#endif
+
foreach (CodeAttributeDeclaration att in attributes) {
+#if NET_2_0
+ if (att.Name == "System.ParamArrayAttribute") {
+ params_set = true;
+ continue;
+ }
+#endif
+
GenerateAttributeDeclarationsStart (attributes);
if (prefix != null) {
Output.Write (prefix);
Output.WriteLine ();
}
}
+
+#if NET_2_0
+ if (params_set) {
+ if (prefix != null)
+ Output.Write (prefix);
+ Output.Write ("params");
+ if (inline)
+ Output.Write (" ");
+ else
+ Output.WriteLine ();
+ }
+#endif
}
private void OutputAttributeDeclaration (CodeAttributeDeclaration attribute)
// skip ` character
i++;
// determine number of type arguments to output
- int typeArgCount = baseType[i] - '0';
+ int end = i;
+ while (end < baseType.Length && Char.IsDigit (baseType [end]))
+ end++;
+ int typeArgCount = Int32.Parse (baseType.Substring (i, end - i));
// output type arguments
OutputTypeArguments (type.TypeArguments, sb, typeArgCount);
// skip type argument indicator
- i++;
+ i = end;
// if next character is . or +, then append .
if ((i < baseType.Length) && ((baseType[i] == '+') || (baseType[i] == '.'))) {
sb.Append ('.');