-
Notifications
You must be signed in to change notification settings - Fork 555
[Fix] Add missing C# events in the UIAdaptivePresentationControllerDelegate and UIPopoverPresentationControllerDelegate classes. #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #if !WATCH | ||
| using System; | ||
| using XamCore.UIKit; | ||
| using XamCore.ObjCRuntime; | ||
| using XamCore.Foundation; | ||
|
|
||
| namespace XamCore.UIKit { | ||
| public partial class UIAdaptivePresentationControllerDelegate | ||
| { | ||
| // this is a workaround to allow exposing the old API () | ||
| [Export ("adaptivePresentationStyleForPresentationController:")] | ||
| public virtual UIModalPresentationStyle GetAdaptivePresentationStyle (UIPresentationController forPresentationController) | ||
| { | ||
| throw new You_Should_Not_Call_base_In_This_Method (); | ||
| } | ||
| } | ||
|
|
||
| public static partial class UIAdaptivePresentationControllerDelegate_Extensions | ||
| { | ||
| public static UIModalPresentationStyle GetAdaptivePresentationStyle (this IUIAdaptivePresentationControllerDelegate This, UIPresentationController forPresentationController) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vey minor but param name could be just presentationController
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's the existing signature so it should stay the same |
||
| { | ||
| UIKit.UIApplication.EnsureUIThread (); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ^ the linker won't be able to remove the above check. I can only do so for generated code. |
||
| if (forPresentationController == null) | ||
| throw new ArgumentNullException ("forPresentationController"); | ||
| UIModalPresentationStyle ret; | ||
| if (IntPtr.Size == 8) { | ||
| ret = (UIModalPresentationStyle) ObjCRuntime.Messaging.Int64_objc_msgSend_IntPtr (This.Handle, Selector.GetHandle ("adaptivePresentationStyleForPresentationController:"), forPresentationController.Handle); | ||
| } else { | ||
| ret = (UIModalPresentationStyle) ObjCRuntime.Messaging.int_objc_msgSend_IntPtr (This.Handle, Selector.GetHandle ("adaptivePresentationStyleForPresentationController:"), forPresentationController.Handle); | ||
| } | ||
| return ret; | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
| #endif | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| #if !WATCH | ||
| using XamCore.UIKit; | ||
| using XamCore.Foundation; | ||
|
|
||
| namespace XamCore.UIKit { | ||
| public partial class UIPopoverPresentationControllerDelegate | ||
| { | ||
| // this is a workaround to allow exposing the old API () | ||
| [Export ("adaptivePresentationStyleForPresentationController:")] | ||
| public virtual UIModalPresentationStyle GetAdaptivePresentationStyle (UIPresentationController forPresentationController) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same param name, again very minor |
||
| { | ||
| throw new You_Should_Not_Call_base_In_This_Method (); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if there is any problem with the magic that @rolfbjarne does for the protocols registration in the generator, I would double check with him first :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, there is a ProtocolMember attribute missing. Let me fix that.