Decompiled source of LabMTC v1.0.0
Mods/LabMTC.dll
Decompiled 7 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BoneLib.BoneMenu; using MelonLoader; using Microsoft.CodeAnalysis; using UnityEngine; using WeatherElectric.BONELAB.BoneMenu; using WeatherElectric.LabMTC; using WeatherElectric.LabMTC.Menu; using WeatherElectric.Logging; using Windows.Foundation; using Windows.Media.Control; using WindowsMediaController; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("Allows control over the Windows Media Transport Control system.")] [assembly: AssemblyDescription("Allows control over the Windows Media Transport Control system.")] [assembly: AssemblyCompany("Weather Electric")] [assembly: AssemblyProduct("LabMTC")] [assembly: AssemblyCopyright("Developed by Mabel Amber")] [assembly: AssemblyTrademark("Weather Electric")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: MelonInfo(typeof(Main), "LabMTC", "1.0.0", "Mabel Amber", "https://thunderstore.io/c/bonelab/p/WeatherElectric/LabMTC/")] [assembly: MelonColor(255, 0, 255, 239)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace WeatherElectric.LabMTC { public class Main : MelonMod { internal const string Name = "LabMTC"; internal const string Description = "Allows control over the Windows Media Transport Control system."; internal const string Author = "Mabel Amber"; internal const string Company = "Weather Electric"; internal const string Version = "1.0.0"; internal const string DownloadLink = "https://thunderstore.io/c/bonelab/p/WeatherElectric/LabMTC/"; internal static LoggerInstance Logger; public override void OnInitializeMelon() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown Logger = new LoggerInstance(((MelonBase)this).LoggerInstance); BoneMenu.Setup(); SMTCInterface.Initialize(); } } public static class SMTCInterface { [CompilerGenerated] private static class <>O { public static SessionChangeDelegate <0>__AnySessionOpened; public static SessionChangeDelegate <1>__AnySessionClosed; public static SessionChangeDelegate <2>__FocusedSessionChanged; public static SongChangeDelegate <3>__AnyMediaPropertyChanged; public static PlaybackChangeDelegate <4>__AnyPlaybackStateChanged; public static TimelineChangeDelegate <5>__AnyTimelinePropertyChanged; } private static MediaManager _manager; public static Action<MediaSession> OnAnySessionOpened; public static Action<MediaSession> OnAnySessionClosed; public static Action<MediaSession> OnFocusedSessionChanged; public static Action<MediaSession, GlobalSystemMediaTransportControlsSessionMediaProperties> OnAnyMediaPropertyChanged; public static Action<MediaSession, GlobalSystemMediaTransportControlsSessionPlaybackInfo> OnAnyPlaybackStateChanged; public static Action<MediaSession, GlobalSystemMediaTransportControlsSessionTimelineProperties> OnAnyTimelinePropertyChanged; internal static void Initialize() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown _manager = new MediaManager(); MediaManager manager = _manager; object obj = <>O.<0>__AnySessionOpened; if (obj == null) { SessionChangeDelegate val = AnySessionOpened; <>O.<0>__AnySessionOpened = val; obj = (object)val; } manager.OnAnySessionOpened += (SessionChangeDelegate)obj; MediaManager manager2 = _manager; object obj2 = <>O.<1>__AnySessionClosed; if (obj2 == null) { SessionChangeDelegate val2 = AnySessionClosed; <>O.<1>__AnySessionClosed = val2; obj2 = (object)val2; } manager2.OnAnySessionClosed += (SessionChangeDelegate)obj2; MediaManager manager3 = _manager; object obj3 = <>O.<2>__FocusedSessionChanged; if (obj3 == null) { SessionChangeDelegate val3 = FocusedSessionChanged; <>O.<2>__FocusedSessionChanged = val3; obj3 = (object)val3; } manager3.OnFocusedSessionChanged += (SessionChangeDelegate)obj3; MediaManager manager4 = _manager; object obj4 = <>O.<3>__AnyMediaPropertyChanged; if (obj4 == null) { SongChangeDelegate val4 = AnyMediaPropertyChanged; <>O.<3>__AnyMediaPropertyChanged = val4; obj4 = (object)val4; } manager4.OnAnyMediaPropertyChanged += (SongChangeDelegate)obj4; MediaManager manager5 = _manager; object obj5 = <>O.<4>__AnyPlaybackStateChanged; if (obj5 == null) { PlaybackChangeDelegate val5 = AnyPlaybackStateChanged; <>O.<4>__AnyPlaybackStateChanged = val5; obj5 = (object)val5; } manager5.OnAnyPlaybackStateChanged += (PlaybackChangeDelegate)obj5; MediaManager manager6 = _manager; object obj6 = <>O.<5>__AnyTimelinePropertyChanged; if (obj6 == null) { TimelineChangeDelegate val6 = AnyTimelinePropertyChanged; <>O.<5>__AnyTimelinePropertyChanged = val6; obj6 = (object)val6; } manager6.OnAnyTimelinePropertyChanged += (TimelineChangeDelegate)obj6; _manager.Start(); } private static void AnySessionOpened(MediaSession mediaSession) { OnAnySessionOpened(mediaSession); } private static void AnySessionClosed(MediaSession mediaSession) { OnAnySessionClosed(mediaSession); } private static void FocusedSessionChanged(MediaSession mediaSession) { OnFocusedSessionChanged(mediaSession); } private static void AnyMediaPropertyChanged(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionMediaProperties mediaProperties) { OnAnyMediaPropertyChanged(mediaSession, mediaProperties); } private static void AnyPlaybackStateChanged(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionPlaybackInfo playbackInfo) { OnAnyPlaybackStateChanged(mediaSession, playbackInfo); } private static void AnyTimelinePropertyChanged(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionTimelineProperties timelineProperties) { OnAnyTimelinePropertyChanged(mediaSession, timelineProperties); } public static MediaSession GetFocusedSession() { return _manager.GetFocusedSession(); } public static IReadOnlyDictionary<string, MediaSession> GetAllMediaSessions() { return _manager.CurrentMediaSessions; } public static async void Play() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TryPlayAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void Pause() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TryPauseAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void Next() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TrySkipNextAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void Previous() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TrySkipPreviousAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void Stop() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TryStopAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void Rewind() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TryRewindAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static async void FastForward() { try { if (_manager.GetFocusedSession() != null) { TaskAwaiter<bool> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<bool>(_manager.GetFocusedSession().ControlSession.TryFastForwardAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<bool> taskAwaiter2 = default(TaskAwaiter<bool>); taskAwaiter = taskAwaiter2; } taskAwaiter.GetResult(); } } catch (Exception value) { Main.Logger.Log($"Exception Caught: {value}", (LogLevel)2); } } public static IAsyncOperation<GlobalSystemMediaTransportControlsSessionMediaProperties> GetMediaProperties() { if (_manager.GetFocusedSession() == null) { return null; } return _manager.GetFocusedSession().ControlSession.TryGetMediaPropertiesAsync(); } } } namespace WeatherElectric.LabMTC.Menu { internal static class BoneMenu { private static FunctionElement _currentMedia; private static FunctionElement _currentSession; private const string BaseMediaName = "Playing: "; private const string BaseSessionName = "From: "; public static void Setup() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) Page obj = Menu.MainPage.CreatePage("LabMTC", Color.cyan, 0, true); _currentMedia = obj.CreateFunction("Playing: ", Color.white, (Action)delegate { }); _currentSession = obj.CreateFunction("From: ", Color.white, (Action)delegate { }); obj.CreateFunction("Play", Color.green, (Action)SMTCInterface.Play); obj.CreateFunction("Pause", Color.yellow, (Action)SMTCInterface.Pause); obj.CreateFunction("Next", Color.white, (Action)SMTCInterface.Next); obj.CreateFunction("Previous", Color.white, (Action)SMTCInterface.Previous); SMTCInterface.OnAnyMediaPropertyChanged = (Action<MediaSession, GlobalSystemMediaTransportControlsSessionMediaProperties>)Delegate.Combine(SMTCInterface.OnAnyMediaPropertyChanged, new Action<MediaSession, GlobalSystemMediaTransportControlsSessionMediaProperties>(OnMediaPropertyChanged)); SMTCInterface.OnFocusedSessionChanged = (Action<MediaSession>)Delegate.Combine(SMTCInterface.OnFocusedSessionChanged, new Action<MediaSession>(OnSessionChanged)); SMTCInterface.OnAnySessionClosed = (Action<MediaSession>)Delegate.Combine(SMTCInterface.OnAnySessionClosed, new Action<MediaSession>(OnSessionClosed)); } private static void OnMediaPropertyChanged(MediaSession session, GlobalSystemMediaTransportControlsSessionMediaProperties properties) { ((Element)_currentMedia).ElementName = "Playing: " + properties.Title; ((Element)_currentSession).ElementName = "From: " + session.Id; } private static void OnSessionChanged(MediaSession newSession) { IAsyncOperation<GlobalSystemMediaTransportControlsSessionMediaProperties> val = newSession.ControlSession.TryGetMediaPropertiesAsync(); ((Element)_currentMedia).ElementName = "Playing: " + val.GetResults().Title; ((Element)_currentSession).ElementName = "From: " + newSession.ControlSession.SourceAppUserModelId; } private static void OnSessionClosed(MediaSession session) { ((Element)_currentMedia).ElementName = "Playing: "; } } }
UserLibs/WindowsMediaController.dll
Decompiled 7 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Windows.Media.Control; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("DubyaDude")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("\r\n\t\tProvides a wrapper for developers to more easily get information from and interact with the Windows 10/11 OS media interface (Also referred to Windows System Media Transport Controls (SMTC)).\r\n\t\tAllows Playback Control on individual Media Sessions (Spotify, Chrome etc), Getting media information of currently playing (Song, Author, Thumbnail etc), and more")] [assembly: AssemblyFileVersion("2.5.5.0")] [assembly: AssemblyInformationalVersion("2.5.5+8732cc4750fe404cd07b72266be216e7b4f12199")] [assembly: AssemblyProduct("WindowsMediaController")] [assembly: AssemblyTitle("WindowsMediaController")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/DubyaDude/WindowsMediaController/")] [assembly: TargetPlatform("Windows10.0.22621.0")] [assembly: SupportedOSPlatform("Windows10.0.22621.0")] [assembly: AssemblyVersion("2.5.5.0")] namespace WindowsMediaController; public sealed class MediaManager : IDisposable { public delegate void SessionChangeDelegate(MediaSession mediaSession); public delegate void PlaybackChangeDelegate(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionPlaybackInfo playbackInfo); public delegate void SongChangeDelegate(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionMediaProperties mediaProperties); public delegate void TimelineChangeDelegate(MediaSession mediaSession, GlobalSystemMediaTransportControlsSessionTimelineProperties timelineProperties); public sealed class MediaSession { public readonly string Id; internal MediaManager MediaManagerInstance; public GlobalSystemMediaTransportControlsSession ControlSession { get; private set; } public event SessionChangeDelegate OnSessionClosed; public event PlaybackChangeDelegate OnPlaybackStateChanged; public event SongChangeDelegate OnMediaPropertyChanged; public event TimelineChangeDelegate OnTimelinePropertyChanged; internal MediaSession(GlobalSystemMediaTransportControlsSession controlSession, MediaManager mediaMangerInstance) { MediaManagerInstance = mediaMangerInstance; ControlSession = controlSession; Id = ControlSession.SourceAppUserModelId; ControlSession.MediaPropertiesChanged += OnSongChangeAsync; ControlSession.PlaybackInfoChanged += OnPlaybackInfoChanged; ControlSession.TimelinePropertiesChanged += OnTimelinePropertiesChanged; } private void OnPlaybackInfoChanged(GlobalSystemMediaTransportControlsSession controlSession, PlaybackInfoChangedEventArgs args = null) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) try { GlobalSystemMediaTransportControlsSessionPlaybackInfo playbackInfo = controlSession.GetPlaybackInfo(); if ((int)playbackInfo.PlaybackStatus == 0) { Dispose(); return; } try { this.OnPlaybackStateChanged?.Invoke(this, playbackInfo); } catch (Exception exception) { MediaManagerInstance.Logger?.LogError(exception, "[{mediaId}] Error in OnPlaybackStateChanged Invoke", Id); } try { MediaManagerInstance.OnAnyPlaybackStateChanged?.Invoke(this, playbackInfo); } catch (Exception exception2) { MediaManagerInstance.Logger?.LogError(exception2, "[{mediaId}] Error in OnAnyPlaybackStateChanged Invoke", Id); } } catch (Exception exception3) { MediaManagerInstance.Logger?.LogError(exception3, "[{mediaId}] Error when getting PlaybackInfo", Id); } } internal async void OnSongChangeAsync(GlobalSystemMediaTransportControlsSession controlSession, MediaPropertiesChangedEventArgs args = null) { try { TaskAwaiter<GlobalSystemMediaTransportControlsSessionMediaProperties> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<GlobalSystemMediaTransportControlsSessionMediaProperties>(controlSession.TryGetMediaPropertiesAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<GlobalSystemMediaTransportControlsSessionMediaProperties> taskAwaiter2 = default(TaskAwaiter<GlobalSystemMediaTransportControlsSessionMediaProperties>); taskAwaiter = taskAwaiter2; } GlobalSystemMediaTransportControlsSessionMediaProperties result = taskAwaiter.GetResult(); try { this.OnMediaPropertyChanged?.Invoke(this, result); } catch (Exception exception) { MediaManagerInstance.Logger?.LogError(exception, "[{mediaId}] Error in OnMediaPropertyChanged Invoke", Id); } try { MediaManagerInstance.OnAnyMediaPropertyChanged?.Invoke(this, result); } catch (Exception exception2) { MediaManagerInstance.Logger?.LogError(exception2, "[{mediaId}] Error in OnAnyMediaPropertyChanged Invoke", Id); } } catch (Exception ex) { if (ex.Message.Contains("0x800706BA") || ex.Message.Contains("0x80070015")) { MediaManagerInstance.Logger?.LogWarning(ex, "[{mediaId}] Ignorable error when getting MediaProperties", Id); } else { MediaManagerInstance.Logger?.LogError(ex, "[{mediaId}] Error when getting MediaProperties", Id); } } } internal void OnTimelinePropertiesChanged(GlobalSystemMediaTransportControlsSession sender, TimelinePropertiesChangedEventArgs args = null) { try { GlobalSystemMediaTransportControlsSessionTimelineProperties timelineProperties = sender.GetTimelineProperties(); try { this.OnTimelinePropertyChanged?.Invoke(this, timelineProperties); } catch (Exception exception) { MediaManagerInstance.Logger?.LogError(exception, "[{mediaId}] Error in OnTimelinePropertyChanged Invoke", Id); } try { MediaManagerInstance.OnAnyTimelinePropertyChanged?.Invoke(this, timelineProperties); } catch (Exception exception2) { MediaManagerInstance.Logger?.LogError(exception2, "[{mediaId}] Error in OnAnyTimelinePropertyChanged Invoke", Id); } } catch (Exception exception3) { MediaManagerInstance.Logger?.LogError(exception3, "[{mediaId}] Error when getting TimelineProperties", Id); } } internal void Dispose() { if (MediaManagerInstance.RemoveSource(this)) { this.OnPlaybackStateChanged = null; this.OnMediaPropertyChanged = null; this.OnSessionClosed = null; ControlSession.PlaybackInfoChanged -= OnPlaybackInfoChanged; ControlSession.MediaPropertiesChanged -= OnSongChangeAsync; ControlSession.TimelinePropertiesChanged -= OnTimelinePropertiesChanged; ControlSession = null; try { this.OnSessionClosed?.Invoke(this); } catch (Exception exception) { MediaManagerInstance.Logger?.LogError(exception, "[{mediaId}] Error in OnSessionClosed Invoke", Id); } } } } private readonly Dictionary<string, MediaSession> _CurrentMediaSessions = new Dictionary<string, MediaSession>(); public IReadOnlyDictionary<string, MediaSession> CurrentMediaSessions => _CurrentMediaSessions; public bool IsStarted { get; private set; } public GlobalSystemMediaTransportControlsSessionManager WindowsSessionManager { get; private set; } public ILogger Logger { get; set; } public event SessionChangeDelegate OnAnySessionOpened; public event SessionChangeDelegate OnAnySessionClosed; public event SessionChangeDelegate OnFocusedSessionChanged; public event PlaybackChangeDelegate OnAnyPlaybackStateChanged; public event SongChangeDelegate OnAnyMediaPropertyChanged; public event TimelineChangeDelegate OnAnyTimelinePropertyChanged; public void Start() { CheckStarted(checkStarted: true); WindowsSessionManager = WindowsRuntimeSystemExtensions.GetAwaiter<GlobalSystemMediaTransportControlsSessionManager>(GlobalSystemMediaTransportControlsSessionManager.RequestAsync()).GetResult(); CompleteStart(); } public async Task StartAsync() { CheckStarted(checkStarted: true); TaskAwaiter<GlobalSystemMediaTransportControlsSessionManager> taskAwaiter = WindowsRuntimeSystemExtensions.GetAwaiter<GlobalSystemMediaTransportControlsSessionManager>(GlobalSystemMediaTransportControlsSessionManager.RequestAsync()); if (!taskAwaiter.IsCompleted) { await taskAwaiter; TaskAwaiter<GlobalSystemMediaTransportControlsSessionManager> taskAwaiter2 = default(TaskAwaiter<GlobalSystemMediaTransportControlsSessionManager>); taskAwaiter = taskAwaiter2; } GlobalSystemMediaTransportControlsSessionManager result = taskAwaiter.GetResult(); WindowsSessionManager = result; CompleteStart(); } public void ForceUpdate() { SessionsChanged(WindowsSessionManager); CurrentSessionChanged(WindowsSessionManager); } public MediaSession GetFocusedSession() { CheckStarted(checkStarted: false); return GetFocusedSession(WindowsSessionManager); } private void CheckStarted(bool checkStarted) { if (IsStarted && checkStarted) { throw new InvalidOperationException("MediaManager already started"); } if (!IsStarted && !checkStarted) { throw new InvalidOperationException("MediaManager has not started"); } } private void CompleteStart() { ForceUpdate(); WindowsSessionManager.SessionsChanged += SessionsChanged; WindowsSessionManager.CurrentSessionChanged += CurrentSessionChanged; IsStarted = true; } private void CurrentSessionChanged(GlobalSystemMediaTransportControlsSessionManager sender, CurrentSessionChangedEventArgs args = null) { MediaSession focusedSession = GetFocusedSession(sender); try { this.OnFocusedSessionChanged?.Invoke(focusedSession); } catch (Exception exception) { Logger?.LogError(exception, "Error in OnFocusedSessionChanged Invoke"); } } private MediaSession GetFocusedSession(GlobalSystemMediaTransportControlsSessionManager sender) { GlobalSystemMediaTransportControlsSession val = null; try { val = sender.GetCurrentSession(); } catch (Exception exception) { Logger?.LogError(exception, "Error when getting CurrentSession"); } if (val != (GlobalSystemMediaTransportControlsSession)null && _CurrentMediaSessions.TryGetValue(val.SourceAppUserModelId, out var value)) { return value; } return null; } private void SessionsChanged(GlobalSystemMediaTransportControlsSessionManager winSessionManager, SessionsChangedEventArgs args = null) { IReadOnlyList<GlobalSystemMediaTransportControlsSession> sessions; try { sessions = winSessionManager.GetSessions(); } catch (Exception exception) { Logger?.LogError(exception, "Error when getting Sessions"); return; } foreach (GlobalSystemMediaTransportControlsSession item in sessions) { if (!_CurrentMediaSessions.ContainsKey(item.SourceAppUserModelId)) { MediaSession mediaSession = new MediaSession(item, this); _CurrentMediaSessions[item.SourceAppUserModelId] = mediaSession; try { this.OnAnySessionOpened?.Invoke(mediaSession); } catch (Exception exception2) { Logger?.LogError(exception2, "Error in OnAnySessionOpened Invoke"); } mediaSession.OnTimelinePropertiesChanged(item); mediaSession.OnSongChangeAsync(item); } } string[] array = new string[sessions.Count]; for (int i = 0; i < sessions.Count; i++) { array[i] = sessions[i].SourceAppUserModelId; } List<MediaSession> list = new List<MediaSession>(); foreach (KeyValuePair<string, MediaSession> currentMediaSession in _CurrentMediaSessions) { if (Array.IndexOf(array, currentMediaSession.Key) == -1) { list.Add(currentMediaSession.Value); } } foreach (MediaSession item2 in list) { item2.Dispose(); } } private bool RemoveSource(MediaSession mediaSession) { if (_CurrentMediaSessions.ContainsKey(mediaSession.Id)) { _CurrentMediaSessions.Remove(mediaSession.Id); try { this.OnAnySessionClosed?.Invoke(mediaSession); } catch (Exception exception) { Logger?.LogError(exception, "Error in OnAnySessionClosed Invoke"); } return true; } return false; } public void Dispose() { this.OnAnySessionOpened = null; this.OnAnySessionClosed = null; this.OnAnyMediaPropertyChanged = null; this.OnAnyPlaybackStateChanged = null; this.OnFocusedSessionChanged = null; foreach (string item in new List<string>(_CurrentMediaSessions.Keys)) { _CurrentMediaSessions[item].Dispose(); } _CurrentMediaSessions?.Clear(); IsStarted = false; WindowsSessionManager.SessionsChanged -= SessionsChanged; WindowsSessionManager.CurrentSessionChanged -= CurrentSessionChanged; WindowsSessionManager = null; Logger = null; } }
UserLibs/WinRT.Runtime.dll
Decompiled 7 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Globalization; using System.IO; using System.Linq; using System.Linq.Expressions; using System.Numerics; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.ExceptionServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading; using System.Windows.Input; using ABI.Microsoft.UI.Xaml.Data; using ABI.Microsoft.UI.Xaml.Interop; using ABI.System; using ABI.System.Collections; using ABI.System.Collections.Generic; using ABI.System.Collections.Specialized; using ABI.System.ComponentModel; using ABI.System.Numerics; using ABI.System.Windows.Input; using ABI.WinRT; using ABI.WinRT.Interop; using ABI.Windows.Foundation; using ABI.Windows.Foundation.Collections; using Microsoft.CodeAnalysis; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Automation; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Interop; using Microsoft.UI.Xaml.Markup; using WinRT; using WinRT.Interop; using Windows.Foundation; using Windows.Foundation.Collections; using Windows.UI.Xaml; using Windows.UI.Xaml.Automation; using Windows.UI.Xaml.Markup; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SupportedOSPlatform("Windows")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] [assembly: AssemblyDescription("C#/WinRT Runtime v2.2.0.241111.1")] [assembly: AssemblyFileVersion("2.2.0.48161")] [assembly: AssemblyInformationalVersion("2.2.0.48161+8649ee3eeb2445ca2a36d80d878ef60b96a6c65d")] [assembly: AssemblyProduct("C#/WinRT")] [assembly: AssemblyTitle("C#/WinRT Runtime v2.2.0.241111.1")] [assembly: NeutralResourcesLanguage("en")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class <Module> { static <Module>() { ProjectionInitializer.InitalizeProjection(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] internal sealed class IsUnmanagedAttribute : Attribute { } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Windows.Foundation { internal static class GSR { public static string ArgumentOutOfRange_NeedNonNegNum = "Non-negative number required."; } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Point))] [WinRTExposedType(typeof(StructTypeDetails<Point, Point>))] public struct Point : IFormattable { public float _x; public float _y; public double X { get { return _x; } set { _x = (float)value; } } public double Y { get { return _y; } set { _y = (float)value; } } public Point(float x, float y) { _x = x; _y = y; } public Point(double x, double y) : this((float)x, (float)y) { } public override string ToString() { return ConvertToString(null, null); } public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } private string ConvertToString(string format, IFormatProvider provider) { char numericListSeparator = GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}", numericListSeparator, _x, _y); } private static char GetNumericListSeparator(IFormatProvider provider) { char c = ','; NumberFormatInfo instance = NumberFormatInfo.GetInstance(provider); if (instance.NumberDecimalSeparator.Length > 0 && instance.NumberDecimalSeparator[0] == c) { c = ';'; } return c; } public static bool operator ==(Point point1, Point point2) { if (point1._x == point2._x) { return point1._y == point2._y; } return false; } public static bool operator !=(Point point1, Point point2) { return !(point1 == point2); } public override bool Equals(object o) { if (o is Point) { return this == (Point)o; } return false; } public bool Equals(Point value) { return this == value; } public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode(); } } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Rect))] [WinRTExposedType(typeof(StructTypeDetails<Rect, Rect>))] public struct Rect : IFormattable { public float _x; public float _y; public float _width; public float _height; private const double EmptyX = double.PositiveInfinity; private const double EmptyY = double.PositiveInfinity; private const double EmptyWidth = double.NegativeInfinity; private const double EmptyHeight = double.NegativeInfinity; private static readonly Rect s_empty = CreateEmptyRect(); public double X { get { return _x; } set { _x = (float)value; } } public double Y { get { return _y; } set { _y = (float)value; } } public double Width { get { return _width; } set { if (value < 0.0) { throw new ArgumentOutOfRangeException("Width", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = (float)value; } } public double Height { get { return _height; } set { if (value < 0.0) { throw new ArgumentOutOfRangeException("Height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _height = (float)value; } } public double Left => _x; public double Top => _y; public double Right { get { if (IsEmpty) { return double.NegativeInfinity; } return _x + _width; } } public double Bottom { get { if (IsEmpty) { return double.NegativeInfinity; } return _y + _height; } } public static Rect Empty => s_empty; public bool IsEmpty => _width < 0f; public Rect(float x, float y, float width, float height) { if (width < 0f) { throw new ArgumentOutOfRangeException("width", GSR.ArgumentOutOfRange_NeedNonNegNum); } if (height < 0f) { throw new ArgumentOutOfRangeException("height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _x = x; _y = y; _width = width; _height = height; } public Rect(double x, double y, double width, double height) : this((float)x, (float)y, (float)width, (float)height) { } public Rect(Point point1, Point point2) { _x = Math.Min(point1._x, point2._x); _y = Math.Min(point1._y, point2._y); _width = Math.Max(Math.Max(point1._x, point2._x) - _x, 0f); _height = Math.Max(Math.Max(point1._y, point2._y) - _y, 0f); } public Rect(Point location, Size size) { if (size.IsEmpty) { this = s_empty; return; } _x = location._x; _y = location._y; _width = size._width; _height = size._height; } public bool Contains(Point point) { return ContainsInternal(point._x, point._y); } public void Intersect(Rect rect) { if (!IntersectsWith(rect)) { this = s_empty; return; } double num = Math.Max(X, rect.X); double num2 = Math.Max(Y, rect.Y); Width = Math.Max(Math.Min(X + Width, rect.X + rect.Width) - num, 0.0); Height = Math.Max(Math.Min(Y + Height, rect.Y + rect.Height) - num2, 0.0); X = num; Y = num2; } public void Union(Rect rect) { if (IsEmpty) { this = rect; } else if (!rect.IsEmpty) { double num = Math.Min(Left, rect.Left); double num2 = Math.Min(Top, rect.Top); if (rect.Width == double.PositiveInfinity || Width == double.PositiveInfinity) { Width = double.PositiveInfinity; } else { double num3 = Math.Max(Right, rect.Right); Width = Math.Max(num3 - num, 0.0); } if (rect.Height == double.PositiveInfinity || Height == double.PositiveInfinity) { Height = double.PositiveInfinity; } else { double num4 = Math.Max(Bottom, rect.Bottom); Height = Math.Max(num4 - num2, 0.0); } X = num; Y = num2; } } public void Union(Point point) { Union(new Rect(point, point)); } private bool ContainsInternal(float x, float y) { if (x >= _x && x - _width <= _x && y >= _y) { return y - _height <= _y; } return false; } internal bool IntersectsWith(Rect rect) { if (_width < 0f || rect._width < 0f) { return false; } if (rect._x <= _x + _width && rect._x + rect._width >= _x && rect._y <= _y + _height) { return rect._y + rect._height >= _y; } return false; } private static Rect CreateEmptyRect() { return new Rect { _x = float.PositiveInfinity, _y = float.PositiveInfinity, _width = float.NegativeInfinity, _height = float.NegativeInfinity }; } public override string ToString() { return ConvertToString(null, null); } public string ToString(IFormatProvider provider) { return ConvertToString(null, provider); } string IFormattable.ToString(string format, IFormatProvider provider) { return ConvertToString(format, provider); } internal string ConvertToString(string format, IFormatProvider provider) { if (IsEmpty) { return "Empty."; } char numericListSeparator = TokenizerHelper.GetNumericListSeparator(provider); return string.Format(provider, "{1:" + format + "}{0}{2:" + format + "}{0}{3:" + format + "}{0}{4:" + format + "}", numericListSeparator, _x, _y, _width, _height); } public bool Equals(Rect value) { return this == value; } public static bool operator ==(Rect rect1, Rect rect2) { if (rect1._x == rect2._x && rect1._y == rect2._y && rect1._width == rect2._width) { return rect1._height == rect2._height; } return false; } public static bool operator !=(Rect rect1, Rect rect2) { return !(rect1 == rect2); } public override bool Equals(object o) { if (o is Rect) { return this == (Rect)o; } return false; } public override int GetHashCode() { return X.GetHashCode() ^ Y.GetHashCode() ^ Width.GetHashCode() ^ Height.GetHashCode(); } } [WindowsRuntimeType("Windows.Foundation.FoundationContract")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.Size))] [WinRTExposedType(typeof(StructTypeDetails<Size, Size>))] public struct Size { public float _width; public float _height; private static readonly Size s_empty = CreateEmptySize(); public double Width { get { return _width; } set { if (value < 0.0) { throw new ArgumentOutOfRangeException("Width", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = (float)value; } } public double Height { get { return _height; } set { if (value < 0.0) { throw new ArgumentOutOfRangeException("Height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _height = (float)value; } } public static Size Empty => s_empty; public bool IsEmpty => Width < 0.0; public Size(float width, float height) { if (width < 0f) { throw new ArgumentOutOfRangeException("width", GSR.ArgumentOutOfRange_NeedNonNegNum); } if (height < 0f) { throw new ArgumentOutOfRangeException("height", GSR.ArgumentOutOfRange_NeedNonNegNum); } _width = width; _height = height; } public Size(double width, double height) : this((float)width, (float)height) { } private static Size CreateEmptySize() { return new Size { _width = float.NegativeInfinity, _height = float.NegativeInfinity }; } public static bool operator ==(Size size1, Size size2) { if (size1._width == size2._width) { return size1._height == size2._height; } return false; } public static bool operator !=(Size size1, Size size2) { return !(size1 == size2); } public override bool Equals(object o) { if (o is Size) { return Equals(this, (Size)o); } return false; } public bool Equals(Size value) { return Equals(this, value); } public override int GetHashCode() { if (IsEmpty) { return 0; } return Width.GetHashCode() ^ Height.GetHashCode(); } private static bool Equals(Size size1, Size size2) { if (size1.IsEmpty) { return size2.IsEmpty; } if (size1._width.Equals(size2._width)) { return size1._height.Equals(size2._height); } return false; } public override string ToString() { if (IsEmpty) { return "Empty"; } return $"{_width},{_height}"; } } public static class TokenizerHelper { public static char GetNumericListSeparator(IFormatProvider provider) { char c = ','; NumberFormatInfo instance = NumberFormatInfo.GetInstance(provider); if (instance.NumberDecimalSeparator.Length > 0 && c == instance.NumberDecimalSeparator[0]) { c = ';'; } return c; } } internal enum PropertyType : uint { Empty = 0u, UInt8 = 1u, Int16 = 2u, UInt16 = 3u, Int32 = 4u, UInt32 = 5u, Int64 = 6u, UInt64 = 7u, Single = 8u, Double = 9u, Char16 = 10u, Boolean = 11u, String = 12u, Inspectable = 13u, DateTime = 14u, TimeSpan = 15u, Guid = 16u, Point = 17u, Size = 18u, Rect = 19u, OtherType = 20u, UInt8Array = 1025u, Int16Array = 1026u, UInt16Array = 1027u, Int32Array = 1028u, UInt32Array = 1029u, Int64Array = 1030u, UInt64Array = 1031u, SingleArray = 1032u, DoubleArray = 1033u, Char16Array = 1034u, BooleanArray = 1035u, StringArray = 1036u, InspectableArray = 1037u, DateTimeArray = 1038u, TimeSpanArray = 1039u, GuidArray = 1040u, PointArray = 1041u, SizeArray = 1042u, RectArray = 1043u, OtherTypeArray = 1044u } [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] internal interface IPropertyValue { bool IsNumericScalar { get; } PropertyType Type { get; } byte GetUInt8(); short GetInt16(); ushort GetUInt16(); int GetInt32(); uint GetUInt32(); long GetInt64(); ulong GetUInt64(); float GetSingle(); double GetDouble(); char GetChar16(); bool GetBoolean(); string GetString(); Guid GetGuid(); System.DateTimeOffset GetDateTime(); System.TimeSpan GetTimeSpan(); Point GetPoint(); Size GetSize(); Rect GetRect(); void GetUInt8Array(out byte[] value); void GetInt16Array(out short[] value); void GetUInt16Array(out ushort[] value); void GetInt32Array(out int[] value); void GetUInt32Array(out uint[] value); void GetInt64Array(out long[] value); void GetUInt64Array(out ulong[] value); void GetSingleArray(out float[] value); void GetDoubleArray(out double[] value); void GetChar16Array(out char[] value); void GetBooleanArray(out bool[] value); void GetStringArray(out string[] value); void GetInspectableArray(out object[] value); void GetGuidArray(out Guid[] value); void GetDateTimeArray(out System.DateTimeOffset[] value); void GetTimeSpanArray(out System.TimeSpan[] value); void GetPointArray(out Point[] value); void GetSizeArray(out Size[] value); void GetRectArray(out Rect[] value); } [Guid("61C17707-2D65-11E0-9AE8-D48564015472")] [WindowsRuntimeHelperType(typeof(ABI.Windows.Foundation.IReferenceArray<>))] internal interface IReferenceArray<T> { T[] Value { get; } } } namespace Windows.Foundation.Collections { [Guid("3C2925FE-8519-45C1-AA79-197B6718C1C1")] internal interface IMap<K, V> : IIterable<IKeyValuePair<K, V>> { uint Size { get; } V Lookup(K key); bool HasKey(K key); System.Collections.Generic.IReadOnlyDictionary<K, V> GetView(); bool Insert(K key, V value); void _Remove(K key); void Clear(); } [Guid("FAA585EA-6214-4217-AFDA-7F46DE5869B3")] internal interface IIterable<T> { System.Collections.Generic.IEnumerator<T> First(); } [Guid("6A79E863-4300-459A-9966-CBB660963EE1")] internal interface IIterator<T> { T _Current { get; } bool HasCurrent { get; } bool _MoveNext(); uint GetMany(ref T[] items); } [Guid("913337E9-11A1-4345-A3A2-4E7F956E222D")] internal interface IVector<T> : IIterable<T> { uint Size { get; } T GetAt(uint index); System.Collections.Generic.IReadOnlyList<T> GetView(); bool IndexOf(T value, out uint index); void SetAt(uint index, T value); void InsertAt(uint index, T value); void RemoveAt(uint index); void Append(T value); void RemoveAtEnd(); void _Clear(); uint GetMany(uint startIndex, ref T[] items); void ReplaceAll(T[] items); } [Guid("E480CE40-A338-4ADA-ADCF-272272E48CB9")] internal interface IMapView<K, V> : IIterable<IKeyValuePair<K, V>> { uint Size { get; } V Lookup(K key); bool HasKey(K key); void Split(out IMapView<K, V> first, out IMapView<K, V> second); } [Guid("BBE1FA4C-B0E3-4583-BAEF-1F1B2E483E56")] internal interface IVectorView<T> : IIterable<T> { uint Size { get; } T GetAt(uint index); bool IndexOf(T value, out uint index); uint GetMany(uint startIndex, ref T[] items); } [Guid("02B51929-C1C4-4A7E-8940-0312B5C18500")] internal interface IKeyValuePair<K, V> { K Key { get; } V Value { get; } } } namespace Windows.UI.Xaml { public class LayoutCycleException : System.Exception { public LayoutCycleException() : base("A cycle occurred while laying out the GUI.") { base.HResult = -2144665580; } public LayoutCycleException(string message) : base(message) { base.HResult = -2144665580; } public LayoutCycleException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665580; } } } namespace Windows.UI.Xaml.Markup { public class XamlParseException : System.Exception { public XamlParseException() : base("XAML parsing failed.") { base.HResult = -2144665590; } public XamlParseException(string message) : base(message) { base.HResult = -2144665590; } public XamlParseException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665590; } } } namespace Windows.UI.Xaml.Automation { public class ElementNotAvailableException : System.Exception { public ElementNotAvailableException() : base("The element is not available.") { base.HResult = -2144665569; } public ElementNotAvailableException(string message) : base(message) { base.HResult = -2144665569; } public ElementNotAvailableException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665569; } } public class ElementNotEnabledException : System.Exception { public ElementNotEnabledException() : base("The element is not enabled.") { base.HResult = -2144665570; } public ElementNotEnabledException(string message) : base(message) { base.HResult = -2144665570; } public ElementNotEnabledException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665570; } } } namespace Microsoft.UI.Xaml { public class LayoutCycleException : System.Exception { public LayoutCycleException() : base("A cycle occurred while laying out the GUI.") { base.HResult = -2144665580; } public LayoutCycleException(string message) : base(message) { base.HResult = -2144665580; } public LayoutCycleException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665580; } } } namespace Microsoft.UI.Xaml.Data { [WindowsRuntimeType(null)] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Data.ICustomProperty))] [Guid("30DA92C0-23E8-42A0-AE7C-734A0E5D2782")] internal interface ICustomProperty { bool CanRead { get; } bool CanWrite { get; } string Name { get; } System.Type Type { get; } object GetValue(object target); void SetValue(object target, object value); object GetIndexedValue(object target, object index); void SetIndexedValue(object target, object value, object index); } public interface IBindableCustomPropertyImplementation { BindableCustomProperty GetProperty(string name); BindableCustomProperty GetProperty(System.Type indexParameterType); } [WinRTExposedType(typeof(ManagedCustomPropertyWinRTTypeDetails))] public sealed class BindableCustomProperty : ICustomProperty { private readonly bool _canRead; private readonly bool _canWrite; private readonly string _name; private readonly System.Type _type; private readonly Func<object, object> _getValue; private readonly Action<object, object> _setValue; private readonly Func<object, object, object> _getIndexedValue; private readonly Action<object, object, object> _setIndexedValue; bool ICustomProperty.CanRead => _canRead; bool ICustomProperty.CanWrite => _canWrite; string ICustomProperty.Name => _name; System.Type ICustomProperty.Type => _type; public BindableCustomProperty(bool canRead, bool canWrite, string name, System.Type type, Func<object, object> getValue, Action<object, object> setValue, Func<object, object, object> getIndexedValue, Action<object, object, object> setIndexedValue) { _canRead = canRead; _canWrite = canWrite; _name = name; _type = type; _getValue = getValue; _setValue = setValue; _getIndexedValue = getIndexedValue; _setIndexedValue = setIndexedValue; } object ICustomProperty.GetIndexedValue(object target, object index) { if (_getIndexedValue == null) { throw new NotImplementedException(); } return _getIndexedValue(target, index); } object ICustomProperty.GetValue(object target) { if (_getValue == null) { throw new NotImplementedException(); } return _getValue(target); } void ICustomProperty.SetIndexedValue(object target, object value, object index) { if (_setIndexedValue == null) { throw new NotImplementedException(); } _setIndexedValue(target, value, index); } void ICustomProperty.SetValue(object target, object value) { if (_setValue == null) { throw new NotImplementedException(); } _setValue(target, value); } } } namespace Microsoft.UI.Xaml.Interop { [WindowsRuntimeType(null)] [Guid("036D2C08-DF29-41AF-8AA2-D774BE62BA6F")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableIterable))] internal interface IBindableIterable { IBindableIterator First(); } [WindowsRuntimeType(null)] [Guid("6A1D6C07-076D-49F2-8314-F52C9C9A8331")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableIterator))] internal interface IBindableIterator { object Current { get; } bool HasCurrent { get; } bool MoveNext(); uint GetMany(ref object[] items); } [WindowsRuntimeType(null)] [Guid("393DE7DE-6FD0-4C0D-BB71-47244A113E93")] internal interface IBindableVector : System.Collections.IEnumerable { uint Size { get; } object GetAt(uint index); IBindableVectorView GetView(); bool IndexOf(object value, out uint index); void SetAt(uint index, object value); void InsertAt(uint index, object value); void RemoveAt(uint index); void Append(object value); void RemoveAtEnd(); void Clear(); } [WindowsRuntimeType(null)] [Guid("346DD6E7-976E-4BC3-815D-ECE243BC0F33")] [WindowsRuntimeHelperType(typeof(ABI.Microsoft.UI.Xaml.Interop.IBindableVectorView))] internal interface IBindableVectorView : System.Collections.IEnumerable { uint Size { get; } object GetAt(uint index); bool IndexOf(object value, out uint index); } } namespace Microsoft.UI.Xaml.Markup { public class XamlParseException : System.Exception { public XamlParseException() : base("XAML parsing failed.") { base.HResult = -2144665590; } public XamlParseException(string message) : base(message) { base.HResult = -2144665590; } public XamlParseException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665590; } } } namespace Microsoft.UI.Xaml.Automation { public class ElementNotAvailableException : System.Exception { public ElementNotAvailableException() : base("The element is not available.") { base.HResult = -2144665569; } public ElementNotAvailableException(string message) : base(message) { base.HResult = -2144665569; } public ElementNotAvailableException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665569; } } public class ElementNotEnabledException : System.Exception { public ElementNotEnabledException() : base("The element is not enabled.") { base.HResult = -2144665570; } public ElementNotEnabledException(string message) : base(message) { base.HResult = -2144665570; } public ElementNotEnabledException(string message, System.Exception innerException) : base(message, innerException) { base.HResult = -2144665570; } } } namespace ABI.Windows.Foundation { public static class Point { public static string GetGuidSignature() { return "struct(Windows.Foundation.Point;f4;f4)"; } } public static class Rect { public static string GetGuidSignature() { return "struct(Windows.Foundation.Rect;f4;f4;f4;f4)"; } } public static class Size { public static string GetGuidSignature() { return "struct(Windows.Foundation.Size;f4;f4)"; } } internal static class ManagedIPropertyValueImpl { private const int TYPE_E_TYPEMISMATCH = -2147316576; private const int DISP_E_OVERFLOW = -2147352566; private static IPropertyValue.Vftbl AbiToProjectionVftable; public static IntPtr AbiToProjectionVftablePtr; private static volatile Dictionary<global::System.Type, PropertyType> s_numericScalarTypes; private static Dictionary<global::System.Type, PropertyType> NumericScalarTypes { get { if (s_numericScalarTypes == null) { Dictionary<global::System.Type, PropertyType> dictionary = new Dictionary<global::System.Type, PropertyType>(); dictionary.Add(typeof(byte), PropertyType.UInt8); dictionary.Add(typeof(short), PropertyType.Int16); dictionary.Add(typeof(ushort), PropertyType.UInt16); dictionary.Add(typeof(int), PropertyType.Int32); dictionary.Add(typeof(uint), PropertyType.UInt32); dictionary.Add(typeof(long), PropertyType.Int64); dictionary.Add(typeof(ulong), PropertyType.UInt64); dictionary.Add(typeof(float), PropertyType.Single); dictionary.Add(typeof(double), PropertyType.Double); Dictionary<global::System.Type, PropertyType> dictionary2 = dictionary; s_numericScalarTypes = dictionary2; } return s_numericScalarTypes; } } unsafe static ManagedIPropertyValueImpl() { AbiToProjectionVftable = new IPropertyValue.Vftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _get_Type_0 = (delegate*<IntPtr, PropertyType*, int>)(&Do_Abi_get_Type_0), _get_IsNumericScalar_1 = (delegate*<IntPtr, byte*, int>)(&Do_Abi_get_IsNumericScalar_1), _GetUInt8_2 = (delegate*<IntPtr, byte*, int>)(&Do_Abi_GetUInt8_2), _GetInt16_3 = (delegate*<IntPtr, short*, int>)(&Do_Abi_GetInt16_3), _GetUInt16_4 = (delegate*<IntPtr, ushort*, int>)(&Do_Abi_GetUInt16_4), _GetInt32_5 = (delegate*<IntPtr, int*, int>)(&Do_Abi_GetInt32_5), _GetUInt32_6 = (delegate*<IntPtr, uint*, int>)(&Do_Abi_GetUInt32_6), _GetInt64_7 = (delegate*<IntPtr, long*, int>)(&Do_Abi_GetInt64_7), _GetUInt64_8 = (delegate*<IntPtr, ulong*, int>)(&Do_Abi_GetUInt64_8), _GetSingle_9 = (delegate*<IntPtr, float*, int>)(&Do_Abi_GetSingle_9), _GetDouble_10 = (delegate*<IntPtr, double*, int>)(&Do_Abi_GetDouble_10), _GetChar16_11 = (delegate*<IntPtr, ushort*, int>)(&Do_Abi_GetChar16_11), _GetBoolean_12 = (delegate*<IntPtr, byte*, int>)(&Do_Abi_GetBoolean_12), _GetString_13 = (delegate*<IntPtr, IntPtr*, int>)(&Do_Abi_GetString_13), _GetGuid_14 = (delegate*<IntPtr, Guid*, int>)(&Do_Abi_GetGuid_14), _GetDateTime_15 = (delegate*<IntPtr, ABI.System.DateTimeOffset*, int>)(&Do_Abi_GetDateTime_15), _GetTimeSpan_16 = (delegate*<IntPtr, ABI.System.TimeSpan*, int>)(&Do_Abi_GetTimeSpan_16), _GetPoint_17 = (delegate*<IntPtr, global::Windows.Foundation.Point*, int>)(&Do_Abi_GetPoint_17), _GetSize_18 = (delegate*<IntPtr, global::Windows.Foundation.Size*, int>)(&Do_Abi_GetSize_18), _GetRect_19 = (delegate*<IntPtr, global::Windows.Foundation.Rect*, int>)(&Do_Abi_GetRect_19), _GetUInt8Array_20 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetUInt8Array_20), _GetInt16Array_21 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetInt16Array_21), _GetUInt16Array_22 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetUInt16Array_22), _GetInt32Array_23 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetInt32Array_23), _GetUInt32Array_24 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetUInt32Array_24), _GetInt64Array_25 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetInt64Array_25), _GetUInt64Array_26 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetUInt64Array_26), _GetSingleArray_27 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetSingleArray_27), _GetDoubleArray_28 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetDoubleArray_28), _GetChar16Array_29 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetChar16Array_29), _GetBooleanArray_30 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetBooleanArray_30), _GetStringArray_31 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetStringArray_31), _GetInspectableArray_32 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetInspectableArray_32), _GetGuidArray_33 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetGuidArray_33), _GetDateTimeArray_34 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetDateTimeArray_34), _GetTimeSpanArray_35 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetTimeSpanArray_35), _GetPointArray_36 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetPointArray_36), _GetSizeArray_37 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetSizeArray_37), _GetRectArray_38 = (delegate*<IntPtr, int*, IntPtr*, int>)(&Do_Abi_GetRectArray_38) }; IntPtr* ptr = (IntPtr*)(void*)ComWrappersSupport.AllocateVtableMemory(typeof(ManagedIPropertyValueImpl), sizeof(IInspectable.Vftbl) + sizeof(IntPtr) * 39); *(IPropertyValue.Vftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (IntPtr)ptr; } private static T UnboxValue<T>(object value) where T : struct { if (value.GetType() == typeof(T)) { return (T)value; } throw new InvalidCastException("", -2147316576); } private static T[] UnboxArray<T>(object value) where T : struct { if (!(value is Array array)) { throw new InvalidCastException(); } T[] array2 = new T[array.Length]; for (int i = 0; i < array.Length; i++) { try { array2[i] = UnboxValue<T>(array.GetValue(i)); } catch (InvalidCastException ex) { global::System.Exception ex2 = new InvalidCastException("", ex.HResult); throw ex2; } } return array2; } private static bool IsCoercable(object value) { if (value.GetType() == typeof(string) || value.GetType() == typeof(Guid) || value.GetType() != typeof(object)) { return true; } PropertyType value2; return NumericScalarTypes.TryGetValue(value.GetType(), out value2); } private static T CoerceValue<T>(object value) { if (value is T) { return (T)value; } if (value is global::Windows.Foundation.IPropertyValue propertyValue) { if (typeof(T) == typeof(byte)) { return (T)(object)propertyValue.GetUInt8(); } if (typeof(T) == typeof(short)) { return (T)(object)propertyValue.GetInt16(); } if (typeof(T) == typeof(ushort)) { return (T)(object)propertyValue.GetUInt16(); } if (typeof(T) == typeof(int)) { return (T)(object)propertyValue.GetInt32(); } if (typeof(T) == typeof(uint)) { return (T)(object)propertyValue.GetUInt32(); } if (typeof(T) == typeof(long)) { return (T)(object)propertyValue.GetInt64(); } if (typeof(T) == typeof(ulong)) { return (T)(object)propertyValue.GetUInt64(); } if (typeof(T) == typeof(float)) { return (T)(object)propertyValue.GetSingle(); } if (typeof(T) == typeof(double)) { return (T)(object)propertyValue.GetDouble(); } } if (!IsCoercable(value)) { throw new InvalidCastException(); } try { if (value is string input && typeof(T) == typeof(Guid)) { return (T)(object)Guid.Parse(input); } if (value is Guid guid && typeof(T) == typeof(string)) { return (T)(object)guid.ToString("D", CultureInfo.InvariantCulture); } if (typeof(T) == typeof(byte)) { return (T)(object)Convert.ToByte(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(short)) { return (T)(object)Convert.ToInt16(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(ushort)) { return (T)(object)Convert.ToUInt16(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(int)) { return (T)(object)Convert.ToInt32(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(uint)) { return (T)(object)Convert.ToUInt32(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(long)) { return (T)(object)Convert.ToInt64(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(ulong)) { return (T)(object)Convert.ToUInt64(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(float)) { return (T)(object)Convert.ToSingle(value, CultureInfo.InvariantCulture); } if (typeof(T) == typeof(double)) { return (T)(object)Convert.ToDouble(value, CultureInfo.InvariantCulture); } throw new InvalidCastException("", -2147316576); } catch (FormatException) { throw new InvalidCastException("", -2147316576); } catch (InvalidCastException) { throw new InvalidCastException("", -2147316576); } catch (OverflowException) { throw new InvalidCastException("", -2147352566); } } private static T[] CoerceArray<T>(object value) { if (value is T[] result) { return result; } if (!(value is Array array)) { throw new InvalidCastException(); } T[] array2 = new T[array.Length]; for (int i = 0; i < array.Length; i++) { try { array2[i] = CoerceValue<T>(array.GetValue(i)); } catch (InvalidCastException ex) { global::System.Exception ex2 = new InvalidCastException("", ex.HResult); throw ex2; } } return array2; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt8_2(IntPtr thisPtr, byte* value) { try { *value = CoerceValue<byte>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt16_3(IntPtr thisPtr, short* value) { try { *value = CoerceValue<short>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt16_4(IntPtr thisPtr, ushort* value) { try { *value = CoerceValue<ushort>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt32_5(IntPtr thisPtr, int* value) { try { *value = CoerceValue<int>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt32_6(IntPtr thisPtr, uint* value) { try { *value = CoerceValue<uint>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt64_7(IntPtr thisPtr, long* value) { try { *value = CoerceValue<long>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt64_8(IntPtr thisPtr, ulong* value) { try { *value = CoerceValue<ulong>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSingle_9(IntPtr thisPtr, float* value) { try { *value = CoerceValue<float>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDouble_10(IntPtr thisPtr, double* value) { try { *value = CoerceValue<double>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetChar16_11(IntPtr thisPtr, ushort* value) { try { *value = CoerceValue<char>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetBoolean_12(IntPtr thisPtr, byte* value) { try { *value = (CoerceValue<bool>(ComWrappersSupport.FindObject<object>(thisPtr)) ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetString_13(IntPtr thisPtr, IntPtr* value) { try { *value = MarshalString.FromManaged(CoerceValue<string>(ComWrappersSupport.FindObject<object>(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetGuid_14(IntPtr thisPtr, Guid* value) { try { *value = CoerceValue<Guid>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDateTime_15(IntPtr thisPtr, ABI.System.DateTimeOffset* value) { try { *value = ABI.System.DateTimeOffset.FromManaged(CoerceValue<global::System.DateTimeOffset>(ComWrappersSupport.FindObject<object>(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetTimeSpan_16(IntPtr thisPtr, ABI.System.TimeSpan* value) { try { *value = ABI.System.TimeSpan.FromManaged(CoerceValue<global::System.TimeSpan>(ComWrappersSupport.FindObject<object>(thisPtr))); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetPoint_17(IntPtr thisPtr, global::Windows.Foundation.Point* value) { try { *value = UnboxValue<global::Windows.Foundation.Point>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSize_18(IntPtr thisPtr, global::Windows.Foundation.Size* value) { try { *value = UnboxValue<global::Windows.Foundation.Size>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetRect_19(IntPtr thisPtr, global::Windows.Foundation.Rect* value) { try { *value = UnboxValue<global::Windows.Foundation.Rect>(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt8Array_20(IntPtr thisPtr, int* __valueSize, IntPtr* value) { byte[] array = null; try { array = CoerceArray<byte>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<byte>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt16Array_21(IntPtr thisPtr, int* __valueSize, IntPtr* value) { short[] array = null; try { array = CoerceArray<short>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<short>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt16Array_22(IntPtr thisPtr, int* __valueSize, IntPtr* value) { ushort[] array = null; try { array = CoerceArray<ushort>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<ushort>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt32Array_23(IntPtr thisPtr, int* __valueSize, IntPtr* value) { int[] array = null; try { array = CoerceArray<int>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<int>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt32Array_24(IntPtr thisPtr, int* __valueSize, IntPtr* value) { uint[] array = null; try { array = CoerceArray<uint>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<uint>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInt64Array_25(IntPtr thisPtr, int* __valueSize, IntPtr* value) { long[] array = null; try { array = CoerceArray<long>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<long>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetUInt64Array_26(IntPtr thisPtr, int* __valueSize, IntPtr* value) { ulong[] array = null; try { array = CoerceArray<ulong>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<ulong>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSingleArray_27(IntPtr thisPtr, int* __valueSize, IntPtr* value) { float[] array = null; try { array = CoerceArray<float>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<float>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDoubleArray_28(IntPtr thisPtr, int* __valueSize, IntPtr* value) { double[] array = null; try { array = CoerceArray<double>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<double>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetChar16Array_29(IntPtr thisPtr, int* __valueSize, IntPtr* value) { char[] array = null; try { array = CoerceArray<char>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalNonBlittable<char>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetBooleanArray_30(IntPtr thisPtr, int* __valueSize, IntPtr* value) { bool[] array = null; try { array = CoerceArray<bool>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalNonBlittable<bool>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetStringArray_31(IntPtr thisPtr, int* __valueSize, IntPtr* value) { string[] array = null; try { array = CoerceArray<string>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalString.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetInspectableArray_32(IntPtr thisPtr, int* __valueSize, IntPtr* value) { object[] array = null; try { array = CoerceArray<object>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalInspectable<object>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetGuidArray_33(IntPtr thisPtr, int* __valueSize, IntPtr* value) { Guid[] array = null; try { array = CoerceArray<Guid>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<Guid>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetDateTimeArray_34(IntPtr thisPtr, int* __valueSize, IntPtr* value) { global::System.DateTimeOffset[] array = null; try { array = CoerceArray<global::System.DateTimeOffset>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalNonBlittable<global::System.DateTimeOffset>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetTimeSpanArray_35(IntPtr thisPtr, int* __valueSize, IntPtr* value) { global::System.TimeSpan[] array = null; try { array = CoerceArray<global::System.TimeSpan>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalNonBlittable<global::System.TimeSpan>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetPointArray_36(IntPtr thisPtr, int* __valueSize, IntPtr* value) { global::Windows.Foundation.Point[] array = null; try { array = UnboxArray<global::Windows.Foundation.Point>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<global::Windows.Foundation.Point>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetSizeArray_37(IntPtr thisPtr, int* __valueSize, IntPtr* value) { global::Windows.Foundation.Size[] array = null; try { array = UnboxArray<global::Windows.Foundation.Size>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<global::Windows.Foundation.Size>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_GetRectArray_38(IntPtr thisPtr, int* __valueSize, IntPtr* value) { global::Windows.Foundation.Rect[] array = null; try { array = UnboxArray<global::Windows.Foundation.Rect>(ComWrappersSupport.FindObject<object>(thisPtr)); ref IntPtr reference = ref *value; (int, IntPtr) tuple = MarshalBlittable<global::Windows.Foundation.Rect>.FromManagedArray(array); *__valueSize = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_IsNumericScalar_1(IntPtr thisPtr, byte* value) { try { *value = (NumericScalarTypes.TryGetValue(ComWrappersSupport.FindObject<object>(thisPtr).GetType(), out var _) ? ((byte)1) : ((byte)0)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_get_Type_0(IntPtr thisPtr, PropertyType* value) { try { *value = GetPropertyTypeOfObject(ComWrappersSupport.FindObject<object>(thisPtr)); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } private static PropertyType GetPropertyTypeOfObject(object obj) { global::System.Type type = obj.GetType(); bool isArray = type.IsArray; if (isArray) { type = type.GetElementType(); } if (!NumericScalarTypes.TryGetValue(type, out var value)) { value = ((type == typeof(string)) ? PropertyType.String : ((type == typeof(char)) ? PropertyType.Char16 : ((type == typeof(bool)) ? PropertyType.Boolean : ((type == typeof(global::System.DateTimeOffset)) ? PropertyType.DateTime : ((type == typeof(global::System.TimeSpan)) ? PropertyType.TimeSpan : ((type == typeof(Guid)) ? PropertyType.Guid : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Point") == 0) ? PropertyType.Point : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Rect") == 0) ? PropertyType.Rect : ((string.CompareOrdinal(type.FullName, "Windows.Foundation.Size") == 0) ? PropertyType.Size : ((type == typeof(object)) ? PropertyType.Inspectable : (typeof(Delegate).IsAssignableFrom(type) ? PropertyType.OtherType : ((!(!type.IsValueType && type != typeof(global::System.Type) && isArray)) ? PropertyType.OtherType : PropertyType.Inspectable)))))))))))); } if (isArray) { value += 1024; } return value; } } [DynamicInterfaceCastableImplementation] [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] internal interface IPropertyValue : global::Windows.Foundation.IPropertyValue { [Guid("4BD682DD-7554-40E9-9A9B-82654EDE7E62")] public struct Vftbl { internal IInspectable.Vftbl IInspectableVftbl; internal unsafe void* _get_Type_0; public unsafe void* _get_IsNumericScalar_1; internal unsafe void* _GetUInt8_2; internal unsafe void* _GetInt16_3; internal unsafe void* _GetUInt16_4; internal unsafe void* _GetInt32_5; internal unsafe void* _GetUInt32_6; internal unsafe void* _GetInt64_7; internal unsafe void* _GetUInt64_8; internal unsafe void* _GetSingle_9; internal unsafe void* _GetDouble_10; internal unsafe void* _GetChar16_11; internal unsafe void* _GetBoolean_12; internal unsafe void* _GetString_13; internal unsafe void* _GetGuid_14; internal unsafe void* _GetDateTime_15; internal unsafe void* _GetTimeSpan_16; internal unsafe void* _GetPoint_17; internal unsafe void* _GetSize_18; internal unsafe void* _GetRect_19; internal unsafe void* _GetUInt8Array_20; internal unsafe void* _GetInt16Array_21; internal unsafe void* _GetUInt16Array_22; internal unsafe void* _GetInt32Array_23; internal unsafe void* _GetUInt32Array_24; internal unsafe void* _GetInt64Array_25; internal unsafe void* _GetUInt64Array_26; internal unsafe void* _GetSingleArray_27; internal unsafe void* _GetDoubleArray_28; internal unsafe void* _GetChar16Array_29; internal unsafe void* _GetBooleanArray_30; internal unsafe void* _GetStringArray_31; internal unsafe void* _GetInspectableArray_32; internal unsafe void* _GetGuidArray_33; internal unsafe void* _GetDateTimeArray_34; internal unsafe void* _GetTimeSpanArray_35; internal unsafe void* _GetPointArray_36; internal unsafe void* _GetSizeArray_37; internal unsafe void* _GetRectArray_38; public unsafe delegate* unmanaged[Stdcall]<IntPtr, PropertyType*, int> get_Type_0 { get { return (delegate* unmanaged[Stdcall]<IntPtr, PropertyType*, int>)_get_Type_0; } set { _get_Type_0 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, byte*, int> get_IsNumericScalar_1 { get { return (delegate* unmanaged[Stdcall]<IntPtr, byte*, int>)_get_IsNumericScalar_1; } set { _get_IsNumericScalar_1 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, byte*, int> GetUInt8_2 { get { return (delegate* unmanaged[Stdcall]<IntPtr, byte*, int>)_GetUInt8_2; } set { _GetUInt8_2 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, short*, int> GetInt16_3 { get { return (delegate* unmanaged[Stdcall]<IntPtr, short*, int>)_GetInt16_3; } set { _GetInt16_3 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, ushort*, int> GetUInt16_4 { get { return (delegate* unmanaged[Stdcall]<IntPtr, ushort*, int>)_GetUInt16_4; } set { _GetUInt16_4 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, int> GetInt32_5 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, int>)_GetInt32_5; } set { _GetInt32_5 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, uint*, int> GetUInt32_6 { get { return (delegate* unmanaged[Stdcall]<IntPtr, uint*, int>)_GetUInt32_6; } set { _GetUInt32_6 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, long*, int> GetInt64_7 { get { return (delegate* unmanaged[Stdcall]<IntPtr, long*, int>)_GetInt64_7; } set { _GetInt64_7 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, ulong*, int> GetUInt64_8 { get { return (delegate* unmanaged[Stdcall]<IntPtr, ulong*, int>)_GetUInt64_8; } set { _GetUInt64_8 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, float*, int> GetSingle_9 { get { return (delegate* unmanaged[Stdcall]<IntPtr, float*, int>)_GetSingle_9; } set { _GetSingle_9 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, double*, int> GetDouble_10 { get { return (delegate* unmanaged[Stdcall]<IntPtr, double*, int>)_GetDouble_10; } set { _GetDouble_10 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, ushort*, int> GetChar16_11 { get { return (delegate* unmanaged[Stdcall]<IntPtr, ushort*, int>)_GetChar16_11; } set { _GetChar16_11 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, byte*, int> GetBoolean_12 { get { return (delegate* unmanaged[Stdcall]<IntPtr, byte*, int>)_GetBoolean_12; } set { _GetBoolean_12 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> GetString_13 { get { return (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_GetString_13; } set { _GetString_13 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, Guid*, int> GetGuid_14 { get { return (delegate* unmanaged[Stdcall]<IntPtr, Guid*, int>)_GetGuid_14; } set { _GetGuid_14 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, ABI.System.DateTimeOffset*, int> GetDateTime_15 { get { return (delegate* unmanaged[Stdcall]<IntPtr, ABI.System.DateTimeOffset*, int>)_GetDateTime_15; } set { _GetDateTime_15 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, ABI.System.TimeSpan*, int> GetTimeSpan_16 { get { return (delegate* unmanaged[Stdcall]<IntPtr, ABI.System.TimeSpan*, int>)_GetTimeSpan_16; } set { _GetTimeSpan_16 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Point*, int> GetPoint_17 { get { return (delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Point*, int>)_GetPoint_17; } set { _GetPoint_17 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Size*, int> GetSize_18 { get { return (delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Size*, int>)_GetSize_18; } set { _GetSize_18 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Rect*, int> GetRect_19 { get { return (delegate* unmanaged[Stdcall]<IntPtr, global::Windows.Foundation.Rect*, int>)_GetRect_19; } set { _GetRect_19 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetUInt8Array_20 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetUInt8Array_20; } set { _GetUInt8Array_20 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetInt16Array_21 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetInt16Array_21; } set { _GetInt16Array_21 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetUInt16Array_22 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetUInt16Array_22; } set { _GetUInt16Array_22 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetInt32Array_23 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetInt32Array_23; } set { _GetInt32Array_23 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetUInt32Array_24 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetUInt32Array_24; } set { _GetUInt32Array_24 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetInt64Array_25 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetInt64Array_25; } set { _GetInt64Array_25 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetUInt64Array_26 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetUInt64Array_26; } set { _GetUInt64Array_26 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetSingleArray_27 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetSingleArray_27; } set { _GetSingleArray_27 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetDoubleArray_28 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetDoubleArray_28; } set { _GetDoubleArray_28 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetChar16Array_29 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetChar16Array_29; } set { _GetChar16Array_29 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetBooleanArray_30 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetBooleanArray_30; } set { _GetBooleanArray_30 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetStringArray_31 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetStringArray_31; } set { _GetStringArray_31 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetInspectableArray_32 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetInspectableArray_32; } set { _GetInspectableArray_32 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetGuidArray_33 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetGuidArray_33; } set { _GetGuidArray_33 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetDateTimeArray_34 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetDateTimeArray_34; } set { _GetDateTimeArray_34 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetTimeSpanArray_35 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetTimeSpanArray_35; } set { _GetTimeSpanArray_35 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetPointArray_36 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetPointArray_36; } set { _GetPointArray_36 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetSizeArray_37 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetSizeArray_37; } set { _GetSizeArray_37 = value; } } public unsafe delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int> GetRectArray_38 { get { return (delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)_GetRectArray_38; } set { _GetRectArray_38 = value; } } } unsafe bool global::Windows.Foundation.IPropertyValue.IsNumericScalar { get { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.get_IsNumericScalar_1(thisPtr, &b)); GC.KeepAlive(objectReference); return b != 0; } } unsafe PropertyType global::Windows.Foundation.IPropertyValue.Type { get { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; PropertyType result = PropertyType.Empty; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.get_Type_0(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } } unsafe byte global::Windows.Foundation.IPropertyValue.GetUInt8() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; byte result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt8_2(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe short global::Windows.Foundation.IPropertyValue.GetInt16() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; short result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt16_3(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe ushort global::Windows.Foundation.IPropertyValue.GetUInt16() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; ushort result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt16_4(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe int global::Windows.Foundation.IPropertyValue.GetInt32() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt32_5(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe uint global::Windows.Foundation.IPropertyValue.GetUInt32() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; uint result = 0u; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt32_6(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe long global::Windows.Foundation.IPropertyValue.GetInt64() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; long result = 0L; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt64_7(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe ulong global::Windows.Foundation.IPropertyValue.GetUInt64() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; ulong result = 0uL; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt64_8(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe float global::Windows.Foundation.IPropertyValue.GetSingle() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; float result = 0f; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSingle_9(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe double global::Windows.Foundation.IPropertyValue.GetDouble() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; double result = 0.0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDouble_10(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe char global::Windows.Foundation.IPropertyValue.GetChar16() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; ushort result = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetChar16_11(thisPtr, &result)); GC.KeepAlive(objectReference); return (char)result; } unsafe bool global::Windows.Foundation.IPropertyValue.GetBoolean() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; byte b = 0; ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetBoolean_12(thisPtr, &b)); GC.KeepAlive(objectReference); return b != 0; } unsafe string global::Windows.Foundation.IPropertyValue.GetString() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; IntPtr intPtr = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetString_13(thisPtr, &intPtr)); GC.KeepAlive(objectReference); return MarshalString.FromAbi(intPtr); } finally { MarshalString.DisposeAbi(intPtr); } } unsafe Guid global::Windows.Foundation.IPropertyValue.GetGuid() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; Guid result = default(Guid); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetGuid_14(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe global::System.DateTimeOffset global::Windows.Foundation.IPropertyValue.GetDateTime() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; ABI.System.DateTimeOffset dateTimeOffset = default(ABI.System.DateTimeOffset); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDateTime_15(thisPtr, &dateTimeOffset)); GC.KeepAlive(objectReference); return ABI.System.DateTimeOffset.FromAbi(dateTimeOffset); } finally { ABI.System.DateTimeOffset.DisposeAbi(dateTimeOffset); } } unsafe global::System.TimeSpan global::Windows.Foundation.IPropertyValue.GetTimeSpan() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; ABI.System.TimeSpan timeSpan = default(ABI.System.TimeSpan); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetTimeSpan_16(thisPtr, &timeSpan)); GC.KeepAlive(objectReference); return ABI.System.TimeSpan.FromAbi(timeSpan); } finally { ABI.System.TimeSpan.DisposeAbi(timeSpan); } } unsafe global::Windows.Foundation.Point global::Windows.Foundation.IPropertyValue.GetPoint() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Point result = default(global::Windows.Foundation.Point); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetPoint_17(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe global::Windows.Foundation.Size global::Windows.Foundation.IPropertyValue.GetSize() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Size result = default(global::Windows.Foundation.Size); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSize_18(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe global::Windows.Foundation.Rect global::Windows.Foundation.IPropertyValue.GetRect() { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; global::Windows.Foundation.Rect result = default(global::Windows.Foundation.Rect); ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetRect_19(thisPtr, &result)); GC.KeepAlive(objectReference); return result; } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt8Array(out byte[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt8Array_20(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<byte>.FromAbiArray((item, item2)); } finally { MarshalBlittable<byte>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt16Array(out short[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt16Array_21(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<short>.FromAbiArray((item, item2)); } finally { MarshalBlittable<short>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt16Array(out ushort[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt16Array_22(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<ushort>.FromAbiArray((item, item2)); } finally { MarshalBlittable<ushort>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt32Array(out int[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt32Array_23(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<int>.FromAbiArray((item, item2)); } finally { MarshalBlittable<int>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt32Array(out uint[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt32Array_24(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<uint>.FromAbiArray((item, item2)); } finally { MarshalBlittable<uint>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInt64Array(out long[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInt64Array_25(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<long>.FromAbiArray((item, item2)); } finally { MarshalBlittable<long>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetUInt64Array(out ulong[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetUInt64Array_26(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<ulong>.FromAbiArray((item, item2)); } finally { MarshalBlittable<ulong>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetSingleArray(out float[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSingleArray_27(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<float>.FromAbiArray((item, item2)); } finally { MarshalBlittable<float>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetDoubleArray(out double[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDoubleArray_28(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<double>.FromAbiArray((item, item2)); } finally { MarshalBlittable<double>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetChar16Array(out char[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetChar16Array_29(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalNonBlittable<char>.FromAbiArray((item, item2)); } finally { MarshalNonBlittable<char>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetBooleanArray(out bool[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetBooleanArray_30(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalNonBlittable<bool>.FromAbiArray((item, item2)); } finally { MarshalNonBlittable<bool>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetStringArray(out string[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetStringArray_31(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalString.FromAbiArray((item, item2)); } finally { MarshalString.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetInspectableArray(out object[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetInspectableArray_32(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalInspectable<object>.FromAbiArray((item, item2)); } finally { MarshalInspectable<object>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetGuidArray(out Guid[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetGuidArray_33(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<Guid>.FromAbiArray((item, item2)); } finally { MarshalBlittable<Guid>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetDateTimeArray(out global::System.DateTimeOffset[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetDateTimeArray_34(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalNonBlittable<global::System.DateTimeOffset>.FromAbiArray((item, item2)); } finally { MarshalNonBlittable<global::System.DateTimeOffset>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetTimeSpanArray(out global::System.TimeSpan[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetTimeSpanArray_35(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalNonBlittable<global::System.TimeSpan>.FromAbiArray((item, item2)); } finally { MarshalNonBlittable<global::System.TimeSpan>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetPointArray(out global::Windows.Foundation.Point[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetPointArray_36(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<global::Windows.Foundation.Point>.FromAbiArray((item, item2)); } finally { MarshalBlittable<global::Windows.Foundation.Point>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetSizeArray(out global::Windows.Foundation.Size[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetSizeArray_37(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<global::Windows.Foundation.Size>.FromAbiArray((item, item2)); } finally { MarshalBlittable<global::Windows.Foundation.Size>.DisposeAbiArray((item, item2)); } } unsafe void global::Windows.Foundation.IPropertyValue.GetRectArray(out global::Windows.Foundation.Rect[] value) { ObjectReference<Vftbl> objectReference = (ObjectReference<Vftbl>)((IWinRTObject)this).GetObjectReferenceForType(typeof(global::Windows.Foundation.IPropertyValue).TypeHandle); IntPtr thisPtr = objectReference.ThisPtr; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(objectReference.Vftbl.GetRectArray_38(thisPtr, &item, &item2)); GC.KeepAlive(objectReference); value = MarshalBlittable<global::Windows.Foundation.Rect>.FromAbiArray((item, item2)); } finally { MarshalBlittable<global::Windows.Foundation.Rect>.DisposeAbiArray((item, item2)); } } } internal static class IPropertyValue_Delegates { public unsafe delegate int get_Type_0(IntPtr thisPtr, PropertyType* value); public unsafe delegate int get_IsNumericScalar_1(IntPtr thisPtr, byte* value); public unsafe delegate int GetUInt8_2(IntPtr thisPtr, byte* value); public unsafe delegate int GetInt16_3(IntPtr thisPtr, short* value); public unsafe delegate int GetUInt16_4(IntPtr thisPtr, ushort* value); public unsafe delegate int GetInt32_5(IntPtr thisPtr, int* value); public unsafe delegate int GetUInt32_6(IntPtr thisPtr, uint* value); public unsafe delegate int GetInt64_7(IntPtr thisPtr, long* value); public unsafe delegate int GetUInt64_8(IntPtr thisPtr, ulong* value); public unsafe delegate int GetSingle_9(IntPtr thisPtr, float* value); public unsafe delegate int GetDouble_10(IntPtr thisPtr, double* value); public unsafe delegate int GetChar16_11(IntPtr thisPtr, ushort* value); public unsafe delegate int GetBoolean_12(IntPtr thisPtr, byte* value); public unsafe delegate int GetString_13(IntPtr thisPtr, IntPtr* value); public unsafe delegate int GetGuid_14(IntPtr thisPtr, Guid* value); public unsafe delegate int GetDateTime_15(IntPtr thisPtr, ABI.System.DateTimeOffset* value); public unsafe delegate int GetTimeSpan_16(IntPtr thisPtr, ABI.System.TimeSpan* value); public unsafe delegate int GetPoint_17(IntPtr thisPtr, global::Windows.Foundation.Point* value); public unsafe delegate int GetSize_18(IntPtr thisPtr, global::Windows.Foundation.Size* value); public unsafe delegate int GetRect_19(IntPtr thisPtr, global::Windows.Foundation.Rect* value); public unsafe delegate int GetUInt8Array_20(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetInt16Array_21(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetUInt16Array_22(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetInt32Array_23(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetUInt32Array_24(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetInt64Array_25(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetUInt64Array_26(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetSingleArray_27(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetDoubleArray_28(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetChar16Array_29(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetBooleanArray_30(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetStringArray_31(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetInspectableArray_32(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetGuidArray_33(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetDateTimeArray_34(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetTimeSpanArray_35(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetPointArray_36(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetSizeArray_37(IntPtr thisPtr, int* __valueSize, IntPtr* value); public unsafe delegate int GetRectArray_38(IntPtr thisPtr, int* __valueSize, IntPtr* value); } internal static class BoxedArrayIReferenceArrayImpl<T> { public static readonly IntPtr AbiToProjectionVftablePtr; private static readonly IReferenceArray_Delegates.get_Value_0 DelegateCache; unsafe static BoxedArrayIReferenceArrayImpl() { DelegateCache = Do_Abi_get_Value_0; AbiToProjectionVftablePtr = ComWrappersSupport.AllocateVtableMemory(typeof(BoxedArrayIReferenceArrayImpl<T>), sizeof(IInspectable.Vftbl) + sizeof(IntPtr)); *(IInspectable.Vftbl*)(void*)AbiToProjectionVftablePtr = IInspectable.Vftbl.AbiToProjectionVftable; ((IntPtr*)(void*)AbiToProjectionVftablePtr)[6] = Marshal.GetFunctionPointerForDelegate(DelegateCache); } private unsafe static int Do_Abi_get_Value_0(IntPtr thisPtr, int* ____return_value__Size, IntPtr* __return_value__) { T[] array = null; *__return_value__ = default(IntPtr); *____return_value__Size = 0; try { array = (T[])ComWrappersSupport.FindObject<object>(thisPtr); ref IntPtr reference = ref *__return_value__; (int, IntPtr) tuple = Marshaler<T>.FromManagedArray(array); *____return_value__Size = tuple.Item1; reference = tuple.Item2; } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } [Guid("61C17707-2D65-11E0-9AE8-D48564015472")] internal sealed class IReferenceArray<T> : global::Windows.Foundation.IReferenceArray<T> { public static readonly Guid PIID = GuidGenerator.CreateIIDUnsafe(typeof(IReferenceArray<T>)); private readonly ObjectReference<IUnknownVftbl> _obj; public IntPtr ThisPtr => _obj.ThisPtr; public unsafe T[] Value { get { int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)(*(IntPtr*)((nint)(*(IntPtr*)(void*)ThisPtr) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>))))(ThisPtr, &item, &item2)); GC.KeepAlive(_obj); return Marshaler<T>.FromAbiArray((item, item2)); } finally { Marshaler<T>.DisposeAbiArray((item, item2)); } } } public static IObjectReference CreateMarshaler(object value) { if (value != null) { return ComWrappersSupport.CreateCCWForObject<IUnknownVftbl>(value, PIID); } return null; } public static ObjectReferenceValue CreateMarshaler2(object value) { return ComWrappersSupport.CreateCCWForObjectForMarshaling(value, PIID); } public static IntPtr GetAbi(IObjectReference m) { return m?.ThisPtr ?? IntPtr.Zero; } public static object FromAbi(IntPtr ptr) { if (ptr == IntPtr.Zero) { return null; } IReferenceArray<T> referenceArray = new IReferenceArray<T>(ObjectReference<IUnknownVftbl>.FromAbi(ptr, PIID)); return referenceArray.Value; } public unsafe static object GetValue(IInspectable inspectable) { IntPtr ppv = IntPtr.Zero; int item = 0; IntPtr item2 = default(IntPtr); try { ExceptionHelpers.ThrowExceptionForHR(Marshal.QueryInterface(inspectable.ThisPtr, in Unsafe.AsRef(in PIID), out ppv)); GC.KeepAlive(inspectable); ExceptionHelpers.ThrowExceptionForHR(((delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>)(*(IntPtr*)((nint)(*(IntPtr*)(void*)ppv) + (nint)6 * (nint)sizeof(delegate* unmanaged[Stdcall]<IntPtr, int*, IntPtr*, int>))))(ppv, &item, &item2)); return Marshaler<T>.FromAbiArray((item, item2)); } finally { Marshaler<T>.DisposeAbiArray((item, item2)); MarshalExtensions.ReleaseIfNotNull(ppv); } } public unsafe static void CopyManaged(object o, IntPtr dest) { *(IntPtr*)dest.ToPointer() = CreateMarshaler2(o).Detach(); } public static IntPtr FromManaged(object value) { if (value == null) { return IntPtr.Zero; } return CreateMarshaler2(value).Detach(); } public static void DisposeMarshaler(IObjectReference m) { m?.Dispose(); } public static void DisposeAbi(IntPtr abi) { MarshalInspectable<object>.DisposeAbi(abi); } public static string GetGuidSignature() { return GuidGenerator.GetSignature(typeof(IReferenceArray<T>)); } public IReferenceArray(ObjectReference<IUnknownVftbl> obj) { _obj = obj; } } internal static class IReferenceArray_Delegates { public unsafe delegate int get_Value_0(IntPtr thisPtr, int* ____return_value__Size, IntPtr* __return_value__); } [Guid("96369F54-8EB6-48F0-ABCE-C1B211E627C3")] internal struct ManagedIStringableVftbl { internal IInspectable.Vftbl IInspectableVftbl; private unsafe void* _ToString_0; private static readonly ManagedIStringableVftbl AbiToProjectionVftable; public static readonly IntPtr AbiToProjectionVftablePtr; private unsafe delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int> ToString_0 { get { return (delegate* unmanaged[Stdcall]<IntPtr, IntPtr*, int>)_ToString_0; } set { _ToString_0 = value; } } unsafe static ManagedIStringableVftbl() { AbiToProjectionVftable = new ManagedIStringableVftbl { IInspectableVftbl = IInspectable.Vftbl.AbiToProjectionVftable, _ToString_0 = (delegate*<IntPtr, IntPtr*, int>)(&Do_Abi_ToString_0) }; IntPtr* ptr = (IntPtr*)(void*)ComWrappersSupport.AllocateVtableMemory(typeof(ManagedIStringableVftbl), sizeof(IInspectable.Vftbl) + sizeof(IntPtr)); *(ManagedIStringableVftbl*)ptr = AbiToProjectionVftable; AbiToProjectionVftablePtr = (IntPtr)ptr; } [UnmanagedCallersOnly] private unsafe static int Do_Abi_ToString_0(IntPtr thisPtr, IntPtr* value) { try { string value2 = ComWrappersSupport.FindObject<object>(thisPtr).ToString(); *value = MarshalString.FromManaged(value2); } catch (global::System.Exception ex) { ExceptionHelpers.SetErrorInfo(ex); return ExceptionHelpers.GetHRForException(ex); } return 0; } } int