Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 1c3415a

Browse files
committed
Format code in System.Composition
1 parent 5b5364c commit 1c3415a

File tree

11 files changed

+24
-112
lines changed

11 files changed

+24
-112
lines changed

src/System.Composition.AttributedModel/src/System/Composition/ExportAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,4 @@ public ExportAttribute(string contractName, Type contractType)
9191
/// </value>
9292
public Type ContractType { get; private set; }
9393
}
94-
}
94+
}

src/System.Composition.AttributedModel/src/System/Composition/ExportMetadataAttribute.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,14 @@ public ExportMetadataAttribute(string name, object value)
3838
/// <value>
3939
/// A <see cref="String"/> containing the name of the metadata value.
4040
/// </value>
41-
public string Name
42-
{
43-
get;
44-
private set;
45-
}
41+
public string Name { get; private set; }
4642

4743
/// <summary>
4844
/// Gets the metadata value.
4945
/// </summary>
5046
/// <value>
5147
/// An <see cref="object"/> containing the metadata value.
5248
/// </value>
53-
public object Value
54-
{
55-
get;
56-
private set;
57-
}
49+
public object Value { get; private set; }
5850
}
59-
}
51+
}

src/System.Composition.AttributedModel/src/System/Composition/ImportAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ public ImportAttribute(string contractName)
5252
/// </summary>
5353
public bool AllowDefault { get; set; }
5454
}
55-
}
55+
}

src/System.Composition.AttributedModel/src/System/Composition/ImportManyAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ public ImportManyAttribute(string contractName)
4545
/// </value>
4646
public string ContractName { get; private set; }
4747
}
48-
}
48+
}

src/System.Composition.AttributedModel/src/System/Composition/MetadataAttributeAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ public MetadataAttributeAttribute()
2020
{
2121
}
2222
}
23-
}
23+
}

src/System.Composition.AttributedModel/src/System/Composition/PartMetadataAttribute.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,14 @@ public PartMetadataAttribute(string name, object value)
3737
/// <value>
3838
/// A <see cref="String"/> containing the name of the metadata value.
3939
/// </value>
40-
public string Name
41-
{
42-
get;
43-
private set;
44-
}
40+
public string Name { get; private set; }
4541

4642
/// <summary>
4743
/// Gets the metadata value.
4844
/// </summary>
4945
/// <value>
5046
/// An <see cref="object"/> containing the metadata value.
5147
/// </value>
52-
public object Value
53-
{
54-
get;
55-
private set;
56-
}
48+
public object Value { get; private set; }
5749
}
58-
}
50+
}

src/System.Composition.Convention/src/Microsoft/Composition/Diagnostics/TraceWriter.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,11 @@ namespace Microsoft.Composition.Diagnostics
77
{
88
internal abstract class TraceWriter
99
{
10-
public abstract bool CanWriteInformation
11-
{
12-
get;
13-
}
14-
15-
public abstract bool CanWriteWarning
16-
{
17-
get;
18-
}
19-
20-
public abstract bool CanWriteError
21-
{
22-
get;
23-
}
10+
public abstract bool CanWriteInformation { get; }
11+
12+
public abstract bool CanWriteWarning { get; }
13+
14+
public abstract bool CanWriteError { get; }
2415

2516
public abstract void WriteInformation(CompositionTraceId traceId, string format, params object[] arguments);
2617

src/System.Composition.Convention/src/Microsoft/Internal/Assumes.InternalErrorException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal partial class Assumes
1212
{
1313
// The exception that is thrown when an internal assumption failed.
1414
[SuppressMessage("Microsoft.Design", "CA1064:ExceptionsShouldBePublic")]
15-
private class InternalErrorException : Exception
15+
private sealed class InternalErrorException : Exception
1616
{
1717
public InternalErrorException(string message)
1818
: base(string.Format(CultureInfo.CurrentCulture, Strings.InternalExceptionMessage, message))

src/System.Composition.Convention/src/Microsoft/Internal/Lock.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ namespace Microsoft.Internal
1212
internal sealed class Lock : IDisposable
1313
{
1414
#if FEATURE_SLIMLOCK
15-
private ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
15+
private readonly ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion);
1616
private int _isDisposed = 0;
1717
public void EnterReadLock()
1818
{
19-
this._thisLock.EnterReadLock();
19+
_thisLock.EnterReadLock();
2020
}
2121

2222
public void EnterWriteLock()
2323
{
24-
this._thisLock.EnterWriteLock();
24+
_thisLock.EnterWriteLock();
2525
}
2626

2727
public void ExitReadLock()
2828
{
29-
this._thisLock.ExitReadLock();
29+
_thisLock.ExitReadLock();
3030
}
3131

3232
public void ExitWriteLock()
3333
{
34-
this._thisLock.ExitWriteLock();
34+
_thisLock.ExitWriteLock();
3535
}
3636

3737
public void Dispose()
3838
{
39-
if (Interlocked.CompareExchange(ref this._isDisposed, 1, 0) == 0)
39+
if (Interlocked.CompareExchange(ref _isDisposed, 1, 0) == 0)
4040
{
41-
this._thisLock.Dispose();
41+
_thisLock.Dispose();
4242
}
4343
}
4444

src/System.Composition.Convention/src/Microsoft/Internal/Requires.cs

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -37,68 +37,5 @@ public static void NotNullOrEmpty(string value, string parameterName)
3737
}
3838
Contract.EndContractBlock();
3939
}
40-
// [DebuggerStepThrough]
41-
// [ContractArgumentValidator]
42-
// public static void NotNullOrNullElements<T>(IEnumerable<T> values, string parameterName)
43-
// where T : class
44-
// {
45-
// NotNull(values, parameterName);
46-
// NotNullElements(values, parameterName);
47-
// Contract.EndContractBlock();
48-
// }
49-
50-
// [DebuggerStepThrough]
51-
// [ContractArgumentValidator]
52-
// public static void NullOrNotNullElements<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> values, string parameterName)
53-
// where TKey : class
54-
// where TValue : class
55-
// {
56-
// NotNullElements(values, parameterName);
57-
// Contract.EndContractBlock();
58-
// }
59-
60-
// [DebuggerStepThrough]
61-
// [ContractArgumentValidator]
62-
// public static void NullOrNotNullElements<T>(IEnumerable<T> values, string parameterName)
63-
// where T : class
64-
// {
65-
// NotNullElements(values, parameterName);
66-
// Contract.EndContractBlock();
67-
// }
68-
69-
// [ContractArgumentValidator]
70-
// private static void NotNullElements<T>(IEnumerable<T> values, string parameterName)
71-
// where T : class
72-
// {
73-
// if (values != null && !Contract.ForAll(values, (value) => value != null))
74-
// {
75-
// throw ExceptionBuilder.CreateContainsNullElement(parameterName);
76-
// }
77-
// Contract.EndContractBlock();
78-
// }
79-
80-
// [ContractArgumentValidator]
81-
// private static void NotNullElements<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>> values, string parameterName)
82-
// where TKey : class
83-
// where TValue : class
84-
// {
85-
// if (values != null && !Contract.ForAll(values, (keyValue) => keyValue.Key != null && keyValue.Value != null))
86-
// {
87-
// throw ExceptionBuilder.CreateContainsNullElement(parameterName);
88-
// }
89-
// Contract.EndContractBlock();
90-
// }
91-
92-
// [DebuggerStepThrough]
93-
// [ContractArgumentValidator]
94-
// public static void IsInMembertypeSet(MemberTypes value, string parameterName, MemberTypes enumFlagSet)
95-
// {
96-
// if ((value & enumFlagSet) != value || // Ensure the member is in the set
97-
// (value & (value - 1)) != 0) // Ensure that there is only one flag in the value (i.e. value is a power of 2).
98-
// {
99-
// throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Strings.ArgumentOutOfRange_InvalidEnumInSet, parameterName, value, enumFlagSet.ToString()), parameterName);
100-
// }
101-
// Contract.EndContractBlock();
102-
// }
10340
}
10441
}

0 commit comments

Comments
 (0)