aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-07-21 14:21:53 -0700
committerRob Mensching <rob@firegiant.com>2020-07-21 14:33:33 -0700
commite2b9ee292ecb8fd23843f815600817cba7438b2a (patch)
treec91ac781017929fb93181ca54555c2d0bc1653e4 /src
parent7a6445ddf8d67c1308c0e3f20bf7470cc9baf61c (diff)
downloadwix-e2b9ee292ecb8fd23843f815600817cba7438b2a.tar.gz
wix-e2b9ee292ecb8fd23843f815600817cba7438b2a.tar.bz2
wix-e2b9ee292ecb8fd23843f815600817cba7438b2a.zip
Move SymbolWithSection to internal implementation detail of Core
Diffstat (limited to 'src')
-rw-r--r--src/WixToolset.Data/SymbolWithSection.cs90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/WixToolset.Data/SymbolWithSection.cs b/src/WixToolset.Data/SymbolWithSection.cs
deleted file mode 100644
index 89a5fccd..00000000
--- a/src/WixToolset.Data/SymbolWithSection.cs
+++ /dev/null
@@ -1,90 +0,0 @@
1// 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.
2
3namespace WixToolset.Data
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Linq;
8
9 /// <summary>
10 /// Symbol with section representing a single unique symbol.
11 /// </summary>
12 public sealed class SymbolWithSection
13 {
14 private HashSet<SymbolWithSection> possibleConflicts;
15 private HashSet<SymbolWithSection> redundants;
16
17 /// <summary>
18 /// Creates a symbol for a symbol.
19 /// </summary>
20 /// <param name="symbol">Symbol for the symbol</param>
21 public SymbolWithSection(IntermediateSection section, IntermediateSymbol symbol)
22 {
23 this.Symbol = symbol;
24 this.Section = section;
25 this.Name = String.Concat(this.Symbol.Definition.Name, ":", this.Symbol.Id.Id);
26 }
27
28 /// <summary>
29 /// Gets the accessibility of the symbol which is a direct reflection of the accessibility of the row's accessibility.
30 /// </summary>
31 /// <value>Accessbility of the symbol.</value>
32 public AccessModifier Access => this.Symbol.Id.Access;
33
34 /// <summary>
35 /// Gets the name of the symbol.
36 /// </summary>
37 /// <value>Name of the symbol.</value>
38 public string Name { get; }
39
40 /// <summary>
41 /// Gets the symbol for this symbol.
42 /// </summary>
43 /// <value>Symbol for this symbol.</value>
44 public IntermediateSymbol Symbol { get; }
45
46 /// <summary>
47 /// Gets the section for the symbol.
48 /// </summary>
49 /// <value>Section for the symbol.</value>
50 public IntermediateSection Section { get; }
51
52 /// <summary>
53 /// Gets any duplicates of this symbol with sections that are possible conflicts.
54 /// </summary>
55 public IEnumerable<SymbolWithSection> PossiblyConflicts => this.possibleConflicts ?? Enumerable.Empty<SymbolWithSection>();
56
57 /// <summary>
58 /// Gets any duplicates of this symbol with sections that are redundant.
59 /// </summary>
60 public IEnumerable<SymbolWithSection> Redundants => this.redundants ?? Enumerable.Empty<SymbolWithSection>();
61
62 /// <summary>
63 /// Adds a duplicate symbol with sections that is a possible conflict.
64 /// </summary>
65 /// <param name="symbolWithSection">Symbol with section that is a possible conflict of this symbol.</param>
66 public void AddPossibleConflict(SymbolWithSection symbolWithSection)
67 {
68 if (null == this.possibleConflicts)
69 {
70 this.possibleConflicts = new HashSet<SymbolWithSection>();
71 }
72
73 this.possibleConflicts.Add(symbolWithSection);
74 }
75
76 /// <summary>
77 /// Adds a duplicate symbol that is redundant.
78 /// </summary>
79 /// <param name="symbolWithSection">Symbol with section that is redundant of this symbol.</param>
80 public void AddRedundant(SymbolWithSection symbolWithSection)
81 {
82 if (null == this.redundants)
83 {
84 this.redundants = new HashSet<SymbolWithSection>();
85 }
86
87 this.redundants.Add(symbolWithSection);
88 }
89 }
90}