From 8655407ab6987bb7268fab55b6380051f26668fe Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期三, 24 十一月 2021 10:17:15 +0800 Subject: [PATCH] 备份 --- SiriKit/Data/SceneDateManager.cs | 44 -------------------------------------------- 1 files changed, 0 insertions(+), 44 deletions(-) diff --git a/HDL-ON_iOS/Other/Siri/Data/SceneDateManager.cs b/SiriKit/Data/SceneDateManager.cs similarity index 63% rename from HDL-ON_iOS/Other/Siri/Data/SceneDateManager.cs rename to SiriKit/Data/SceneDateManager.cs index a7651af..b06cb30 100644 --- a/HDL-ON_iOS/Other/Siri/Data/SceneDateManager.cs +++ b/SiriKit/Data/SceneDateManager.cs @@ -9,26 +9,6 @@ { public SceneDateManager() : base(new UserDefaultsStorageDescriptor(NSUserDefaultsHelper.StorageKeys.OrderHistory), new NSMutableArray<SiriScene>()) { } - // Converts an `Order` into `OrderSoupIntent` and donates it as an - // interaction to the system so that this order can be suggested in the - // future or turned into a voice shortcut for quickly placing the same - // order in the future. - void DonateInteraction(SiriScene order) - { - var interaction = new INInteraction(order.Intent, null); - interaction.Identifier = order.Id.ToString(); - interaction.DonateInteraction((error) => - { - if (!(error is null)) - { - Console.WriteLine($"Interaction donation failed: {error}"); - } - else - { - Console.WriteLine("Successfully donated interaction."); - } - }); - } #region Public API for clients of `SoupOrderDataManager` // Convenience method to access the data with a property name that makes @@ -41,30 +21,6 @@ } } - public void PlaceOrder(SiriScene order) - { - // Access to `ManagedDataBackingInstance` is only valid on - // `DataAccessQueue`. - DataAccessQueue.DispatchSync(() => - { - if (ManagedDataBackingInstance.Count == 0) - { - // Getting an error trying to insert at 0 for an empty - // NSMutableArray<Order> - ManagedDataBackingInstance.Add(order); - } - else - { - ManagedDataBackingInstance.Insert(order, 0); - } - }); - - // Access to UserDefaults is gated behind a separate access queue. - WriteData(); - - // Donate an interaction to the system. - DonateInteraction(order); - } #endregion #region Support methods for unarchiving saved data -- Gitblit v1.8.0