Exemple #1
0
        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));
        }
Exemple #4
0
        public static CoreDragDropManager GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(ICoreDragDropManager));

            return((CoreDragDropManager)dragDropManagerInterop.GetForWindow(appWindow, iid));
        }
Exemple #5
0
        public static UIViewSettings GetForWindow(IntPtr hwnd)
        {
            var iid = GuidGenerator.CreateIID(typeof(IUIViewSettings));

            return((UIViewSettings)uIViewSettingsInterop.GetForWindow(hwnd, iid));
        }
Exemple #6
0
        public static InputPane GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IInputPane));

            return((InputPane)inputPaneInterop.GetForWindow(appWindow, iid));
        }
Exemple #7
0
        public static SpatialInteractionManager GetForWindow(IntPtr window)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(ISpatialInteractionManager));

            return((SpatialInteractionManager)spatialInteractionManagerInterop.GetForWindow(window, iid));
        }
Exemple #8
0
        public static SystemMediaTransportControls GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(ISystemMediaTransportControls));

            return((SystemMediaTransportControls)systemMediaTransportControlsInterop.GetForWindow(appWindow, iid));
        }
Exemple #9
0
        public static RadialController CreateForWindow(IntPtr hwnd)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IRadialController));

            return((RadialController)radialControllerInterop.CreateForWindow(hwnd, iid));
        }
Exemple #10
0
        public static RadialControllerConfiguration GetForWindow(IntPtr hwnd)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IRadialControllerConfiguration));

            return((RadialControllerConfiguration)radialControllerConfigurationInterop.GetForWindow(hwnd, iid));
        }
Exemple #11
0
        public static IAsyncAction ShowAddAccountForWindowAsync(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IAsyncAction));

            return((IAsyncAction)accountsSettingsPaneInterop.ShowAddAccountForWindowAsync(appWindow, iid));
        }
Exemple #12
0
        public static AccountsSettingsPane GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IAccountsSettingsPane));

            return((AccountsSettingsPane)accountsSettingsPaneInterop.GetForWindow(appWindow, iid));
        }
Exemple #13
0
        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));
        }
Exemple #14
0
        public static IAsyncOperation <UserConsentVerificationResult> RequestVerificationForWindowAsync(IntPtr appWindow, string message)
        {
            var iid = GuidGenerator.CreateIID(typeof(IAsyncOperation <UserConsentVerificationResult>));

            return((IAsyncOperation <UserConsentVerificationResult>)userConsentVerifierInterop.RequestVerificationForWindowAsync(appWindow, message, iid));
        }
Exemple #15
0
        public static PlayToManager GetForWindow(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IPlayToManager));

            return((PlayToManager)playToManagerInterop.GetForWindow(appWindow, iid));
        }
Exemple #16
0
        public static RadialControllerIndependentInputSource CreateForWindow(IntPtr hwnd)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IRadialControllerIndependentInputSource));

            return((RadialControllerIndependentInputSource)radialControllerIndependentInputSourceInterop.CreateForWindow(hwnd, iid));
        }
Exemple #17
0
        private static void AssertGuid <T>(string expected)
        {
            var actual = GuidGenerator.CreateIID(typeof(T));

            Assert.Equal(new Guid(expected), actual);
        }
Exemple #18
0
        public static IAsyncOperation <bool> ShowPrintUIForWindowAsync(IntPtr appWindow)
        {
            Guid iid = GuidGenerator.CreateIID(typeof(IAsyncOperation <bool>));

            return((IAsyncOperation <bool>)printManagerInterop.ShowPrintUIForWindowAsync(appWindow, iid));
        }