Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tools/generator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ public string GetOutputName (string s)
if (s == "System.Void")
return "void";
if (s.StartsWith ("params "))
return "params " + GetOutputName (s.Substring (6));
return "params " + GetOutputName (s.Substring ("params ".Length));
if (s.StartsWith ("global::"))
Report.Error (Report.ErrorCodeGenerator + 0, null, "Unexpected \"global::\" specification. This error happens if it is specified in the Metadata API fixup for example.");
if (!UseGlobal)
Expand Down
6 changes: 4 additions & 2 deletions tools/generator/InterfaceGen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ void GenerateEventArgs (Method m, StreamWriter sw, string indent, CodeGeneration
string args_name = GetArgsName (m);
if (m.RetVal.IsVoid || m.IsEventHandlerWithHandledProperty) {
if (!m.IsSimpleEventHandler || m.IsEventHandlerWithHandledProperty) {
sw.WriteLine ("{0}// event args for {1}.{2}", indent, this.JavaName, m.JavaName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is causing the unit tests to fail, as the expected file contents don't contain it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

sw.WriteLine ("{0}public partial class {1} : global::System.EventArgs {{", indent, args_name);
sw.WriteLine ();
var signature = m.Parameters.GetSignatureDropSender (opt);
Expand All @@ -375,9 +376,10 @@ void GenerateEventArgs (Method m, StreamWriter sw, string indent, CodeGeneration
if (p.IsSender)
continue;
sw.WriteLine ();
sw.WriteLine ("{0}\t{1} {2};", indent, opt.GetOutputName (p.Type), opt.GetSafeIdentifier (p.Name));
var safeTypeName = p.Type.StartsWith ("params ", StringComparison.Ordinal) ? p.Type.Substring ("params ".Length) : p.Type;
sw.WriteLine ("{0}\t{1} {2};", indent, opt.GetOutputName (safeTypeName), opt.GetSafeIdentifier (p.Name));
// AbsListView.IMultiChoiceModeListener.onItemCheckedStateChanged() hit this strict name check, at parameter "@checked".
sw.WriteLine ("{0}\tpublic {1} {2} {{", indent, opt.GetOutputName (p.Type), p.PropertyName);
sw.WriteLine ("{0}\tpublic {1} {2} {{", indent, opt.GetOutputName (safeTypeName), p.PropertyName);
sw.WriteLine ("{0}\t\tget {{ return {1}; }}", indent, opt.GetSafeIdentifier (p.Name));
sw.WriteLine ("{0}\t}}", indent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public unsafe void OnEvent (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDr

}

// event args for com.google.android.exoplayer.drm.ExoMediaDrm.OnEventListener.onEvent
public partial class ExoMediaDrmOnEventEventArgs : global::System.EventArgs {

public ExoMediaDrmOnEventEventArgs (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm p0, byte[] p1, int p2, int p3, byte[] p4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public unsafe void OnEvent (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDr

}

// event args for com.google.android.exoplayer.drm.ExoMediaDrm.OnEventListener.onEvent
public partial class ExoMediaDrmOnEventEventArgs : global::System.EventArgs {

public ExoMediaDrmOnEventEventArgs (global::Com.Google.Android.Exoplayer.Drm.IExoMediaDrm p0, byte[] p1, int p2, int p3, byte[] p4)
Expand Down