private int ComparePendingUpdate(PendingUpdate x, PendingUpdate y) { if (x.Type != y.Type) { return(x.Type == PendingUpdateType.Uninstall ? -1 : 1); } bool xIsCore = x.PackageId == CorePackageId; bool yIsCore = y.PackageId == CorePackageId; if (xIsCore != yIsCore) { return(xIsCore ? -1 : 1); } return(String.Compare(x.PackageId, y.PackageId, StringComparison.OrdinalIgnoreCase)); }
private static bool ShouldUpdateRuntime(PendingUpdate update, RegistryKey packageKey) { if ( update.PackageId != CorePackageId || update.Type != PendingUpdateType.Update ) { return(false); } Version version; if (!Version.TryParse((string)packageKey.GetValue("PendingVersion"), out version)) { return(true); } // We check whether we need to update the runtime by checking whether // the assembly version of the main assembly (this) equals the // expected version of the NetIde.Package.Core package. return(version != typeof(PackageUpdater).Assembly.GetName().Version); }
private static bool ShouldUpdateRuntime(PendingUpdate update, RegistryKey packageKey) { if ( update.PackageId != CorePackageId || update.Type != PendingUpdateType.Update ) return false; Version version; if (!Version.TryParse((string)packageKey.GetValue("PendingVersion"), out version)) return true; // We check whether we need to update the runtime by checking whether // the assembly version of the main assembly (this) equals the // expected version of the NetIde.Package.Core package. return version != typeof(PackageUpdater).Assembly.GetName().Version; }
private int ComparePendingUpdate(PendingUpdate x, PendingUpdate y) { if (x.Type != y.Type) return x.Type == PendingUpdateType.Uninstall ? -1 : 1; bool xIsCore = x.PackageId == CorePackageId; bool yIsCore = y.PackageId == CorePackageId; if (xIsCore != yIsCore) return xIsCore ? -1 : 1; return String.Compare(x.PackageId, y.PackageId, StringComparison.OrdinalIgnoreCase); }