public PackageRepositoryTreeModel(PackageManager manager) { this.packageManager = manager; this.itemInfoLoader = new BackgroundWorker(); this.itemInfoLoader.WorkerReportsProgress = true; this.itemInfoLoader.DoWork += this.Worker_ReadItemData; this.itemInfoLoader.ProgressChanged += this.Worker_ProgressChanged; this.itemRetriever = new BackgroundWorker(); this.itemRetriever.WorkerReportsProgress = true; this.itemRetriever.DoWork += this.Worker_RetrieveItems; this.itemRetriever.ProgressChanged += this.Worker_ItemsRetrieved; }
private static void Main(string[] args) { // Parse command line arguments bool recover = false; foreach (string a in args) { if (a == "debug") System.Diagnostics.Debugger.Launch(); else if (a == "recover") recover = true; } // Culture setup Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; Application.CurrentCulture = Thread.CurrentThread.CurrentCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += Application_ThreadException; // Perform the initial package update - even before initializing the editor { PackageManager packageManager = new PackageManager(); if (packageManager.IsPackageUpdateRequired) { Log.Editor.Write("Updating Packages..."); Log.Editor.PushIndent(); ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( GeneralRes.TaskInstallPackages_Caption, GeneralRes.TaskInstallPackages_Desc, FirstTimeSetup, packageManager); setupDialog.ShowInTaskbar = true; setupDialog.MainThreadRequired = false; setupDialog.ShowDialog(); Log.Editor.PopIndent(); } if (packageManager.ApplyUpdate()) { Application.Exit(); return; } } // Run the editor SplashScreen splashScreen = new SplashScreen(recover); splashScreen.Show(); Application.Run(); }
private static void Main(string[] args) { // Parse command line arguments bool recover = false; bool update = false; foreach (string a in args) { if (a == "debug") System.Diagnostics.Debugger.Launch(); else if (a == "recover") recover = true; else if (a == "update") update = true; } // Culture setup Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; // Only perform a quick update, don't do anything else. if (update) { Log.Editor.Write("Performing Duality Update"); Log.Editor.PushIndent(); try { PackageManager packageManager = new PackageManager(); packageManager.VerifyPackages(); packageManager.ApplyUpdate(false); } catch (Exception e) { Log.Editor.WriteError(Log.Exception(e)); } Log.Editor.PopIndent(); } // Run the editor regularly else { Application.CurrentCulture = Thread.CurrentThread.CurrentCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += Application_ThreadException; SplashScreen splashScreen = new SplashScreen(recover); splashScreen.Show(); Application.Run(); } }
public abstract void RetrieveAsyncData(PackageManager manager);
public void UpdateLocalPackageData(PackageManager manager) { lock (this.asyncDataLock) { LocalPackage installedPackage = manager.LocalPackages.FirstOrDefault(p => p.Id == this.itemPackageInfo.Id); this.installedPackageInfo = (installedPackage != null) ? installedPackage.Info : null; } }
public override void RetrieveAsyncData(PackageManager manager) { this.UpdateLocalPackageData(manager); this.GetUpdateCompatibility(manager); }
public override void RetrieveAsyncData(PackageManager manager) { // Retrieve info about newest online version PackageInfo newestPackage = manager.QueryPackageInfo(this.itemPackageInfo.PackageName.VersionInvariant); lock (this.asyncDataLock) { this.newestPackageInfo = newestPackage; } this.GetUpdateCompatibility(manager); }
protected void GetUpdateCompatibility(PackageManager manager) { PackageCompatibility compatibility = manager.GetCompatibilityLevel(this.NewestPackageInfo); lock (this.asyncDataLock) { this.compatibility = compatibility; } }
private static void Main(string[] args) { // Parse command line arguments bool recover = false; foreach (string a in args) { if (a == "debug") System.Diagnostics.Debugger.Launch(); else if (a == "recover") recover = true; } // Culture setup Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture; // Set up file logging StreamWriter logfileWriter = null; TextWriterLogOutput logfileOutput = null; try { // If there is an existing logfile, preserve it under a different name if (File.Exists(DualityEditorApp.EditorLogfilePath)) { if (File.Exists(DualityEditorApp.EditorPrevLogfilePath)) File.Delete(DualityEditorApp.EditorPrevLogfilePath); File.Move(DualityEditorApp.EditorLogfilePath, DualityEditorApp.EditorPrevLogfilePath); } // Create a new logfile logfileWriter = new StreamWriter(DualityEditorApp.EditorLogfilePath); logfileWriter.AutoFlush = true; logfileOutput = new TextWriterLogOutput(logfileWriter); Log.AddGlobalOutput(logfileOutput); } catch (Exception e) { Log.Core.WriteWarning("Text Logfile unavailable: {0}", Log.Exception(e)); } // Winforms Setup Application.CurrentCulture = Thread.CurrentThread.CurrentCulture; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += Application_ThreadException; { PackageManager packageManager = new PackageManager(); // On the first install startup, display a generic license agreement for Duality if (packageManager.IsFirstInstall) { LicenseAcceptDialog licenseDialog = new LicenseAcceptDialog { DescriptionText = GeneralRes.LicenseAcceptDialog_FirstStartGeneric, LicenseUrl = new Uri(DualityMainLicenseUrl) }; DialogResult result = licenseDialog.ShowDialog(); if (result != DialogResult.OK) { Application.Exit(); return; } } // Perform the initial package update - even before initializing the editor if (packageManager.IsPackageSyncRequired) { Log.Editor.Write("Updating Packages..."); Log.Editor.PushIndent(); ProcessingBigTaskDialog setupDialog = new ProcessingBigTaskDialog( GeneralRes.TaskInstallPackages_Caption, GeneralRes.TaskInstallPackages_Desc, SynchronizePackages, packageManager); setupDialog.ShowInTaskbar = true; setupDialog.MainThreadRequired = false; setupDialog.ShowDialog(); Log.Editor.PopIndent(); } if (packageManager.ApplyUpdate()) { Application.Exit(); return; } } // Run the editor SplashScreen splashScreen = new SplashScreen(recover); splashScreen.Show(); Application.Run(); // Clean up the log file if (logfileWriter != null) { Log.RemoveGlobalOutput(logfileOutput); logfileWriter.Flush(); logfileWriter.Close(); logfileWriter = null; logfileOutput = null; } }
public OnlinePackagesTreeModel(PackageManager manager) : base(manager) { this.packageManager.PackageInstalled += this.packageManager_PackageInstalled; this.packageManager.PackageUninstalled += this.packageManager_PackageUninstalled; }
public override void RetrieveAsyncData(PackageManager manager) { base.RetrieveAsyncData(manager); this.UpdateLocalPackageData(manager); }
public override void RetrieveAsyncData(PackageManager manager) { base.RetrieveAsyncData(manager); // Retrieve info about newest online version PackageInfo newestPackage = manager.QueryPackageInfo(this.itemPackageInfo.Id); lock (this.asyncDataLock) { this.newestPackageInfo = newestPackage; } }
public override void RetrieveAsyncData(PackageManager manager) { // Retrieve Icon Image newIcon = null; if (this.itemPackageInfo != null) newIcon = this.RetrieveIcon(this.itemPackageInfo.IconUrl); if (newIcon == null) newIcon = DefaultPackageIcon; lock (this.asyncDataLock) { this.icon = newIcon; } }