예제 #1
0
        public static AccountsSettingsPane GetForWindow(IntPtr hWnd)
        {
            IAccountsSettingsPaneInterop accountsSettingsPaneInterop =
                AccountsSettingsPane.As <IAccountsSettingsPaneInterop>();
            //Guid guid = typeof(AccountsSettingsPane).GUID;
            Guid guid = //WinRT.GuidGenerator.CreateIID(typeof(IAccountsSettingPane));
                        Guid.Parse("81EA942C-4F09-4406-A538-838D9B14B7E6");

            //IAccountsSettingsPaneInterop accountsSettingsPaneInterop =
            //    (IAccountsSettingsPaneInterop)WindowsRuntimeMarshal.GetActivationFactory(typeof(AccountsSettingsPane));
            //Guid guid = typeof(AccountsSettingsPane).GetInterface("IAccountsSettingsPane").GUID;

            accountsSettingsPaneInterop.GetForWindow(hWnd, ref guid, out IntPtr result);
            return(MarshalInterface <AccountsSettingsPane> .FromAbi(result));
        }
예제 #2
0
        public static IAsyncAction ShowAddAccountForWindowAsync(IntPtr hWnd)
        {
            IWebAuthenticationCoreManagerInterop webAuthenticationCoreManagerInterop =
                WebAuthenticationCoreManager.As <IWebAuthenticationCoreManagerInterop>();

            IAccountsSettingsPaneInterop accountsSettingsPaneInterop =
                AccountsSettingsPane.As <IAccountsSettingsPaneInterop>();
            //Guid guid = typeof(IAsyncAction).GUID;
            Guid guid = WinRT.GuidGenerator.CreateIID(typeof(IAsyncAction));

            //IAccountsSettingsPaneInterop accountsSettingsPaneInterop =
            //    (IAccountsSettingsPaneInterop)WindowsRuntimeMarshal.GetActivationFactory(typeof(AccountsSettingsPane));
            //Guid guid = typeof(IAsyncAction).GUID;

            accountsSettingsPaneInterop.ShowAddAccountForWindowAsync(hWnd, ref guid, out IntPtr result);

            return(MarshalInterface <IAsyncAction> .FromAbi(result));
        }