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);
}