VAGSuite.AppSettings.AppSettings C# (CSharp) Method

AppSettings() public method

public AppSettings ( ) : System
return System
        public AppSettings()
        {
            // laad alle waarden uit het register
            RegistryKey TempKey = null;
            TempKey = Registry.CurrentUser.CreateSubKey("Software");

            using (RegistryKey Settings = TempKey.CreateSubKey("VAGEDCSuite"))
            {
                if (Settings != null)
                {
                    string[] vals = Settings.GetValueNames();
                    foreach (string a in vals)
                    {
                        try
                        {
                            if (a == "ViewInHex")
                            {
                                m_viewinhex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            if (a == "DebugMode")
                            {
                                m_debugmode = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            if (a == "AdminMode")
                            {
                                m_adminmode = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastFilename")
                            {
                                m_lastfilename = Settings.GetValue(a).ToString();
                            }
                            else if (a == "AutoChecksum")
                            {
                                m_AutoChecksum = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowAddressesInHex")
                            {
                                m_ShowAddressesInHex = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowGraphs")
                            {
                                m_ShowGraphs = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeNewWindows")
                            {
                                m_AutoSizeNewWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoSizeColumnsInWindows")
                            {
                                m_AutoSizeColumnsInWindows = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            else if (a == "ShowRedWhite")
                            {
                                m_ShowRedWhite = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DisableMapviewerColors")
                            {
                                m_DisableMapviewerColors = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameFile")
                            {
                                m_AutoDockSameFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoDockSameSymbol")
                            {
                                m_AutoDockSameSymbol = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "NewPanelsFloating")
                            {
                                m_NewPanelsFloating = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "AutoLoadLastFile")
                            {
                                m_AutoLoadLastFile = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewType")
                            {
                                m_DefaultViewType = (ViewType)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "DefaultViewSize")
                            {
                                m_DefaultViewSize = (ViewSize)Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "SynchronizeMapviewers")
                            {
                                m_SynchronizeMapviewers = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "SynchronizeMapviewersDifferentMaps")
                            {
                                m_SynchronizeMapviewersDifferentMaps = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "Skinname")
                            {
                                m_skinname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "RequestProjectNotes")
                            {
                                m_RequestProjectNotes = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ShowTablesUpsideDown")
                            {
                                m_ShowTablesUpsideDown = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }
                            else if (a == "LastProjectname")
                            {
                                m_lastprojectname = Settings.GetValue(a).ToString();
                            }
                            else if (a == "CodeBlockSyncActive" || a == "codeBlockSyncActive")
                            {
                                _codeBlockSyncActive = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            else if (a == "LastOpenedType")
                            {
                                m_LastOpenedType = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "SymbolDockWidth")
                            {
                                m_SymbolDockWidth = Convert.ToInt32(Settings.GetValue(a).ToString());
                            }
                            else if (a == "ProjectFolder")
                            {
                                m_ProjectFolder = Settings.GetValue(a).ToString();
                            }
                            else if (a == "RequestProjectNotes")
                            {
                                m_RequestProjectNotes = Convert.ToBoolean(Settings.GetValue(a).ToString());
                            }

                            //saveSettings.SetValue("RequestProjectNotes", m_RequestProjectNotes);
                            //saveSettings.SetValue("LastProjectname", m_lastprojectname);
                            //saveSettings.SetValue("LastOpenedType", m_LastOpenedType);
                            //saveSettings.SetValue("ProjectFolder", m_ProjectFolder);
                            //saveSettings.SetValue("RequestProjectNotes", m_RequestProjectNotes);

                        }
                        catch (Exception E)
                        {
                            Console.WriteLine("error retrieving registry settings: " + E.Message);
                        }

                    }
                }
            }
        }