Skip to content

Commit dd2035d

Browse files
Robert Holtrjmholt
authored andcommitted
Add missing docs
1 parent 6bdbc20 commit dd2035d

File tree

3 files changed

+68
-108
lines changed

3 files changed

+68
-108
lines changed

PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Commands/NewPSCompatibilityProfileCommand.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,23 @@ public class NewPSCompatibilityProfileCommand : PSCmdlet
6060
[Parameter(ParameterSetName = "ProfileName")]
6161
public string ProfileName { get; set; }
6262

63+
/// <summary>
64+
/// If set, validate the generated profile before returning it.
65+
/// </summary>
6366
[Parameter]
6467
public SwitchParameter Validate { get; set; }
6568

69+
/// <summary>
70+
/// Modules on paths starting with any of these will be excluded.
71+
/// </summary>
72+
/// <value></value>
6673
[Parameter]
6774
public string[] ExcludeModulePathPrefix { get; set; }
6875

76+
/// <summary>
77+
/// Assemblies on paths starting with any of these will be excluded.
78+
/// </summary>
79+
/// <value></value>
6980
[Parameter]
7081
public string[] ExcludeAssemblyPathPrefix { get; set; }
7182

PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Common/ReadOnlySet.cs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,109 +7,166 @@
77

88
namespace Microsoft.PowerShell.CrossCompatibility
99
{
10+
/// <summary>
11+
/// A readonly set implementation that has set semantics and functions but is immutable.
12+
/// </summary>
13+
/// <typeparam name="T">The type of items in the set.</typeparam>
1014
public class ReadOnlySet<T> : IEnumerable<T>, IReadOnlyCollection<T>, ISet<T>
1115
{
1216
private readonly HashSet<T> _backingSet;
1317

18+
/// <summary>
19+
/// Construct a new ReadOnlySet around the given items.
20+
/// </summary>
21+
/// <param name="items">The set elements.</param>
1422
public ReadOnlySet(IEnumerable<T> items)
1523
{
1624
_backingSet = new HashSet<T>(items);
1725
}
1826

27+
/// <summary>
28+
/// Construct a new ReadOnlySet around the given items with the given comparer.
29+
/// </summary>
30+
/// <param name="items">The set elements.</param>
31+
/// <param name="itemComparer">The comparer to evaluate item equality.</param>
1932
public ReadOnlySet(IEnumerable<T> items, IEqualityComparer<T> itemComparer)
2033
{
2134
_backingSet = new HashSet<T>(items, itemComparer);
2235
}
2336

37+
/// <summary>
38+
/// The number of items in the set.
39+
/// </summary>
2440
public int Count => _backingSet.Count;
2541

42+
/// <summary>
43+
/// Indicates that this set is readonly.
44+
/// </summary>
2645
public bool IsReadOnly => true;
2746

47+
/// <summary>
48+
/// DO NOT USE.
49+
/// </summary>
2850
public bool Add(T item)
2951
{
3052
throw new InvalidOperationException("Cannot add item to readonly set");
3153
}
3254

55+
/// <summary>
56+
/// DO NOT USE.
57+
/// </summary>
3358
public void Clear()
3459
{
3560
throw new InvalidOperationException("Cannot modify a readonly set");
3661
}
3762

63+
/// <summary>
64+
/// Indicates whether a given object is in the set.
65+
/// </summary>
66+
/// <param name="item">The object to check the set for.</param>
67+
/// <returns>True if the object is in the set, false otherwise.</returns>
3868
public bool Contains(T item)
3969
{
4070
return _backingSet.Contains(item);
4171
}
4272

73+
/// <inheritdoc/>
4374
public void CopyTo(T[] array, int arrayIndex)
4475
{
4576
_backingSet.CopyTo(array, arrayIndex);
4677
}
4778

79+
/// <summary>
80+
/// DO NOT USE.
81+
/// </summary>
4882
public void ExceptWith(IEnumerable<T> other)
4983
{
5084
throw new InvalidOperationException("Cannot modify a readonly set");
5185
}
5286

87+
/// <inheritdoc/>
5388
public IEnumerator<T> GetEnumerator()
5489
{
5590
return _backingSet.GetEnumerator();
5691
}
5792

93+
/// <summary>
94+
/// DO NOT USE.
95+
/// </summary>
5896
public void IntersectWith(IEnumerable<T> other)
5997
{
6098
throw new InvalidOperationException("Cannot modify a readonly set");
6199
}
62100

101+
/// <inheritdoc/>
63102
public bool IsProperSubsetOf(IEnumerable<T> other)
64103
{
65104
return _backingSet.IsProperSubsetOf(other);
66105
}
67106

107+
/// <inheritdoc/>
68108
public bool IsProperSupersetOf(IEnumerable<T> other)
69109
{
70110
return _backingSet.IsProperSupersetOf(other);
71111
}
72112

113+
/// <inheritdoc/>
73114
public bool IsSubsetOf(IEnumerable<T> other)
74115
{
75116
return _backingSet.IsSubsetOf(other);
76117
}
77118

119+
/// <inheritdoc/>
78120
public bool IsSupersetOf(IEnumerable<T> other)
79121
{
80122
return _backingSet.IsSupersetOf(other);
81123
}
82124

125+
/// <inheritdoc/>
83126
public bool Overlaps(IEnumerable<T> other)
84127
{
85128
return _backingSet.Overlaps(other);
86129
}
87130

131+
/// <summary>
132+
/// DO NOT USE.
133+
/// </summary>
88134
public bool Remove(T item)
89135
{
90136
throw new InvalidOperationException("Cannot modify a readonly set");
91137
}
92138

139+
/// <inheritdoc/>
93140
public bool SetEquals(IEnumerable<T> other)
94141
{
95142
return _backingSet.SetEquals(other);
96143
}
97144

145+
/// <summary>
146+
/// DO NOT USE.
147+
/// </summary>
98148
public void SymmetricExceptWith(IEnumerable<T> other)
99149
{
100150
throw new InvalidOperationException("Cannot modify a readonly set");
101151
}
102152

153+
/// <summary>
154+
/// DO NOT USE.
155+
/// </summary>
103156
public void UnionWith(IEnumerable<T> other)
104157
{
105158
throw new InvalidOperationException("Cannot modify a readonly set");
106159
}
107160

161+
/// <summary>
162+
/// DO NOT USE.
163+
/// </summary>
108164
void ICollection<T>.Add(T item)
109165
{
110166
throw new InvalidOperationException("Cannot modify a readonly set");
111167
}
112168

169+
/// <inheritdoc/>
113170
IEnumerator IEnumerable.GetEnumerator()
114171
{
115172
return ((IEnumerable)_backingSet).GetEnumerator();

PSCompatibilityAnalyzer/Microsoft.PowerShell.CrossCompatibility/Common/SingletonList.cs

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)