Skip to content

Commit

Permalink
[CarPlay] [Xcode 12] Update through beta 6 (xamarin#9479)
Browse files Browse the repository at this point in the history
* carplay initial updates through beta 6
  • Loading branch information
whitneyschmidt authored Aug 28, 2020
1 parent e5e9ff9 commit efe8abd
Show file tree
Hide file tree
Showing 9 changed files with 989 additions and 275 deletions.
50 changes: 50 additions & 0 deletions src/CarPlay/CPMessageListItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// CPMessageListItem.cs
//
// Authors:
// Whitney Schmidt <whschm@microsoft.com>
//
// Copyright (c) Microsoft Corporation.
// Licensed under MIT License.
//

using System;
using Foundation;
using ObjCRuntime;

#nullable enable

namespace CarPlay {

[NoWatch, NoTV, NoMac, iOS (14,0)]
public enum CPMessageListItemType {
Identifier,
FullName,
}

public partial class CPMessageListItem {

public CPMessageListItem (string identifier, string text, CPMessageListItemLeadingConfiguration leadingConfiguration,
CPMessageListItemTrailingConfiguration? trailingConfiguration, string? detailText, string? trailingText) :
this (identifier, text, leadingConfiguration, trailingConfiguration, detailText, trailingText, CPMessageListItemType.Identifier)
{
}

public CPMessageListItem (string identifier, string text, CPMessageListItemLeadingConfiguration leadingConfiguration, CPMessageListItemTrailingConfiguration? trailingConfiguration,
string? detailText, string? trailingText, CPMessageListItemType type) : base (NSObjectFlag.Empty)
{
switch (type) {
case CPMessageListItemType.Identifier:
InitializeHandle (InitWithConversationIdentifier (identifier, text, leadingConfiguration, trailingConfiguration, detailText, trailingText),
"initWithConversationIdentifier:text:leadingConfiguration:trailingConfiguration:detailText:trailingText:");
break;
case CPMessageListItemType.FullName:
InitializeHandle (InitWithFullName (identifier, text, leadingConfiguration, trailingConfiguration, detailText, trailingText),
"initWithFullName:phoneOrEmailAddress:leadingConfiguration:trailingConfiguration:detailText:trailingText:");
break;
default:
throw new ArgumentException (nameof (type));
}
}
}
}
Loading

0 comments on commit efe8abd

Please sign in to comment.