private void copyToolStripMenuItem_Click(object sender, EventArgs e) { AemInstance instance = this.SelectedInstanceInListview; if (instance == null) { return; } instance = instance.Clone(); instance.Name = "Copy of " + instance.Name; AemInstanceDialog dialog = new AemInstanceDialog(instance); if (dialog.ShowDialog(this) == DialogResult.OK) { instance.Save(); Program.InstanceList.Add(instance); Program.InstanceList.SortByName(); Program.UpdateInstanceListInViews(); } else { // remove instance icon because instance not saved instance.NotifyIcon.Visible = false; instance.NotifyIcon.Dispose(); instance.NotifyIcon = null; } }
private void cmOK_Click(object sender, EventArgs e) { mInstance.AemInstanceType = (AemInstanceType)Enum.GetValues(typeof(AemInstanceType)).GetValue(cboAemInstanceType.SelectedIndex); mInstance.Name = txtName.Text.Trim(); mInstance.Hostname = txtHostname.Text.Trim(); mInstance.Port = ParseWithDefault(txtPort.Text, AemInstance.DEFAULT_PORT); mInstance.ContextPath = txtContextPath.Text.Trim(); mInstance.Path = txtPath.Text.Trim(); mInstance.JavaExecutable = txtJavaExecutable.Text.Trim(); mInstance.Username = txtUsername.Text.Trim(); mInstance.Password = txtPassword.Text.Trim(); if (chkRunmodePublish.Checked) { mInstance.Runmode = Runmode.PUBLISH; } else { mInstance.Runmode = Runmode.AUTHOR; } mInstance.AdditionalRunmodes = txtAdditionalRunmodes.Text; mInstance.RunmodeSampleContent = chkRunmodeSampleContent.Checked; mInstance.IconSet = (IconSet)Enum.GetValues(typeof(IconSet)).GetValue(cboIconSet.SelectedIndex); mInstance.CustomIconPath = txtCustomIconPath.Text; mInstance.Password = txtPassword.Text.Trim(); mInstance.HeapMinSizeMb = ParseWithDefault(txtHeapMinSizeMb.Text, AemInstance.DEFAULT_HEAP_MIN_MB); mInstance.HeapMaxSizeMb = ParseWithDefault(txtHeapMaxSizeMb.Text, AemInstance.DEFAULT_HEAP_MAX_MB); mInstance.MaxPermSizeMb = ParseWithDefault(txtMaxPermSizeMb.Text, AemInstance.DEFAULT_PERMSIZE_MB); mInstance.JVMDebug = chkJVMDebug.Checked; mInstance.DebugPort = ParseWithDefault(txtDebugPort.Text, 0); mInstance.JProfiler = chkJProfiler.Checked; mInstance.JProfilerPort = ParseWithDefault(txtJProfilerPort.Text, AemInstance.DEFAULT_JPROFILER_PORT); mInstance.JConsole = chkJConsole.Checked; mInstance.JConsolePort = ParseWithDefault(txtJConsolePort.Text, AemInstance.DEFAULT_JCONSOLE_PORT); mInstance.HideConfigWizard = chkHideConfigWizards.Checked; mInstance.ShowInstanceWindow = chkShowInstanceWindow.Checked; mInstance.OpenBrowser = chkOpenBrowser.Checked; mInstance.RemoteProcess = chkRemoteProcess.Checked; mInstance.ShowInTaskbar = chkShowInTaskbar.Checked; mInstance.CustomJVMParam1Active = chkCustomJVMParam1Active.Checked; mInstance.CustomJVMParam1 = txtCustomJVMParam1.Text; mInstance.CustomJVMParam2Active = chkCustomJVMParam2Active.Checked; mInstance.CustomJVMParam2 = txtCustomJVMParam2.Text; mInstance.CustomJVMParam3Active = chkCustomJVMParam3Active.Checked; mInstance.CustomJVMParam3 = txtCustomJVMParam3.Text; mInstance.BrowserExecutable = txtBrowserExecutable.Text; string errorMessage = mInstance.Validate(); if (errorMessage != null) { MessageBox.Show(errorMessage, "Validation Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } mInstance.Save(); this.DialogResult = DialogResult.OK; this.Close(); }
static void ShowInTaskbarMenuItem_Click(object sender, EventArgs e) { MenuItem menuItem = (MenuItem)sender; AemInstance selectedInstance = (AemInstance)menuItem.Tag; selectedInstance.ShowInTaskbar = !selectedInstance.ShowInTaskbar; selectedInstance.Save(); Program.UpdateInstanceListInViews(); }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialogJar.ShowDialog(this) == DialogResult.OK) { AemInstance instance = new AemInstance(); // auto-detect some instance properties instance.Path = openFileDialogJar.FileName; string[] pathParts = instance.Path.Split('/', '\\'); string jarFilename = pathParts[pathParts.Length - 1]; if (jarFilename.Contains("-publish") || instance.Path.Contains("/publish/")) { instance.Runmode = Runmode.PUBLISH; } else { instance.Runmode = Runmode.AUTHOR; } string[] fileParts = jarFilename.Split('-', '.'); foreach (string filePart in fileParts) { int port = 0; if (int.TryParse(filePart, out port)) { instance.Port = port; } } if (pathParts.Length > 4) { string name = pathParts[pathParts.Length - 2]; if ("author".Equals(name) || "publish".Equals(name)) { name = pathParts[pathParts.Length - 3]; } instance.Name = name; } AemInstanceDialog dialog = new AemInstanceDialog(instance); if (dialog.ShowDialog(this) == DialogResult.OK) { instance.Save(); Program.InstanceList.Add(instance); Program.InstanceList.SortByName(); Program.UpdateInstanceListInViews(); } } }
private void setShowInTaskbarToolStripMenuItem_Click(object sender, EventArgs e) { AemInstance instance = this.SelectedInstanceInListview; if (instance == null) { return; } MenuItem menuItem = (MenuItem)sender; instance.ShowInTaskbar = !instance.ShowInTaskbar; menuItem.Checked = instance.ShowInTaskbar; instance.Save(); Program.UpdateInstanceListInViews(); }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { AemInstance instance = this.SelectedInstanceInListview; if (instance == null) { return; } AemInstanceDialog dialog = new AemInstanceDialog(instance); if (dialog.ShowDialog(this) == DialogResult.OK) { instance.Save(); Program.InstanceList.SortByName(); Program.UpdateInstanceListInViews(); } }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { if (openFileDialogJar.ShowDialog(this) == DialogResult.OK) { AemInstance instance = new AemInstance(); // auto-detect some instance properties instance.Path = openFileDialogJar.FileName; string[] pathParts = instance.Path.Split('/', '\\'); string jarFilename = pathParts[pathParts.Length-1]; if (jarFilename.Contains("-publish") || instance.Path.Contains("/publish/")) { instance.Runmode = Runmode.PUBLISH; } else { instance.Runmode = Runmode.AUTHOR; } string[] fileParts = jarFilename.Split('-','.'); foreach (string filePart in fileParts) { int port = 0; if (int.TryParse(filePart, out port)) { instance.Port = port; } } if (pathParts.Length > 4) { string name = pathParts[pathParts.Length - 2]; if ("author".Equals(name) || "publish".Equals(name)) { name = pathParts[pathParts.Length - 3]; } instance.Name = name; } AemInstanceDialog dialog = new AemInstanceDialog(instance); if (dialog.ShowDialog(this) == DialogResult.OK) { instance.Save(); Program.InstanceList.Add(instance); Program.InstanceList.SortByName(); Program.UpdateInstanceListInViews(); } } }