You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@@ -0,0 +1,84 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user