private void img_dep1_Click(object sender, EventArgs e) { ExtensionControl_Click(null, null); DependencyForm depForm = new DependencyForm(this.Package); depForm.ShowDialog(); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!Settings.HasConfigFile) { ShowLaunchFailure("Config file is missing."); return; } if (!Paths.ValidateDependencyPaths()) { using (var dependencyForm = new DependencyForm()) { if (dependencyForm.ShowDialog() != DialogResult.OK) { ShowLaunchFailure("A dependency is missing."); return; } } } MainForm = new MainForm(); Application.Run(MainForm); }
public DependencyFormController(DependencyForm instance) { this.frmDependency = instance; this.srvDependency = SamsaraAppContext.Resolve <IDependencyService>(); this.srvBidder = SamsaraAppContext.Resolve <IBidderService>(); this.InitializeFormControls(); }
private void Tree_UpdateComplete(object sender, EventArgs e) { UI.TreeView.Invalidate(); UI.PropertyGrid.Refresh(); InvokeBPABackground(); if (DependencyForm.Visible) DependencyForm.RefreshTree(); }
public void ShowDependencies(IDaxObject dependantObject) { if (DependencyForm.IsDisposed) { DependencyForm = new DependencyForm(); } DependencyForm.Owner = UI.FormMain; DependencyForm.RootObject = dependantObject; DependencyForm.Show(); }
private void dependenciaToolStripMenuItem_Click(object sender, System.EventArgs e) { try { this.Cursor = Cursors.WaitCursor; DependencyForm frmDependency = new DependencyForm(); frmDependency.Show(); } finally { this.Cursor = Cursors.Default; } }
private void UIController_ObjectChanged(object sender, ObjectChangedEventArgs e) { if (!Handler.UpdateInProgress) { if(e.PropertyName == "Annotations" && e.TabularObject == UI.PropertyGrid.SelectedObject) UI.PropertyGrid.Refresh(); if (e.PropertyName.EndsWith("Expression") && DependencyForm.Visible && e.TabularObject is IDaxDependantObject daxObject ) DependencyForm.RefreshTree(); InvokeBPABackground(); } }
private void Tree_UpdateComplete(object sender, EventArgs e) { UI.TreeView.Invalidate(); if (UI.PropertyGrid.SelectedObjects.OfType <ITabularObject>().Any(to => to.IsRemoved)) { UI.PropertyGrid.SelectedObject = null; } else { UI.PropertyGrid.Refresh(); } InvokeBPABackground(); if (DependencyForm.Visible) { DependencyForm.RefreshTree(); } }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!Settings.HasConfigFile) { ShowLaunchFailure("Config file is missing."); return; } if (!Paths.ValidateDependencyPaths()) { using (var dependencyForm = new DependencyForm()) { if (dependencyForm.ShowDialog() != DialogResult.OK) { ShowLaunchFailure("A dependency is missing."); return; } } } // Naive way to tell the program that its been executed through // Vortex - this will have to be enhanced if we're planning // on implementing some sort of automatic merging capability. if (args.Length == 1 && args[0] == "vortex") { Settings.Set("RanThroughVortex", true); } else { Settings.Set("RanThroughVortex", false); } MainForm = new MainForm(); Application.Run(MainForm); }
public void InstallFile(string file, bool silent, bool gui) { if (!File.Exists(file)) { if (!silent) { MessageBox.Show("File not found !"); } return; } if (IsOldFormat(file)) { if (!silent) { MessageBox.Show("This is an old format file (mpi). The extension will NOT be installed. "); } return; } MpeCore.MpeInstaller.Init(); PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(file); if (pak == null) { if (!silent) { MessageBox.Show("Wrong file format !"); } return; } if (pak.CheckDependency(false)) { PackageClass installedPak = MpeCore.MpeInstaller.InstalledExtensions.Get(pak.GeneralInfo.Id); if (installedPak != null) { if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { if (!silent) { if ( MessageBox.Show( "Another version of this extension is installed\nand needs to be uninstalled first.\nDo you want to continue?\n" + "Old extension version: " + installedPak.GeneralInfo.Version + "\n" + "New extension version: " + pak.GeneralInfo.Version, "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { return; } } UnInstall dlg = new UnInstall(); dlg.Execute(installedPak, true); pak.CopyGroupCheck(installedPak); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(installedPak); } } if (gui) { this.Hide(); } pak.Silent = silent; pak.StartInstallWizard(); if (gui) { SetFilterForKnownExtensionsList(); RefreshListControls(); this.Show(); } } else { if (!silent) { if (MessageBox.Show("Dependency check error! Install aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } } } }
private bool DoUpdate(PackageClass packageClass, PackageClass newpackageClass, bool silent) { string newPackageLoacation = ExtensionUpdateDownloader.GetPackageLocation(newpackageClass, Client_DownloadProgressChanged, Client_DownloadFileCompleted); if (!File.Exists(newPackageLoacation)) { if (!silent) { MessageBox.Show("Can't locate the installer package. Update aborted"); } return(false); } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { if (!silent) { MessageBox.Show("Invalid package format ! Update aborted !"); } return(false); } if (pak.GeneralInfo.Id != newpackageClass.GeneralInfo.Id || pak.GeneralInfo.Version.CompareTo(newpackageClass.GeneralInfo.Version) < 0) { if (!silent) { MessageBox.Show("Invalid update information ! Update aborted!"); } return(false); } if (!pak.CheckDependency(false)) { if (!silent) { if (MessageBox.Show("Dependency check error! Update aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } } return(false); } if (!silent) { if ( MessageBox.Show( "This operation will update the extension " + packageClass.GeneralInfo.Name + " to the version " + pak.GeneralInfo.Version + " \n Do you want to continue ? ", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { return(false); } } // only uninstall previous version, if the new package has the setting to force uninstall of previous version on update if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, true); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(packageClass); } pak.CopyGroupCheck(packageClass); pak.Silent = true; pak.StartInstallWizard(); return(true); }
private void extensionListControl_InstallExtension(object sender, PackageClass packageClass) { string newPackageLoacation = ExtensionUpdateDownloader.GetPackageLocation(packageClass, Client_DownloadProgressChanged, Client_DownloadFileCompleted); if (!File.Exists(newPackageLoacation)) { MessageBox.Show("Can't locate the installer package. Install aborted"); return; } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { MessageBox.Show("Package loading error ! Install aborted!"); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } return; } if (!pak.CheckDependency(false)) { if (MessageBox.Show("Dependency check error! Install aborted!\nWould you like to view more details?", pak.GeneralInfo.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } return; } if (packageClass.GeneralInfo.Version.CompareTo(pak.GeneralInfo.Version) != 0) { if (MessageBox.Show( string.Format(@"Downloaded version of {0} is {1} and differs from your selected version: {2}! Do you want to continue ?", packageClass.GeneralInfo.Name, pak.GeneralInfo.Version, packageClass.GeneralInfo.Version), "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Error) != DialogResult.Yes) { return; } } if ( MessageBox.Show( "This operation will install " + packageClass.GeneralInfo.Name + " version " + pak.GeneralInfo.Version + "\n Do you want to continue ?", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { return; } this.Hide(); packageClass = MpeCore.MpeInstaller.InstalledExtensions.Get(packageClass.GeneralInfo.Id); if (packageClass != null) { if (pak.GeneralInfo.Params[ParamNamesConst.FORCE_TO_UNINSTALL_ON_UPDATE].GetValueAsBool()) { if ( MessageBox.Show( "Another version of this extension is installed\nand needs to be uninstalled first.\nDo you want to continue?\n" + "Old extension version: " + packageClass.GeneralInfo.Version + "\n" + "New extension version: " + pak.GeneralInfo.Version, "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { this.Show(); return; } UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, false); } else { MpeCore.MpeInstaller.InstalledExtensions.Remove(packageClass); } pak.CopyGroupCheck(packageClass); } pak.StartInstallWizard(); RefreshListControls(); pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } this.Show(); }
private bool DoUpdate(PackageClass packageClass, PackageClass newpackageClass, bool silent) { string newPackageLoacation = GetPackageLocation(newpackageClass); if (!File.Exists(newPackageLoacation)) { if (!silent) { MessageBox.Show("Can't locate the installer package. Update aborted"); } return(false); } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { if (!silent) { MessageBox.Show("Invalid package format ! Update aborted !"); } return(false); } if (pak.GeneralInfo.Id != newpackageClass.GeneralInfo.Id || pak.GeneralInfo.Version.CompareTo(newpackageClass.GeneralInfo.Version) < 0) { if (!silent) { MessageBox.Show("Invalid update information ! Update aborted!"); } return(false); } if (!pak.CheckDependency(false)) { if (!silent) { if (MessageBox.Show("Dependency check error! Update aborted!\nWould you like to view more details?", string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } } return(false); } if (!silent) { if ( MessageBox.Show( "This operation will update the extension " + packageClass.GeneralInfo.Name + " to the version " + pak.GeneralInfo.Version + " \n Do you want to continue ? ", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { return(false); } } UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, true); pak.CopyGroupCheck(packageClass); pak.Silent = true; pak.StartInstallWizard(); return(true); }
private void extensionListControl_InstallExtension(object sender, PackageClass packageClass) { string newPackageLoacation = GetPackageLocation(packageClass); if (!File.Exists(newPackageLoacation)) { MessageBox.Show("Can't locate the installer package. Install aborted"); return; } PackageClass pak = new PackageClass(); pak = pak.ZipProvider.Load(newPackageLoacation); if (pak == null) { MessageBox.Show("Package loading error ! Install aborted!"); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } return; } if (!pak.CheckDependency(false)) { if (MessageBox.Show("Dependency check error! Install aborted!\nWould you like to view more details?", string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { DependencyForm frm = new DependencyForm(pak); frm.ShowDialog(); } pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } return; } if ( MessageBox.Show( "This operation will install extension " + packageClass.GeneralInfo.Name + " version " + pak.GeneralInfo.Version + " \n Do you want to continue ? ", "Install extension", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) != DialogResult.Yes) { return; } this.Hide(); packageClass = MpeCore.MpeInstaller.InstalledExtensions.Get(packageClass.GeneralInfo.Id); if (packageClass != null) { UnInstall dlg = new UnInstall(); dlg.Execute(packageClass, true); pak.CopyGroupCheck(packageClass); } pak.StartInstallWizard(); RefreshLists(); pak.ZipProvider.Dispose(); try { if (newPackageLoacation != packageClass.GeneralInfo.Location) { File.Delete(newPackageLoacation); } } catch { } this.Show(); }
private void img_dep_Click(object sender, EventArgs e) { DependencyForm depForm = new DependencyForm(this.Package); depForm.ShowDialog(); }
private void img_dep_Click(object sender, EventArgs e) { DependencyForm depForm = new DependencyForm((Parent as ExtensionControlHost).Package); depForm.ShowDialog(); }