示例#1
0
        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);
                }
            }
        }
示例#2
0
 private static bool SelectorMethod(ToolboxItemDefinitionBase obj)
 {
     return(obj is DescriptionToolboxItemDefinition);
 }
示例#3
0
 /// <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));
 }
示例#4
0
 private void SetCurrentDefinition(ToolboxItemDefinitionBase definition)
 {
     Execute.OnUIThread(() => { _page.CurrentDefinition = definition.Name; });
 }
示例#5
0
 public ItemDataSource Create(ToolboxItemDefinitionBase definition)
 {
     return(new DescriptionDataSource((DescriptionToolboxItemDefinition)definition));
 }
示例#6
0
 public bool ToolboxHasItem(ToolboxItemDefinitionBase definition)
 {
     return(_stateProvider.State.Any(category =>
                                     category.Items.FirstOrDefault(x => x.DataSource.Equals(definition)) != null));
 }