1
0
mirror of https://github.com/twiglet/cs2j.git synced 2025-01-18 13:15:17 +01:00

Mark static methods

This commit is contained in:
Kevin Glynn 2010-10-19 14:48:32 +02:00
parent f26a2f3172
commit 4933c8f3c5
2 changed files with 12 additions and 2 deletions

View File

@ -302,8 +302,14 @@ namespace RusticiSoftware.Translator.CLR
// Return type
public string Return { get; set; }
// isStatic method?
[XmlAttribute("static")]
[System.ComponentModel.DefaultValueAttribute(false)]
public bool IsStatic{ get; set; }
public MethodRepTemplate ()
{
IsStatic = false;
}
public MethodRepTemplate (string retType, string methodName, string[] tParams, List<ParamRepTemplate> pars, string[] imps, string javaRep) : base(pars, imps, javaRep)
@ -311,6 +317,7 @@ namespace RusticiSoftware.Translator.CLR
Name = methodName;
TypeParams = tParams;
Return = retType;
IsStatic = false;
}
public MethodRepTemplate (string retType, string methodName, string[] tParams, List<ParamRepTemplate> pars) : this(retType, methodName, tParams, pars, null, null)
@ -332,7 +339,7 @@ namespace RusticiSoftware.Translator.CLR
}
}
return Return == other.Return && Name == other.Name && base.Equals(other);
return Return == other.Return && Name == other.Name && IsStatic == other.IsStatic && base.Equals(other);
}
public override bool Equals (object obj)
@ -364,7 +371,7 @@ namespace RusticiSoftware.Translator.CLR
}
}
return hashCode ^ (Return ?? String.Empty).GetHashCode () ^ (Name ?? String.Empty).GetHashCode () ^ base.GetHashCode();
return hashCode ^ (Return ?? String.Empty).GetHashCode () ^ (Name ?? String.Empty).GetHashCode () ^ IsStatic.GetHashCode() ^ base.GetHashCode();
}
#endregion

View File

@ -110,6 +110,9 @@ namespace cs2j.Template.Utils
methRep.TypeParams = tParams;
}
buildParameters(methRep, m);
if (m.IsStatic) {
methRep.IsStatic = true;
}
iface.Methods.Add(methRep);
}