aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Iis/wixext/Symbols/CertificateHashSymbol.cs
blob: 866d474cbd1094541778bac87601285c5cfa0b77 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// 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.Iis
{
    using WixToolset.Data;
    using WixToolset.Iis.Symbols;

    public static partial class IisSymbolDefinitions
    {
        public static readonly IntermediateSymbolDefinition CertificateHash = new IntermediateSymbolDefinition(
            IisSymbolDefinitionType.CertificateHash.ToString(),
            new[]
            {
                new IntermediateFieldDefinition(nameof(CertificateHashSymbolFields.CertificateRef), IntermediateFieldType.String),
                new IntermediateFieldDefinition(nameof(CertificateHashSymbolFields.Hash), IntermediateFieldType.String),
            },
            typeof(CertificateHashSymbol));
    }
}

namespace WixToolset.Iis.Symbols
{
    using WixToolset.Data;

    public enum CertificateHashSymbolFields
    {
        CertificateRef,
        Hash,
    }

    public class CertificateHashSymbol : IntermediateSymbol
    {
        public CertificateHashSymbol() : base(IisSymbolDefinitions.CertificateHash, null, null)
        {
        }

        public CertificateHashSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.CertificateHash, sourceLineNumber, id)
        {
        }

        public IntermediateField this[CertificateHashSymbolFields index] => this.Fields[(int)index];

        public string CertificateRef
        {
            get => this.Fields[(int)CertificateHashSymbolFields.CertificateRef].AsString();
            set => this.Set((int)CertificateHashSymbolFields.CertificateRef, value);
        }

        public string Hash
        {
            get => this.Fields[(int)CertificateHashSymbolFields.Hash].AsString();
            set => this.Set((int)CertificateHashSymbolFields.Hash, value);
        }
    }
}