public IEnumerable <IToolboxItem> FindItemsByDefintion(ToolboxItemDefinitionBase definition) { if (definition == null) { throw new ArgumentNullException(nameof(definition)); } foreach (var category in _stateProvider.State) { var item = category.Items.FirstOrDefault(x => x.DataSource.Equals(definition)); if (item != null) { yield return(item); } } }
private static bool SelectorMethod(ToolboxItemDefinitionBase obj) { return(obj is DescriptionToolboxItemDefinition); }
/// <summary> /// Creates an data source. /// </summary> /// <param name="definition">The definition.</param> /// <returns>new <see cref="ItemDataSource"/> instance</returns> public ItemDataSource Create(ToolboxItemDefinitionBase definition) { return(new ItemDataSource(definition)); }
private void SetCurrentDefinition(ToolboxItemDefinitionBase definition) { Execute.OnUIThread(() => { _page.CurrentDefinition = definition.Name; }); }
public ItemDataSource Create(ToolboxItemDefinitionBase definition) { return(new DescriptionDataSource((DescriptionToolboxItemDefinition)definition)); }
public bool ToolboxHasItem(ToolboxItemDefinitionBase definition) { return(_stateProvider.State.Any(category => category.Items.FirstOrDefault(x => x.DataSource.Equals(definition)) != null)); }