init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
|
@ -0,0 +1,66 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using Kreta.Core.MessageBroker.Azure.EventHub.Client.Configuration;
|
||||
|
||||
namespace Kreta.MessageBroker.Configuration
|
||||
{
|
||||
public class EventHubClientConfigurationElementCollection : ConfigurationElementCollection, IEnumerable<IAzureEventHubClientConfiguration>
|
||||
{
|
||||
#region [Properties]
|
||||
|
||||
/// <summary>
|
||||
/// Collection type
|
||||
/// </summary>
|
||||
public override ConfigurationElementCollectionType CollectionType
|
||||
{
|
||||
get { return ConfigurationElementCollectionType.BasicMap; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get element name
|
||||
/// </summary>
|
||||
protected override string ElementName
|
||||
{
|
||||
get { return "EventHub"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region [Private/Protected Methods]
|
||||
|
||||
/// <summary>
|
||||
/// Create new element
|
||||
/// </summary>
|
||||
/// <returns>Configuration element</returns>
|
||||
protected override ConfigurationElement CreateNewElement()
|
||||
{
|
||||
return new EventHubClientConfigurationElement();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get element key
|
||||
/// </summary>
|
||||
/// <param name="element">Element</param>
|
||||
/// <returns>Element key</returns>
|
||||
protected override object GetElementKey(ConfigurationElement element)
|
||||
{
|
||||
return ((EventHubClientConfigurationElement)element).Name;
|
||||
}
|
||||
|
||||
IEnumerator<IAzureEventHubClientConfiguration> IEnumerable<IAzureEventHubClientConfiguration>.GetEnumerator()
|
||||
{
|
||||
var enumerator = base.GetEnumerator();
|
||||
|
||||
var eventHubClientConfiguration = new List<IAzureEventHubClientConfiguration>();
|
||||
|
||||
while (enumerator.MoveNext())
|
||||
{
|
||||
eventHubClientConfiguration.Add((IAzureEventHubClientConfiguration)enumerator.Current);
|
||||
}
|
||||
|
||||
return eventHubClientConfiguration.GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue