This commit is contained in:
Eric Maupin 2018-11-09 17:22:06 -05:00
Родитель 54204b1b18
Коммит 271f23d040
4 изменённых файлов: 15 добавлений и 1 удалений

Просмотреть файл

@ -35,6 +35,8 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo
public bool CanWrite { get; }
public bool IsUncommon { get; }
public ValueSources ValueSources { get; }
public IReadOnlyList<PropertyVariationOption> Variations { get; }

Просмотреть файл

@ -23,12 +23,13 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo
public class MockPropertyInfo<T> : IPropertyInfo, IPropertyConverter, IEquatable<MockPropertyInfo<T>>
{
public MockPropertyInfo (string name, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Local | ValueSources.Default, PropertyVariationOption[] options = null)
public MockPropertyInfo (string name, string description = null, string category = null, bool canWrite = true, IEnumerable<Type> converterTypes = null, ValueSources valueSources = ValueSources.Local | ValueSources.Default, PropertyVariationOption[] options = null, bool isUncommon = false)
{
Name = name;
Description = description;
Category = category;
CanWrite = canWrite;
IsUncommon = isUncommon;
ValueSources = valueSources;
if (converterTypes != null) {
this.typeConverters = converterTypes
@ -52,6 +53,7 @@ namespace Xamarin.PropertyEditing.Tests.MockPropertyInfo
public string Category { get; }
public bool CanWrite { get; }
public bool IsUncommon { get; }
public ValueSources ValueSources { get; }
static readonly PropertyVariationOption[] EmptyVariationOptions = new PropertyVariationOption[0];

Просмотреть файл

@ -32,6 +32,14 @@ namespace Xamarin.PropertyEditing
bool CanWrite { get; }
/// <summary>
/// Gets whether the property is an uncommonly used property.
/// </summary>
/// <remarks>
/// This acts as a hint to hide the property behind disclosures when appropriate.
/// </remarks>
bool IsUncommon { get; }
/// <summary>
/// Gets the possible sources of values for this property.
/// </summary>

Просмотреть файл

@ -47,6 +47,8 @@ namespace Xamarin.PropertyEditing.Reflection
public bool CanWrite => this.propertyInfo.CanWrite;
public bool IsUncommon => false;
public ValueSources ValueSources => ValueSources.Local;
public IReadOnlyList<PropertyVariationOption> Variations => EmtpyVariationOptions;