Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
soroshsabz committed Jul 19, 2016
2 parents 57f4ef2 + c1a969c commit 9286c37
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ usage:
- Install PCLAppConfig package from [nuget](https://www.nuget.org/packages/PCLAppConfig) to your PCL projects.
- Initialize ConfigurationManager.AppSettings on your portable project like below

```
``` C#
Assembly assembly = typeof(App).GetTypeInfo().Assembly;
ConfigurationManager.AppSettings = new ConfigurationManager(assembly.GetManifestResourceStream("DemoApp.App.config")).GetAppSettings;
```

- Add an app.config on your shared pcl project and ensure that Build Action:EmbeddedResource, and add your appSettings entries, as you would do with any app.config

```
``` xml
<configuration>
<appSettings>
<add key="config.text" value="hello from app.settings!" />
Expand All @@ -32,8 +32,9 @@ ConfigurationManager.AppSettings = new ConfigurationManager(assembly.GetManifest

- Access your setting:

```
ConfigurationManager.AppSettings.FirstOrDefault(x => x.Key == "webapiaddress").Value;
``` C#
ConfigurationManager.AppSettings["webapiaddress"]; // New API, not available in package yet.
ConfigurationManager.AppSettings.FirstOrDefault(x => x.Key == "webapiaddress").Value; // Old API currently available on package.
```

## Roadmap
Expand Down

0 comments on commit 9286c37

Please sign in to comment.