Files
dotnet-bot adf899c629 Adding System.Data..., System.ServiceModel..., and System.Web...
Adding reference source for
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Entity.Design
System.Data.Linq
System.Data.SqlXml
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Activities
System.ServiceModel.Channels
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.WasHosting
System.ServiceModel.Web
System.Web
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Entity
System.Web.Entity.Design
System.Web.Extensions
System.Web.Mobile
System.Web.Routing
System.Web.Services
System.Xml
System.Xml.Linq
2016-05-03 00:07:37 +02:00

85 lines
2.4 KiB
C#

//------------------------------------------------------------------------------
// <copyright file="LocalDB.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// <owner current="true" primary="true">antonam</owner>
//------------------------------------------------------------------------------
namespace System.Data
{
using System.Configuration;
using System.Collections;
internal sealed class LocalDBInstanceElement : ConfigurationElement
{
[ConfigurationProperty("name", IsRequired = true)]
public string Name
{
get
{
return this["name"] as string;
}
}
[ConfigurationProperty("version", IsRequired = true)]
public string Version
{
get
{
return this["version"] as string;
}
}
}
internal sealed class LocalDBInstancesCollection : ConfigurationElementCollection
{
private class TrimOrdinalIgnoreCaseStringComparer : IComparer
{
public int Compare(object x, object y)
{
string xStr = x as string;
if (xStr != null)
x = xStr.Trim();
string yStr = y as string;
if (yStr != null)
y = yStr.Trim();
return StringComparer.OrdinalIgnoreCase.Compare(x,y);
}
}
static readonly TrimOrdinalIgnoreCaseStringComparer s_comparer = new TrimOrdinalIgnoreCaseStringComparer();
internal LocalDBInstancesCollection()
: base(s_comparer)
{
}
protected override ConfigurationElement CreateNewElement()
{
return new LocalDBInstanceElement();
}
protected override object GetElementKey(ConfigurationElement element)
{
return ((LocalDBInstanceElement)element).Name;
}
}
internal sealed class LocalDBConfigurationSection : ConfigurationSection
{
[ConfigurationProperty("localdbinstances", IsRequired = true)]
public LocalDBInstancesCollection LocalDbInstances
{
get
{
return (LocalDBInstancesCollection)this["localdbinstances"] ?? new LocalDBInstancesCollection();
}
}
}
}