Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried that as well, but I never got it to work like that. I just figured loading a .config automatically doesn't work for .dll's only for .exe's. Then I gave up and decided it would be easier to just load the .config file manually. You can see the full code here: <a href="https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/blob/master/EANavigator/NavigatorSettings.cs" rel="nofollow">https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/blob/master/EANavigator/NavigatorSettings.cs</a> This is the most relevant part:</p> <pre><code>public NavigatorSettings() { Configuration roamingConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoaming); // the roamingConfig now get a path such as C:\Users\&lt;user&gt;\AppData\Roaming\Sparx_Systems_Pty_Ltd\DefaultDomain_Path_2epjiwj3etsq5yyljkyqqi2yc4elkrkf\9,_2,_0,_921\user.config // which I don't like. So we move up three directories and then add a directory for the EA Navigator so that we get // C:\Users\&lt;user&gt;\AppData\Roaming\GeertBellekens\EANavigator\user.config string configFileName = System.IO.Path.GetFileName(roamingConfig.FilePath); string configDirectory = System.IO.Directory.GetParent(roamingConfig.FilePath).Parent.Parent.Parent.FullName; string newConfigFilePath = configDirectory + @"\Geert Bellekens\EANavigator\" + configFileName; // Map the roaming configuration file. This // enables the application to access // the configuration file using the // System.Configuration.Configuration class ExeConfigurationFileMap configFileMap = new ExeConfigurationFileMap(); configFileMap.ExeConfigFilename = newConfigFilePath; // Get the mapped configuration file. currentConfig = ConfigurationManager.OpenMappedExeConfiguration(configFileMap, ConfigurationUserLevel.None); // merge the default settings this.mergeDefaultSettings(); } </code></pre> <p>Accessing a configuration property:</p> <pre><code>public bool trackSelectedElement { get { bool result; if(bool.TryParse(this.currentConfig.AppSettings.Settings["trackSelectedElement"].Value, out result)) { return result; } else { return true; } } set { this.currentConfig.AppSettings.Settings["trackSelectedElement"].Value = value.ToString(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload