public async Task <bool> Uninstall(ISteamApi api, IAbsoluteDirectoryPath workshopPath, CancellationToken cancelToken = default(CancellationToken)) { ItemInstallInfo info = null; if (IsInstalled()) { info = api.GetItemInstallInfo(Pid); MainLog.Logger.Debug($"IsInstalled! {info}"); } var path = info?.GetLocation(IsLegacy()) ?? GetPath(workshopPath); if (IsSubscribed()) { await api.UnsubscribeAndConfirm(Pid).ConfigureAwait(false); // We delete the path anyway, because Steam will normally wait until the program exits otherwise // and since we're a tool and not the game, we don't have to wait! path.DeleteIfExists(true); return(true); } path.DeleteIfExists(true); return(false); }
async Task HandleSubscription(bool force, ISteamApi api) { var isSubscribed = IsSubscribed(); if (force && isSubscribed) { await api.UnsubscribeAndConfirm(Pid).ConfigureAwait(false); isSubscribed = false; } if (!isSubscribed) await api.SubscribeAndConfirm(Pid).ConfigureAwait(false); }
async Task HandleSubscription(bool force, ISteamApi api) { var isSubscribed = IsSubscribed(); if (force && isSubscribed) { await api.UnsubscribeAndConfirm(Pid).ConfigureAwait(false); isSubscribed = false; } if (!isSubscribed) { await api.SubscribeAndConfirm(Pid).ConfigureAwait(false); } }
public async Task<bool> Uninstall(ISteamApi api, IAbsoluteDirectoryPath workshopPath, CancellationToken cancelToken = default(CancellationToken)) { ItemInstallInfo info = null; if (IsInstalled()) { info = api.GetItemInstallInfo(Pid); MainLog.Logger.Debug($"IsInstalled! {info}"); } var path = info?.GetLocation(IsLegacy()) ?? GetPath(workshopPath); if (IsSubscribed()) { await api.UnsubscribeAndConfirm(Pid).ConfigureAwait(false); // We delete the path anyway, because Steam will normally wait until the program exits otherwise // and since we're a tool and not the game, we don't have to wait! path.DeleteIfExists(true); return true; } path.DeleteIfExists(true); return false; }