mirror of https://github.com/ppy/osu
Move public methods closer together
This commit is contained in:
parent
738c28755c
commit
ffdefbc742
|
@ -103,6 +103,28 @@ public static void UpdateDescriptions(LocalisationManager localisationManager)
|
|||
}
|
||||
}
|
||||
|
||||
public static void UninstallAssociations()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, true);
|
||||
if (classes == null)
|
||||
return;
|
||||
|
||||
foreach (var association in file_associations)
|
||||
association.Uninstall(classes, PROGRAM_ID_PREFIX);
|
||||
|
||||
foreach (var association in uri_associations)
|
||||
association.Uninstall(classes);
|
||||
|
||||
NotifyShellUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log($@"Failed to uninstall file and URI associations: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Installs or updates associations.
|
||||
/// </summary>
|
||||
|
@ -144,28 +166,6 @@ string getLocalisedString(LocalisableString s)
|
|||
}
|
||||
}
|
||||
|
||||
public static void UninstallAssociations()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var classes = Registry.CurrentUser.OpenSubKey(SOFTWARE_CLASSES, true);
|
||||
if (classes == null)
|
||||
return;
|
||||
|
||||
foreach (var association in file_associations)
|
||||
association.Uninstall(classes, PROGRAM_ID_PREFIX);
|
||||
|
||||
foreach (var association in uri_associations)
|
||||
association.Uninstall(classes);
|
||||
|
||||
NotifyShellUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Log($@"Failed to uninstall file and URI associations: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
internal static void NotifyShellUpdate() => SHChangeNotify(EventId.SHCNE_ASSOCCHANGED, Flags.SHCNF_IDLIST, IntPtr.Zero, IntPtr.Zero);
|
||||
|
||||
#region Native interop
|
||||
|
|
Loading…
Reference in New Issue