Ejemplo n.º 1
0
        public static T CheckHRAndReturnOrThrow <T>(Hresult hr, T result)
        {
            if (hr != Hresult.Ok)
            {
                Marshal.ThrowExceptionForHR((int)hr);
            }

            return(result);
        }
Ejemplo n.º 2
0
 private void Model_ApplyComplete(object sender, WPFBootstrapperEventArgs <Wix.ApplyCompleteEventArgs> e)
 {
     if (Hresult.Succeeded(e.Arguments.Status))
     {
         this.InstallState = InstallationState.Applied;
     }
     else
     {
         this.InstallState = InstallationState.Failed;
     }
 }
Ejemplo n.º 3
0
        internal static IntPtr SetActiveWindow(IntPtr hwnd)
        {
            Verify.IsNotDefault(hwnd, "hwnd");
            var ret = User32.SetActiveWindow(hwnd);

            if (ret == IntPtr.Zero)
            {
                Hresult.ThrowLastError();
            }
            return(ret);
        }
Ejemplo n.º 4
0
        private void Model_PlanComplete(object sender, WPFBootstrapperEventArgs <Wix.PlanCompleteEventArgs> e)
        {
            if (Hresult.Succeeded(e.Arguments.Status))
            {
                this.PreApplyState = this.InstallState;
                this.InstallState  = InstallationState.Applying;

                this.Model.Apply(this.ViewWindowHandle);
            }
            else
            {
                this.InstallState = InstallationState.Failed;
            }
        }