-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor of consumption peasy 2.0 complete
- Loading branch information
Aaron Hanusa
committed
Jun 24, 2017
1 parent
8675366
commit 47c199b
Showing
7 changed files
with
120 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Orders.com.Web.MVC/Configuration/DIConstructorArgConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Configuration; | ||
|
||
namespace Orders.com.Web.MVC.Configuration | ||
{ | ||
public class DIConstructorArgConfig : ConfigurationElement | ||
{ | ||
[ConfigurationProperty("argumentName")] | ||
public string ArgumentName | ||
{ | ||
get { return (string)base["argumentName"]; } | ||
set { base["argumentName"] = value; } | ||
} | ||
|
||
[ConfigurationProperty("value")] | ||
public string Value | ||
{ | ||
get { return (string)base["value"]; } | ||
set { base["value"] = value; } | ||
} | ||
|
||
[ConfigurationProperty("type")] | ||
public string Type | ||
{ | ||
get { return (string)base["type"]; } | ||
set { base["type"] = value; } | ||
} | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
Orders.com.Web.MVC/Configuration/DIConstructorArgConfigList.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
|
||
namespace Orders.com.Web.MVC.Configuration | ||
{ | ||
[ConfigurationCollection(typeof(DIConstructorArgConfig))] | ||
public class DIConstructorArgConfigList : ConfigurationElementCollection, IEnumerable<DIConstructorArgConfig> | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="DIConstructorArgConfig"/> configuration element at the specified index. | ||
/// </summary> | ||
/// <returns>The specified <see cref="DIConstructorArgConfig"/> configuration element.</returns> | ||
/// <param name="index">The index to retrieve.</param> | ||
public DIConstructorArgConfig this[int index] | ||
{ | ||
get { return (DIConstructorArgConfig)BaseGet(index); } | ||
} | ||
|
||
/// <summary> | ||
/// Adds the specified entry. | ||
/// </summary> | ||
/// <param name="entry">The entry.</param> | ||
public void Add(DIConstructorArgConfig entry) | ||
{ | ||
this.BaseAdd(entry); | ||
} | ||
|
||
/// <summary> | ||
/// Creates a new <see cref="DIConstructorArgConfig"/>. | ||
/// </summary> | ||
/// <returns> | ||
/// A new <see cref="DIConstructorArgConfig"/>. | ||
/// </returns> | ||
protected override ConfigurationElement CreateNewElement() | ||
{ | ||
return new DIConstructorArgConfig(); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the element key for a specified configuration element. | ||
/// </summary> | ||
/// <param name="element">The <see cref="FileDestinationConfig"/> to return the key for.</param> | ||
/// <returns> | ||
/// An <see cref="T:System.String"/> that acts as the key for the specified <see cref="FileDestinationConfig"/>. | ||
/// </returns> | ||
protected override object GetElementKey(ConfigurationElement element) | ||
{ | ||
return ((DIConstructorArgConfig)element).ArgumentName; | ||
} | ||
|
||
public IEnumerable<DIConstructorArgConfig> GetAll() | ||
{ | ||
for (int i = 0; i < this.Count; i++) | ||
yield return this[i]; | ||
} | ||
|
||
public new IEnumerator<DIConstructorArgConfig> GetEnumerator() | ||
{ | ||
return GetAll().GetEnumerator(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters