public void TestMockDragDropManager() { var interop = Class.ComInterop.As <WinRT.Interop.IDragDropManagerInterop>(); Guid iid = GuidGenerator.CreateIID(typeof(ICoreDragDropManager)); var manager = interop.GetForWindow(new IntPtr(0), iid); Assert.NotNull(manager); }
public static IAudioPolicyConfigFactory Create() { var iid = GuidGenerator.CreateIID(typeof(IAudioPolicyConfigFactory)); using var name = HSTRING.FromString("Windows.Media.Internal.AudioPolicyConfig"); ComBase.RoGetActivationFactory(name, ref iid, out object factory); return(factory.As <IAudioPolicyConfigFactory>()); }
public static IAsyncOperation <UserConsentVerificationResult> RequestVerificationForWindowAsync(IntPtr hWnd, string Message) { //Use WinRT's GuidGenerator to get the correct guid var guid = GuidGenerator.CreateIID(typeof(IAsyncOperation <UserConsentVerificationResult>)); //leverage winrt .As<> operator to cast winrt type to its interop interface IUserConsentVerifierInterop userConsentVerifierInterop = UserConsentVerifier.As <IUserConsentVerifierInterop>(); //Handle marshalling the string to WinRT's HString var marshalStr = MarshalString.CreateMarshaler(Message); //Call the Interop api that pops a dialog, passing in the hWnd parameter IntPtr outPtr; userConsentVerifierInterop.RequestVerificationForWindowAsync(hWnd, MarshalString.GetAbi(marshalStr), ref guid, out outPtr); //Marshal the return object as an IAsyncOperation<> return((IAsyncOperation <UserConsentVerificationResult>)IInspectable.FromAbi(outPtr)); }
public static CoreDragDropManager GetForWindow(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(ICoreDragDropManager)); return((CoreDragDropManager)dragDropManagerInterop.GetForWindow(appWindow, iid)); }
public static UIViewSettings GetForWindow(IntPtr hwnd) { var iid = GuidGenerator.CreateIID(typeof(IUIViewSettings)); return((UIViewSettings)uIViewSettingsInterop.GetForWindow(hwnd, iid)); }
public static InputPane GetForWindow(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(IInputPane)); return((InputPane)inputPaneInterop.GetForWindow(appWindow, iid)); }
public static SpatialInteractionManager GetForWindow(IntPtr window) { Guid iid = GuidGenerator.CreateIID(typeof(ISpatialInteractionManager)); return((SpatialInteractionManager)spatialInteractionManagerInterop.GetForWindow(window, iid)); }
public static SystemMediaTransportControls GetForWindow(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(ISystemMediaTransportControls)); return((SystemMediaTransportControls)systemMediaTransportControlsInterop.GetForWindow(appWindow, iid)); }
public static RadialController CreateForWindow(IntPtr hwnd) { Guid iid = GuidGenerator.CreateIID(typeof(IRadialController)); return((RadialController)radialControllerInterop.CreateForWindow(hwnd, iid)); }
public static RadialControllerConfiguration GetForWindow(IntPtr hwnd) { Guid iid = GuidGenerator.CreateIID(typeof(IRadialControllerConfiguration)); return((RadialControllerConfiguration)radialControllerConfigurationInterop.GetForWindow(hwnd, iid)); }
public static IAsyncAction ShowAddAccountForWindowAsync(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(IAsyncAction)); return((IAsyncAction)accountsSettingsPaneInterop.ShowAddAccountForWindowAsync(appWindow, iid)); }
public static AccountsSettingsPane GetForWindow(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(IAccountsSettingsPane)); return((AccountsSettingsPane)accountsSettingsPaneInterop.GetForWindow(appWindow, iid)); }
public static IAsyncInfo RequestTokenWithWebAccountForWindowAsync(IntPtr appWindow, WebTokenRequest request, WebAccount webAccount) { var iid = GuidGenerator.CreateIID(typeof(IAsyncOperation <WebTokenRequestResult>)); return((IAsyncInfo)webAuthenticationCoreManagerInterop.RequestTokenWithWebAccountForWindowAsync(appWindow, request, webAccount, iid)); }
public static IAsyncOperation <UserConsentVerificationResult> RequestVerificationForWindowAsync(IntPtr appWindow, string message) { var iid = GuidGenerator.CreateIID(typeof(IAsyncOperation <UserConsentVerificationResult>)); return((IAsyncOperation <UserConsentVerificationResult>)userConsentVerifierInterop.RequestVerificationForWindowAsync(appWindow, message, iid)); }
public static PlayToManager GetForWindow(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(IPlayToManager)); return((PlayToManager)playToManagerInterop.GetForWindow(appWindow, iid)); }
public static RadialControllerIndependentInputSource CreateForWindow(IntPtr hwnd) { Guid iid = GuidGenerator.CreateIID(typeof(IRadialControllerIndependentInputSource)); return((RadialControllerIndependentInputSource)radialControllerIndependentInputSourceInterop.CreateForWindow(hwnd, iid)); }
private static void AssertGuid <T>(string expected) { var actual = GuidGenerator.CreateIID(typeof(T)); Assert.Equal(new Guid(expected), actual); }
public static IAsyncOperation <bool> ShowPrintUIForWindowAsync(IntPtr appWindow) { Guid iid = GuidGenerator.CreateIID(typeof(IAsyncOperation <bool>)); return((IAsyncOperation <bool>)printManagerInterop.ShowPrintUIForWindowAsync(appWindow, iid)); }