Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
kant2002 committed Apr 7, 2022
1 parent f4a54d0 commit b1db619
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/System.Windows.Forms/tests/InteropTests/PropertyGridTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public void ISupportErrorInfo_Supported_ButNoIErrorInfoGiven()
}
catch (ExternalException ex)
{
// Most default C++ implementation when Invoke return error code
// implementation consults IErrorInfo object and populates EXCEPINFO structure.
// From EXCEPINFO grid entry reads error code and message.
// IErrorInfo consulted too, but it does not hold error message anymore.
// Most default C++ implementation when Invoke return error code
// implementation consults IErrorInfo object and populates EXCEPINFO structure.
// From EXCEPINFO grid entry reads error code and message.
// IErrorInfo consulted too, but it does not hold error message anymore.
Assert.Equal((int)HRESULT.DISP_E_MEMBERNOTFOUND, ex.HResult);
Assert.Equal("Error From StandardErrorInfoUsageTest", ex.Message);
}
Expand Down Expand Up @@ -65,8 +65,8 @@ public void ISupportErrorInfo_Supported_WithIErrorInfoGiven()
}
catch (ExternalException ex)
{
// If C++ implementation of Invoke did not populate EXCEPINFO structure
// from IErrorInfo, then we read that information about error call and display that error message to the user.
// If C++ implementation of Invoke did not populate EXCEPINFO structure
// from IErrorInfo, then we read that information about error call and display that error message to the user.
Assert.Equal("Error From RawErrorInfoUsageTest", ex.Message);
}
finally
Expand All @@ -90,19 +90,27 @@ private unsafe void ExecuteWithActivationContext(string applicationManifest, Act
}

if (handle == IntPtr.Zero)
{
throw new Win32Exception();
}

try
{
if (Kernel32.ActivateActCtx(handle, out var cookie).IsFalse())
{
throw new Win32Exception();
}

try
{
action();
}
finally
{
if (Kernel32.DeactivateActCtx(0, cookie).IsFalse())
{
throw new Win32Exception();
}
}
}
finally
Expand Down

0 comments on commit b1db619

Please sign in to comment.