コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: Item.cs プロジェクト: debugger-net/GGJ19-MHS
        /// <summary>
        /// Construct a basic item
        /// </summary>
        public Item(IItemView itemView)
        {
            serialNumber = s_IssueSerialNumber();
            View         = itemView;

            _InitializeComponentSystem();
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 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);
 }
コード例 #6
0
    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);
    }
コード例 #7
0
 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;
 }
コード例 #8
0
 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;
 }
コード例 #9
0
 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;
 }
コード例 #10
0
        /// <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
        }
コード例 #11
0
        /// <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);
        }
コード例 #12
0
        /// <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);
        }
コード例 #13
0
 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();
 }
コード例 #14
0
        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);
        }
コード例 #15
0
 /// <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;
 }
コード例 #16
0
        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;
        }
コード例 #17
0
 private static void CreateActionListController(IItemView view, IGTDWindow window, IItemModel<ActionItem> model)
 {
     new ActionsListController(view, window, model, MockRepository.GenerateStub<IPublishKeyEvents>());
 }
コード例 #18
0
 protected virtual void AttachDetailsEvents(IItemView <T> detailsView)
 {
 }
コード例 #19
0
 public ItemController(IItemRepository repository, IItemView view)
 {
     this.repository = repository;
     this.view       = view;
 }
コード例 #20
0
ファイル: TreeListItemRenderer.cs プロジェクト: sbambach/ATF
 /// <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;
 }
コード例 #21
0
        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;
        }
コード例 #22
0
 public bool RecycleItemView(IItemView itemView, DynamicLayout parent)
 {
     return(false);
 }
コード例 #23
0
        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);
            }
        }