aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Bal/WixToolset.Mba.Host/SupportedFrameworkElementCollection.cs
blob: 12c7cf3e6324d7c9642040deddea9f687a6927bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Mba.Host
{
    using System;
    using System.Configuration;
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Handler for the supportedFramework collection.
    /// </summary>
    [SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface")]
    [ConfigurationCollection(typeof(SupportedFrameworkElement), AddItemName = "supportedFramework", CollectionType = ConfigurationElementCollectionType.BasicMap)]
    public sealed class SupportedFrameworkElementCollection : ConfigurationElementCollection
    {
        public override ConfigurationElementCollectionType CollectionType
        {
            get { return ConfigurationElementCollectionType.BasicMap; }
        }

        protected override string ElementName
        {
            get { return "supportedFramework"; }
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new SupportedFrameworkElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return (element as SupportedFrameworkElement).Version;
        }
    }
}