Skip to content

Commit

Permalink
renamed factory to repository in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveMoyer committed Nov 7, 2011
1 parent 643eeda commit 7b60b2e
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,6 @@ nToggle.suo
nToggle.vsmdi
TestResults/
*.user
_ReSharper*
_ReSharper*
obj
bin
14 changes: 7 additions & 7 deletions nToggle/Configuration/ToggleElement.cs
Expand Up @@ -6,15 +6,15 @@ namespace nToggle.Configuration
public class ToggleElement: ConfigurationElement
{
private const string ValueProperty = "value";
private const string FactoryProperty = "factory";
private const string RepositoryProperty = "repository";
private const string NameProperty = "name";
private const string DefaultFactoryClass = null;

public ToggleElement(String name,
String factory)
String repository)
{
Name = name;
Factory = factory;
Repository = repository;
}

public ToggleElement()
Expand All @@ -41,18 +41,18 @@ public string Name
}
}

[ConfigurationProperty(FactoryProperty,
[ConfigurationProperty(RepositoryProperty,
DefaultValue = DefaultFactoryClass,
IsRequired = false)]
public string Factory
public string Repository
{
get
{
return (string)this[FactoryProperty];
return (string)this[RepositoryProperty];
}
set
{
this[FactoryProperty] = value;
this[RepositoryProperty] = value;
}
}

Expand Down
4 changes: 2 additions & 2 deletions nToggle/FeatureToggleFactory.cs
Expand Up @@ -33,14 +33,14 @@ private static FeatureToggleFactory LoadFactory()
var staticToggleRepository = new StaticToggleRepository(toggleValueDictionary);
foreach (ToggleElement toggle in config.Toggles)
{
if (!toggle.Value || String.IsNullOrEmpty(toggle.Factory))
if (!toggle.Value || String.IsNullOrEmpty(toggle.Repository))
{
toggleRepositoryDictionary.Add(toggle.Name, staticToggleRepository);
toggleValueDictionary.Add(toggle.Name, toggle.Value);
}
else
{
var strings = toggle.Factory.Split(',');
var strings = toggle.Repository.Split(',');

var dynamicRepo =
(IFeatureToggleRepository) Activator.CreateInstance(strings[0], strings[1]).Unwrap();
Expand Down
4 changes: 2 additions & 2 deletions nToggle/Properties/AssemblyInfo.cs
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyVersion("0.0.0.3")]
[assembly: AssemblyFileVersion("0.0.0.3")]
Binary file removed nToggleDynamicFeatureTest/bin/Debug/nToggle.dll
Binary file not shown.
Binary file removed nToggleDynamicFeatureTest/bin/Debug/nToggle.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion nToggleWebTestApp/Web.config
Expand Up @@ -13,7 +13,7 @@
<toggles>
<add name="TestFeatureOn" value="True"/>
<add name="TestFeatureOff" value="False"/>
<add name="DynamicFeature" factory="nToggleDynamicFeatureTest,nToggleDynamicFeatureTest.TestDynamicRepository" value="True"/>
<add name="DynamicFeature" repository="nToggleDynamicFeatureTest,nToggleDynamicFeatureTest.TestDynamicRepository" value="True"/>
</toggles>
</nToggle>
<system.webServer>
Expand Down

0 comments on commit 7b60b2e

Please sign in to comment.