Skip to content
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

[Intents] Add bindings for Xcode 9 Beta 1, 2, 3, 4 & 5 #2493

Merged
merged 4 commits into from
Aug 15, 2017
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
43 changes: 43 additions & 0 deletions src/Intents/INBillTypeResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// INBillTypeResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INBillTypeResolutionResult {

public static INBillTypeResolutionResult GetSuccess (INBillType resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems to be a recurring pattern in the PR. Maybe move this to a Xcode check ? (like the tests) that can be re-used. It would reduce the number of #if\elif|endif across the sources.

return SuccessWithResolvedBillType (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INBillTypeResolutionResult GetConfirmationRequired (INBillType valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return ConfirmationRequiredWithBillTypeToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
27 changes: 27 additions & 0 deletions src/Intents/INCallRecord.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// INCallRecord.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCallRecord {

public double? CallDuration {
get { return WeakCallDuration?.DoubleValue; }
}

public bool? Unseen {
get { return WeakUnseen?.BoolValue; }
}
}
}
#endif
47 changes: 47 additions & 0 deletions src/Intents/INCallRecordTypeResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// INCallRecordTypeResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCallRecordTypeResolutionResult {

public static INCallRecordTypeResolutionResult GetSuccess (INCallRecordType resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#elif MONOMAC
if (PlatformHelper.CheckSystemVersion (10, 13))
#endif
return SuccessWithResolvedCallRecordType (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INCallRecordTypeResolutionResult GetConfirmationRequired (INCallRecordType valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#elif MONOMAC
if (PlatformHelper.CheckSystemVersion (10, 13))
#endif
return ConfirmationRequiredWithCallRecordTypeToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
43 changes: 43 additions & 0 deletions src/Intents/INCarAirCirculationModeResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// INCarAirCirculationModeResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCarAirCirculationModeResolutionResult {

public static INCarAirCirculationModeResolutionResult GetSuccess (INCarAirCirculationMode resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return SuccessWithResolvedCarAirCirculationMode (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INCarAirCirculationModeResolutionResult GetConfirmationRequired (INCarAirCirculationMode valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return ConfirmationRequiredWithCarAirCirculationModeToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
43 changes: 43 additions & 0 deletions src/Intents/INCarAudioSourceResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// INCarAudioSourceResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCarAudioSourceResolutionResult {

public static INCarAudioSourceResolutionResult GetSuccess (INCarAudioSource resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return SuccessWithResolvedCarAudioSource (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INCarAudioSourceResolutionResult GetConfirmationRequired (INCarAudioSource valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return ConfirmationRequiredWithCarAudioSourceToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
43 changes: 43 additions & 0 deletions src/Intents/INCarDefrosterResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// INCarDefrosterResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCarDefrosterResolutionResult {

public static INCarDefrosterResolutionResult GetSuccess (INCarDefroster resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return SuccessWithResolvedCarDefroster (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INCarDefrosterResolutionResult GetConfirmationRequired (INCarDefroster valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return ConfirmationRequiredWithCarDefrosterToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
43 changes: 43 additions & 0 deletions src/Intents/INCarSignalOptionsResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// INCarAirCirculationModeResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INCarSignalOptionsResolutionResult {

public static INCarSignalOptionsResolutionResult GetSuccess (INCarSignalOptions resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return SuccessWithResolvedCarSignalOptions (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INCarSignalOptionsResolutionResult GetConfirmationRequired (INCarSignalOptions valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#endif
return ConfirmationRequiredWithCarSignalOptionsToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
24 changes: 24 additions & 0 deletions src/Intents/INInteraction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// INInteraction.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0 && !MONOMAC
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INInteraction {

public T GetParameterValue<T> (INParameter parameter) where T : NSObject
{
return Runtime.GetNSObject<T> (_GetParameterValue (parameter));
}
}
}
#endif
47 changes: 47 additions & 0 deletions src/Intents/INMessageAttributeOptionsResolutionResult.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// INMessageAttributeOptionsResolutionResult.cs
//
// Authors:
// Alex Soto <alexsoto@microsoft.com>
//
// Copyright 2017 Xamarin Inc. All rights reserved.
//

#if XAMCORE_2_0
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.Intents {
public partial class INMessageAttributeOptionsResolutionResult {

public static INMessageAttributeOptionsResolutionResult GetSuccess (INMessageAttributeOptions resolvedValue)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#elif MONOMAC
if (PlatformHelper.CheckSystemVersion (10, 13))
#endif
return SuccessWithResolvedMessageAttributeOptions (resolvedValue);
else
return SuccessWithResolvedValue (resolvedValue);
}

public static INMessageAttributeOptionsResolutionResult GetConfirmationRequired (INMessageAttributeOptions valueToConfirm)
{
#if IOS
if (XamCore.UIKit.UIDevice.CurrentDevice.CheckSystemVersion (11, 0))
#elif WATCH
if (XamCore.WatchKit.WKInterfaceDevice.CurrentDevice.CheckSystemVersion (4, 0))
#elif MONOMAC
if (PlatformHelper.CheckSystemVersion (10, 13))
#endif
return ConfirmationRequiredWithMessageAttributeOptionsToConfirm (valueToConfirm);
else
return ConfirmationRequiredWithValueToConfirm (valueToConfirm);
}
}
}
#endif
Loading