aboutsummaryrefslogtreecommitdiff
path: root/src/dtf/WixToolset.Dtf.WindowsInstaller/InstallCost.cs
blob: f29612d61211a27c94f9de1fb2f47d38dd16cadf (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
64
65
66
67
// 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.Dtf.WindowsInstaller
{
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Represents a per-drive disk space cost for an installation.
    /// </summary>
    [SuppressMessage("Microsoft.Performance", "CA1815:OverrideEqualsAndOperatorEqualsOnValueTypes")]
    public struct InstallCost
    {
        private string driveName;
        private long cost;
        private long tempCost;

        /// <summary>
        /// Creates a new InstallCost object.
        /// </summary>
        /// <param name="driveName">name of the drive this cost data applies to</param>
        /// <param name="cost">installation cost on this drive, as a number of bytes</param>
        /// <param name="tempCost">temporary disk space required on this drive, as a number of bytes</param>
        internal InstallCost(string driveName, long cost, long tempCost)
        {
            this.driveName = driveName;
            this.cost = cost;
            this.tempCost = tempCost;
        }

        /// <summary>
        /// The name of the drive this cost data applies to.
        /// </summary>
        public string DriveName
        {
            get
            {
                return this.driveName;
            }
        }

        /// <summary>
        /// The installation cost on this drive, as a number of bytes.
        /// </summary>
        public long Cost
        {
            get
            {
                return this.cost;
            }
        }

        /// <summary>
        /// The temporary disk space required on this drive, as a number of bytes.
        /// </summary>
        /// <remarks><p>
        /// This temporary space requirement is space needed only for the duration
        /// of the installation, over the final footprint on disk.
        /// </p></remarks>
        public long TempCost
        {
            get
            {
                return this.tempCost;
            }
        }
    }
}