Skip to content

Commit

Permalink
fixed code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry A committed Sep 13, 2018
1 parent bfd707a commit cef09f6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/Squirrel/ShellFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ public static PropVariant FromString(string str)

public static PropVariant FromGuid(Guid guid)
{
byte[] bytes = ((Guid)guid).ToByteArray();
var pv = new PropVariant()
{
byte[] bytes = guid.ToByteArray();
var pv = new PropVariant() {
variantType = 72, // VT_CLSID
pointerValue = Marshal.AllocCoTaskMem(bytes.Length),
};
Expand Down Expand Up @@ -925,7 +924,7 @@ public void SetAppUserModelId(string appId)
/// </summary>
public void SetToastActivatorCLSID(string clsid)
{
Guid guid = Guid.Parse(clsid);
var guid = Guid.Parse(clsid);
SetToastActivatorCLSID(guid);
}

Expand All @@ -938,17 +937,14 @@ public void SetToastActivatorCLSID(Guid clsid)

var pkey = PROPERTYKEY.PKEY_AppUserModel_ToastActivatorCLSID;

PropVariant varGuid = PropVariant.FromGuid(clsid);
try
{
var varGuid = PropVariant.FromGuid(clsid);
try {
int errCode = propStore.SetValue(ref pkey, ref varGuid);
Marshal.ThrowExceptionForHR(errCode);

errCode = propStore.Commit();
Marshal.ThrowExceptionForHR(errCode);
}
finally
{
} finally {
varGuid.Clear();
}
}
Expand Down

0 comments on commit cef09f6

Please sign in to comment.