Click here to Skip to main content
13,043,491 members (50,924 online)
Click here to Skip to main content
Add your own
alternative version


1 bookmarked
Posted 26 Dec 2012

Cinchoo - Configuration Object Binding Modes

, 26 Dec 2012
Rate this:
Please Sign up or sign in to vote.
Available Binding Modes supported by Cinchoo configuration framework


Cinchoo is the application framework for .NET. One of the main functionality it provides to the users is that application configuration management. Application configuration is the information that application reads and/or writes at run-time from the source.  Please take a look at 'Cinchoo - Simplified Configuration Manager' jump start article on using configuration framework in your application. 

In this article, I'll talk about the available binding modes supported by Cinchoo configuration framework. Binding mode is the direction of data flowing between Configuration object and datasource . Below are the list of binding modes available for us. (these are of ChoConfigurationBindingMode type) 

  1. TwoWay – (Default) The changes are flown both way between configuration section object and data source.
  2. OneWay – The changes are flown only from data source to configuration section object.
  3. OneWayToSource – The changes are flown only from configuration section object to data source.
  4. OneTime – The configuration settings are read and loaded into configuration section object once. Any changes made either in the configuration section object or data source are not propagated between them. 

Using the code 

There are couple of ways, you can specify binding mode for configuration object

  • Declarative
  • Configuration   

Declarative Way 

Using ChoConfigurationSectionAttribute, you can specify the binding mode as below 

[ChoConfigurationSection("sample", [__strong__]BindingMode = ChoConfigurationBindingMode.TwoWay)]
public class SampleConfigSection : ChoConfigurableObject
    [ChoPropertyInfo("name", DefaultValue = "Mark")]
    public string Name;

    [ChoPropertyInfo("message", DefaultValue = "Hello World!")]
    public string Message;

Configuration Way

Some cases, you may want to control the binding mode through configuration. This approach will help to prevent the code base being modified for each change. Here is how you can do 

  1. Open Bin/Config/Meta/[AppExeName].meta file
  2. Locate 'sample' element under 'configuration' node, modify BindingMode attribute.
<?xml version="1.0" encoding="utf-8"?>
  <sample bindingMode="TwoWay" defaultable="true" silent="true" ignoreCase="true">
    <configStorage>Cinchoo.Core.Configuration.ChoFileNameValueConfigStorage, Cinchoo.Core, 
      Version=, Culture=neutral, PublicKeyToken=b7dacd80ff3e33de</configStorage>
    <logInfo condition="true" directory="Settings" 

         fileName="MyFirstConfigSample.Program+AppSettings.log" />

That's all. Try it. Thanks. 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 26 Dec 2012
Article Copyright 2012 by Cinchoo
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid