AEMManager.AemInstance.Save C# (CSharp) Method

Save() public method

public Save ( ) : void
return void
        public void Save()
        {
            RegistryKey instancesKey = RegistryUtil.GetUserKey("Instances");

              RegistryKey key = instancesKey.OpenSubKey(mId, true);
              if (key == null) {
            key = instancesKey.CreateSubKey(mId);
              }

              key.SetValue("AemInstanceType", mAemInstanceType.ToString());
              key.SetValue("Name", mName);
              key.SetValue("Hostname", mHostname);
              key.SetValue("Port", mPort);
              key.SetValue("ContextPath", mContextPath);
              key.SetValue("Path", mPath);
              key.SetValue("JavaExecutable", mJavaExecutable);
              key.SetValue("Username", mUsername);
              key.SetValue("Password", mPassword);
              key.SetValue("Runmode", mRunmode.ToString());
              key.SetValue("AdditionalRunmodes", mAdditionalRunmodes);
              key.SetValue("RunmodeSampleContent", mRunmodeSampleContent ? 1 : 0);
              key.SetValue("IconSet", mIconSet.ToString());
              key.SetValue("CustomIconPath", mCustomIconPath.ToString());
              key.SetValue("ShowInTaskbar", mShowInTaskbar ? 1 : 0);
              key.SetValue("HeapMinSizeMb", mHeapMinSizeMb);
              key.SetValue("HeapMaxSizeMb", mHeapMaxSizeMb);
              key.SetValue("MaxPermSizeMb", mMaxPermSizeMb);
              key.SetValue("JVMDebug", mJVMDebug ? 1 : 0);
              key.SetValue("DebugPort", mDebugPort);
              key.SetValue("JProfiler", mJProfiler ? 1 : 0);
              key.SetValue("JProfilerPort", mJProfilerPort);
              key.SetValue("JConsole", mJConsole ? 1 : 0);
              key.SetValue("JConsolePort", mJConsolePort);
              key.SetValue("HideConfigWizard", mHideConfigWizard ? 1 : 0);
              key.SetValue("ShowInstanceWindow", mShowInstanceWindow ? 1 : 0);
              key.SetValue("OpenBrowser", mOpenBrowser ? 1 : 0);
              key.SetValue("RemoteProcess", mRemoteProcess ? 1 : 0);
              key.SetValue("CustomJVMParam1Active", mCustomJVMParam1Active ? 1 : 0);
              key.SetValue("CustomJVMParam1", mCustomJVMParam1);
              key.SetValue("CustomJVMParam2Active", mCustomJVMParam2Active ? 1 : 0);
              key.SetValue("CustomJVMParam2", mCustomJVMParam2);
              key.SetValue("CustomJVMParam3Active", mCustomJVMParam3Active ? 1 : 0);
              key.SetValue("CustomJVMParam3", mCustomJVMParam3);
              key.SetValue("BrowserExecutable", mBrowserExecutable);
        }

Usage Example

Example #1
0
        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;
            }
        }
All Usage Examples Of AEMManager.AemInstance::Save