aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data.WindowsInstaller/Rows/WixSimpleReferenceRow.cs
blob: 3a2cf8f19cd2219b221280dd9989461de109cde6 (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
56
57
58
59
60
61
62
63
// 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.Data.Rows
{
    using System;
    using System.Diagnostics;
    using System.Xml;

    /// <summary>
    /// Specialization of a row for the WixSimpleReference table.
    /// </summary>
    public sealed class WixSimpleReferenceRow : Row
    {
        /// <summary>
        /// Creates a WixSimpleReferenceRow that belongs to a table.
        /// </summary>
        /// <param name="sourceLineNumbers">Original source lines for this row.</param>
        /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
        public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, Table table)
            : base(sourceLineNumbers, table)
        {
        }

        /// <summary>
        /// Creates a WixSimpleReferenceRow that belongs to a table.
        /// </summary>
        /// <param name="sourceLineNumbers">Original source lines for this row.</param>
        /// <param name="tableDefinitions">Table definitions for this row.</param>
        public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinitions)
            : base(sourceLineNumbers, tableDefinitions)
        {
        }

        /// <summary>
        /// Gets or sets the primary keys of the simple reference.
        /// </summary>
        /// <value>The primary keys of the simple reference.</value>
        public string PrimaryKeys
        {
            get { return (string)this.Fields[1].Data; }
            set { this.Fields[1].Data = value; }
        }

        /// <summary>
        /// Gets the symbolic name.
        /// </summary>
        /// <value>Symbolic name.</value>
        public string SymbolicName
        {
            get { return String.Concat(this.TableName, ":", this.PrimaryKeys); }
        }

        /// <summary>
        /// Gets or sets the table name of the simple reference.
        /// </summary>
        /// <value>The table name of the simple reference.</value>
        public string TableName
        {
            get { return (string)this.Fields[0].Data; }
            set { this.Fields[0].Data = value; }
        }
    }
}