private static void AddChildrenToItemRecursively( object item, TreeListView.Node node, ITreeListView view, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary <object, TreeListView.Node> dictNodes) { if (view == null) { return; } IEnumerable <object> children = view.GetChildren(item); foreach (object child in children) { TreeListView.Node nodeChild = CreateNodeForObject(child, itemView, imageList, stateImageList, dictNodes); if (dictNodes != null) { dictNodes.Add(child, nodeChild); } node.Nodes.Add(nodeChild); AddChildrenToItemRecursively(child, nodeChild, view, itemView, imageList, stateImageList, dictNodes); } }
/// <summary> /// Construct a basic item /// </summary> public Item(IItemView itemView) { serialNumber = s_IssueSerialNumber(); View = itemView; _InitializeComponentSystem(); }
public ItemPresenter(IItemView view, IItemImageRepository repository, IStagePresenter stagePresenter, Action openOrderView, IReadOnlyList <Item> items, IItemFilterer itemFilterer, IVmMapper vmMapper) { _view = view; _repository = repository; _stagePresenter = stagePresenter; _items = items.Select(item => vmMapper.Map(item)).ToList(); _itemFilterer = itemFilterer; _vmMapper = vmMapper; _colors = new List <ColorVm>(); _view.OnBackButtonClick = openOrderView; _view.OnFilterChanged = FilterItems; _view.OnViewOpened = LoadItemImages; _view.OnViewOpened = LoadItemColors; _view.ItemSearchTypes = new List <string>() { nameof(ItemVm.Number), nameof(ItemVm.InventoryId), nameof(ItemVm.Name) }; _view.ItemTypes = Enum.GetNames(typeof(ItemType)); var itemConditions = new List <string>() { "Any" }; itemConditions.AddRange(Enum.GetNames(typeof(ItemCondition))); _view.ItemConditions = itemConditions; _view.Items = _items; }
private static TreeListView.Node CreateNodeForObject( object item, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary <object, TreeListView.Node> dictNodes) { // Check for existing TreeListView.Node node; if (dictNodes.TryGetValue(item, out node)) { return(node); } // Create new node = new TreeListView.Node(); ItemInfo info = GetItemInfo( item, itemView, imageList, stateImageList); UpdateNodeFromItemInfo(node, item, info); return(node); }
public void WireUpController() { _main_view = MockRepository.GenerateMock<IMainWindowView>(); _inbox_view = MockRepository.GenerateMock<IInBoxView>(); _action_view = MockRepository.GenerateMock<IItemView>(); new MainWindowController(_main_view, _inbox_view, _action_view); }
public void ProcessItemView(int position, IItemView itemView, DynamicLayout parent) { var data = m_DataList[position]; var itemUI = itemView as ItemView; itemUI.dataText.text = string.Format("第{0}条数据", data); }
public MainWindowController(IMainWindowView main_view, IInBoxView inbox_view, IItemView action_view) { _main_view = main_view; _inbox_view = inbox_view; _action_view = action_view; _main_view.Shown += delegate { SetFocusOnTextBoxInSelectedTab(); }; _main_view.GotFocus += delegate { SetFocusOnTextBoxInSelectedTab(); }; _main_view.SelectedTabChanged += SetFocusOnTextBoxInSelectedTab; }
public TypePresenter(IBaseModel <CType> model, IItemView <CType> view) { this.model = model; this.view = view; model.Reload(); view.ItemList = model.ItemList; view.Refresh += view_Refresh; view.Save += view_Save; }
public MaterialPresenter(IBaseModel <CMaterial> model, IItemView <CMaterial> view) { this.model = model; this.view = view; model.Reload(); view.ItemList = model.ItemList; view.Refresh += view_Refresh; view.Save += view_Save; view.Delete += view_Delete; view.Add += view_Add; }
/// <summary> /// Callback to determine if an item in the tree is filtered in (return true) or out</summary> /// <param name="item">Item tested for filtering</param> /// <returns>True if filtered in, false if filtered out</returns> public bool DefaultFilter(object item) { IItemView itemView = TreeView.As <IItemView>(); if (itemView != null) { ItemInfo info = new WinFormsItemInfo(); itemView.GetInfo(item, info); return(SearchInputUI.IsNullOrEmpty() || SearchInputUI.Matches(info.Label)); } return(true); // Don't filter anything if the context doesn't implement IItemView }
/// <summary> /// Callback to determine if an item in the tree is filtered in (return true) or out</summary> /// <param name="item">Item tested for filtering</param> /// <returns>True if filtered in, false if filtered out</returns> public bool DefaultFilter(object item) { bool result = true; IItemView itemView = TreeView.As <IItemView>(); if (m_TagPanel.TagList.Count != 0) { ItemInfo info = new WinFormsItemInfo(); itemView.GetInfo(item, info); result = info.Label != null && m_TagPanel.Matches(info.Label); } return(result); }
/// <summary> /// Callback to determine if an item in the tree is filtered in (return true) or out</summary> /// <param name="item">Item tested for filtering</param> /// <returns>True if filtered in, false if filtered out</returns> public bool DefaultFilter(object item) { bool result = true; IItemView itemView = TreeView.As <IItemView>(); if (!SearchInputUI.IsNullOrEmpty()) { ItemInfo info = new WinFormsItemInfo(); itemView.GetInfo(item, info); result = info.Label != null && SearchInputUI.Matches(info.Label); } return(result); }
public TypePresenter(IBaseRepositoryModel <CType> repositoryModel, IItemView <CType> view) { _repositoryModel = repositoryModel; _view = view; repositoryModel.Reload(); view.ItemList = repositoryModel.ItemList; _currentID = repositoryModel.ItemList.First().Id; view.CurrentItem = repositoryModel.ItemList.First(); view.RefreshView += ViewRefreshView; view.Save += view_Save; view.AddNew += view_AddNew; view.Closed += ViewClosed; view.Show(); }
private static ItemInfo GetItemInfo(object item, IItemView itemView, ImageList imageList, ImageList stateImageList) { var info = new WinFormsItemInfo(imageList, stateImageList); if (itemView == null) { info.Label = GetObjectString(item); info.Properties = new object[0]; info.ImageIndex = TreeListView.InvalidImageIndex; info.StateImageIndex = TreeListView.InvalidImageIndex; info.CheckState = CheckState.Unchecked; info.FontStyle = FontStyle.Regular; info.IsLeaf = true; info.IsExpandedInView = false; info.HoverText = string.Empty; } else { itemView.GetInfo(item, info); } return(info); }
/// <summary> /// Initializes a new instance of the <see cref="TreeListItemRenderer"/> class.</summary> /// <param name="itemView">The item view</param> public TreeListItemRenderer(IItemView itemView) { m_itemView = itemView; }
private static ItemInfo GetItemInfo(object item, IItemView itemView, ImageList imageList, ImageList stateImageList) { var info = new WinFormsItemInfo(imageList, stateImageList); if (itemView == null) { info.Label = GetObjectString(item); info.Properties = new object[0]; info.ImageIndex = TreeListView.InvalidImageIndex; info.StateImageIndex = TreeListView.InvalidImageIndex; info.CheckState = CheckState.Unchecked; info.FontStyle = FontStyle.Regular; info.IsLeaf = true; info.IsExpandedInView = false; info.HoverText = string.Empty; } else { itemView.GetInfo(item, info); } return info; }
private static void CreateActionListController(IItemView view, IGTDWindow window, IItemModel<ActionItem> model) { new ActionsListController(view, window, model, MockRepository.GenerateStub<IPublishKeyEvents>()); }
protected virtual void AttachDetailsEvents(IItemView <T> detailsView) { }
public ItemController(IItemRepository repository, IItemView view) { this.repository = repository; this.view = view; }
private static TreeListView.Node CreateNodeForObject( object item, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary<object, TreeListView.Node> dictNodes) { // Check for existing TreeListView.Node node; if (dictNodes.TryGetValue(item, out node)) return node; // Create new node = new TreeListView.Node(); ItemInfo info = GetItemInfo( item, itemView, imageList, stateImageList); UpdateNodeFromItemInfo(node, item, info); return node; }
public bool RecycleItemView(IItemView itemView, DynamicLayout parent) { return(false); }
private static void AddChildrenToItemRecursively( object item, TreeListView.Node node, ITreeListView view, IItemView itemView, ImageList imageList, ImageList stateImageList, IDictionary<object, TreeListView.Node> dictNodes) { if (view == null) return; IEnumerable<object> children = view.GetChildren(item); foreach (object child in children) { TreeListView.Node nodeChild = CreateNodeForObject(child, itemView, imageList, stateImageList, dictNodes); if (dictNodes != null) dictNodes.Add(child, nodeChild); node.Nodes.Add(nodeChild); AddChildrenToItemRecursively(child, nodeChild, view, itemView, imageList, stateImageList, dictNodes); } }