Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace MonoDroid.Tuner
class MonoDroidMarkStep : MarkStep
{
const string RegisterAttribute = "Android.Runtime.RegisterAttribute";
const string ICustomMarshalerName = "System.Runtime.InteropServices.ICustomMarshaler";

// If this is one of our infrastructure methods that has [Register], like:
// [Register ("hasWindowFocus", "()Z", "GetHasWindowFocusHandler")],
Expand Down Expand Up @@ -142,6 +143,15 @@ protected override TypeDefinition MarkType (TypeReference reference)
if (type.Module.Assembly.Name.Name == "System.Core")
ProcessSystemCore (type);

if (type.HasMethods && type.HasInterfaces && type.Implements (ICustomMarshalerName)) {
foreach (MethodDefinition method in type.Methods) {
if (method.Name == "GetInstance" && method.IsStatic && method.HasParameters && method.Parameters.Count == 1 && method.ReturnType.FullName == ICustomMarshalerName && method.Parameters.First ().ParameterType.FullName == "System.String") {
MarkMethod (method);
break;
}
}
}

return type;
}

Expand Down