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.
36 lines
900 B
36 lines
900 B
using System;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace Microsoft.Windows.Controls.PropertyGrid
|
|
{
|
|
public class EditorDefinitionCollection : ObservableCollection<IEditorDefinition>
|
|
{
|
|
public IEditorDefinition this[string propertyName]
|
|
{
|
|
get
|
|
{
|
|
foreach (var item in Items)
|
|
{
|
|
if (item.Properties.Contains(propertyName))
|
|
return item;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public IEditorDefinition this[Type targetType]
|
|
{
|
|
get
|
|
{
|
|
foreach (var item in Items)
|
|
{
|
|
if (item.TargetType == targetType)
|
|
return item;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|