mirror of https://github.com/icsharpcode/ILSpy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
626 B
38 lines
626 B
using System.Collections.Generic; |
|
using System.Linq; |
|
|
|
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
|
{ |
|
internal static class ExtensionProperties |
|
{ |
|
extension<T>(ICollection<T> collection) where T : notnull |
|
{ |
|
public bool IsEmpty => collection.Count == 0; |
|
|
|
public int Test { |
|
get { |
|
return 42; |
|
} |
|
set { |
|
} |
|
} |
|
|
|
public void AddIfNotNull(T item) |
|
{ |
|
if (item != null) |
|
{ |
|
collection.Add(item); |
|
} |
|
} |
|
|
|
public T2 Cast<T2>(int index) where T2 : T |
|
{ |
|
return (T2)(object)collection.ElementAt(index); |
|
} |
|
|
|
public static void StaticExtension() |
|
{ |
|
} |
|
} |
|
} |
|
}
|
|
|