ContextHelpFile.Text = applicationProgram.ContextHelpFile;
            mApplicationGui.textAppIconFile.Text = applicationProgram.IconFile;
            mApplicationGui.textAppDefaultLanguage.Text = applicationProgram.DefaultLanguage;
            mApplicationGui.checkBoxAppDynamicTableManagement.Checked = applicationProgram.DynamicTableManagement;
            mApplicationGui.checkBoxAppLinkable.Checked = applicationProgram.Linkable;
            mApplicationGui.checkBoxAppIsSecureEnabled.Checked = applicationProgram.IsSecureEnabled;
            mApplicationGui.textAppMinEtsVersion.Text = applicationProgram.MinEtsVersion;
            mApplicationGui.textAppOriginalManufacturer.Text = applicationProgram.OriginalManufacturer;
            mApplicationGui.checkBoxAppPreEts4Style.Checked = applicationProgram.PreEts4Style;
            mApplicationGui.checkBoxAppConvertedFromPreEts4Data.Checked = applicationProgram.ConvertedFromPreEts4Data;
            mApplicationGui.checkBoxAppCreatedFromLegacySchemaVersion.Checked = applicationProgram.CreatedFromLegacySchemaVersion;
            mApplicationGui.comboBoxAppIPConfig.SelectedItem = HandleKnxDataTypes.ReadKNXType(applicationProgram.IPConfig);
            mApplicationGui.numericAppAdditionalAdressesCount.Value = applicationProgram.AdditionalAddressesCount;
            mApplicationGui.numericAppMaxUsersEntries.Value = applicationProgram.MaxUserEntries;
            mApplicationGui.numericAppMaxTunnelingUserEntries.Value = applicationProgram.MaxTunnelingUserEntries;
            mApplicationGui.numericAppMaxSecurityIndividualAddressEntries.Value = applicationProgram.MaxSecurityIndividualAddressEntries;
            mApplicationGui.numericAppMaxSecurityGroupKeyTableEntries.Value = applicationProgram.MaxSecurityGroupKeyTableEntries;
            mApplicationGui.numericAppMaxSecurityP2PKeyTableEntries.Value = applicationProgram.MaxSecurityP2PKeyTableEntries;
            mApplicationGui.numericAppMaxSecurityProxyGroupKeyTableEntries.Value = applicationProgram.MaxSecurityProxyGroupKeyTableEntries;
            mApplicationGui.numericAppMaxSecurityProxyIndividualAddressTableEntries.Value = applicationProgram.MaxSecurityProxyIndividualAddressTableEntries;
            mApplicationGui.numericAppNonRegRelevantDataVersion.Value = applicationProgram.NonRegRelevantDataVersion;
            mApplicationGui.checkBoxAppBroken.Checked = applicationProgram.Broken;
            mApplicationGui.checkBoxAppDownloadInfoComplete.Checked = applicationProgram.DownloadInfoIncomplete;
            mApplicationGui.textAppReplacesVersions.Text = applicationProgram.ReplacesVersions.ToNullString();
            HandleKnxDataTypes.ReadKNXType(mApplicationGui.listAppHash, applicationProgram.Hash);
            mApplicationGui.textAppInternalDescription.Text = applicationProgram.InternalDescription;
            mApplicationGui.textAppSemantics.Text = applicationProgram.Semantics;

            mApplicationGui.dgvAppProgAppTranslations.Rows.Clear();
            LanguageProcessing.FillLanguageDataGridView(ApplicationProgramGui.selectedApplicationManufacturer.Languages, mApplicationGui.dgvAppProgAppTranslations, applicationProgram.Id, "Name");
        }

        /********************************************************************************************************************************/
        // Application Edit

        private void buttonApplicationSave_Click(object sender, EventArgs e)
        {
            ApplicationProgram_t newApplicationProgram = DynamicTreeViewGui.GetSelectedTreeNode().Tag as ApplicationProgram_t;

            newApplicationProgram.ProgramType = HandleGuiDataTypes.ReadApplicationProgramType(comboBoxAppProgramType.SelectedItem.ToString());
            newApplicationProgram.MaskVersion = comboBoxAppMaskVersion.SelectedItem.ToString();
            newApplicationProgram.VisibleDescription = Extensions.NullIfEmpty(textAppVisibleDescription.Text);
            newApplicationProgram.Name = Extensions.NullIfEmpty(textAppName.Text);
            newApplicationProgram.LoadProcedureStyle = HandleGuiDataTypes.ReadLoadProcedureStyle(comboBoxAppLoadProcedureStyle.SelectedItem.ToString());
            newApplicationProgram.PeiType = (byte)numericAppPeiType.Value;
            newApplicationProgram.HelpTopicSpecified = checkBoxAppHelpTopicSpecified.Checked;
            newApplicationProgram.HelpTopic = (uint)numericAppHelpTopic.Value;
            newApplicationProgram.HelpFile = Extensions.NullIfEmpty(textAppHelpFile.Text);
            newApplicationProgram.ContextHelpFile = Extensions.NullIfEmpty(textAppContextHelpFile.Text);
            newApplicationProgram.IconFile = Extensions.NullIfEmpty(textAppIconFile.Text);
            newApplicationProgram.DefaultLanguage = Extensions.NullIfEmpty(textAppDefaultLanguage.Text);
            newApplicationProgram.DynamicTableManagement = checkBoxAppDynamicTableManagement.Checked;
            newApplicationProgram.Linkable = checkBoxAppLinkable.Checked;
            newApplicationProgram.IsSecureEnabled = checkBoxAppIsSecureEnabled.Checked;
            newApplicationProgram.MinEtsVersion = Extensions.NullIfEmpty(textAppMinEtsVersion.Text);
            newApplicationProgram.OriginalManufacturer = Extensions.NullIfEmpty(textAppOriginalManufacturer.Text);
            newApplicationProgram.PreEts4Style = checkBoxAppPreEts4Style.Checked;
            newApplicationProgram.ConvertedFromPreEts4Data = checkBoxAppConvertedFromPreEts4Data.Checked;
            newApplicationProgram.CreatedFromLegacySchemaVersion = checkBoxAppCreatedFromLegacySchemaVersion.Checked;
            newApplicationProgram.IPConfig = HandleGuiDataTypes.ReadApplicationProgramIPConfig(comboBoxAppIPConfig.SelectedItem.ToString());
            newApplicationProgram.AdditionalAddressesCount = (int)numericAppAdditionalAdressesCount.Value;
            newApplicationProgram.MaxUserEntries = (ushort)numericAppMaxUsersEntries.Value;
            newApplicationProgram.MaxTunnelingUserEntries = (ushort)numericAppMaxTunnelingUserEntries.Value;
            newApplicationProgram.MaxSecurityIndividualAddressEntries = (ushort)numericAppMaxSecurityIndividualAddressEntries.Value;
            newApplicationProgram.MaxSecurityGroupKeyTableEntries = (ushort)numericAppMaxSecurityGroupKeyTableEntries.Value;
            newApplicationProgram.MaxSecurityP2PKeyTableEntries = (ushort)numericAppMaxSecurityP2PKeyTableEntries.Value;
            newApplicationProgram.MaxSecurityProxyGroupKeyTableEntries = (ushort)numericAppMaxSecurityProxyGroupKeyTableEntries.Value;
            newApplicationProgram.MaxSecurityProxyIndividualAddressTableEntries = (ushort)numericAppMaxSecurityProxyIndividualAddressTableEntries.Value;
            newApplicationProgram.NonRegRelevantDataVersion = (ushort)numericAppNonRegRelevantDataVersion.Value;
            newApplicationProgram.Broken = checkBoxAppBroken.Checked;
            newApplicationProgram.DownloadInfoIncomplete = checkBoxAppDownloadInfoComplete.Checked;
            newApplicationProgram.ReplacesVersions = Extensions.NullIfEmpty(textAppReplacesVersions.Text);
            newApplicationProgram.Hash = HandleGuiDataTypes.ReadGuiType(listAppHash);
            newApplicationProgram.InternalDescription = Extensions.NullIfEmpty(textAppInternalDescription.Text);
            newApplicationProgram.Semantics = Extensions.NullIfEmpty(textAppSemantics.Text);

            LanguageProcessing.WriteLanguageData(ApplicationProgramGui.selectedApplicationManufacturer.Languages, dgvAppProgAppTranslations, newApplicationProgram.Id, "Name", ApplicationProgramGui.selectedApplicationProgram.Id);


            // Die Operationen zur Anpassung der ApplicationProgram Id müssen zuletzt durchgeführt werden, da die Dateien gespeichert und wieder geöffnet werden müssen
            ushort appNumber = (ushort)numericAppApplicationNumber.Value;

            // Die ApplicationVersion wird in der ETS als "Programmversion" angezeigt.
            // Allerdings wird der Wert dezimal in der xml abgelegt, in der ETS wird der hexadezimale Wert geteilt durch 10 angezeigt
            string appVersionString = ((int)(numericAppApplicationVersion.Value * 10)).ToString();
            byte appVersion = byte.Parse(appVersionString, System.Globalization.NumberStyles.HexNumber);

            // Die Application Id besteht aus dem Manufacturer, der ApplicationNumer in dezimal, der ApplicationVersion in dezimal und einer Id in hexadezimal
            string newAppId = ApplicationProgramGui.selectedApplicationManufacturer.RefId + "_A-" + appNumber.ToString("X4") + "-" + appVersion.ToString("X2") + "-" + ((int)numericAppIdIdentifier.Value).ToString("X4");
            string oldAppId = ApplicationProgramGui.selectedApplicationProgram.Id;
            if (newAppId!= oldAppId)
            {
                newApplicationProgram.ApplicationNumber = appNumber;
                newApplicationProgram.ApplicationVersion = appVersion;
                ChangeApplicationId(Application