Ejemplo n.º 1
0
        public T Get <T>(By locator) where T : UIElement
        {
            var element = UIElementFactory.CreateInstance <T>(locator, this);

            element.InitMembers();
            return(element);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// suggest candidate
        /// </summary>
        /// <param name="wareBase">A WareBase instance</param>
        public void SuggestCandidate(WareBase wareBase)
        {
            var uiElement = UIElementFactory.CreateUIElement(wareBase, _worktable.Children);
            int zIndex    = uiElement is CarrierUIElement ? 10 : 20;

            Grid.SetZIndex(uiElement, zIndex);
            _uiController.UIElementCandidate = uiElement;
            Mouse.OverrideCursor             = Cursors.Hand;
            _uiController.CaptureMouse();
        }
Ejemplo n.º 3
0
        private void ShowRootPath()
        {
            //如果配置不需要显示,则直接返回
            if (!NeedShowRootPath())
            {
                return;
            }
            if (RootTag == null)
            {
                return;
            }

            connectCanvas.Children.Clear();

            //需要显示从全局根到当前视图根节点之间的路径
            //查找出所有从当前视图根节点到全局根节点之间的中间节点
            List <GUTag> connect = new List <GUTag>();
            GUTag        from    = RootTag;
            GUTag        tmp     = from;

            connect.Add(from);
            while (connect.Count < 20 && tmp != null)
            {
                List <GUTag> ps = TagDB.QueryTagParent(tmp);
                if (ps.Count > 0)
                {
                    tmp = ps[0];
                    connect.Add(tmp);
                }
                else
                {
                    break;
                }
            }
            connect.Reverse();

            //显示所有中间节点
            double X = 0;

            foreach (GUTag u in connect)
            {
                GTagBox gt = new GTagBox(5, u, X, 0, 1);
                TagBox  tx = UIElementFactory.CreateTagBox(gt, null);
                tx.HideCircle();

                X += gt.OutterBox.Width;
                if (tx.ContextMenu == null)
                {
                    tx.ContextMenu          = TagAreaMenu;
                    tx.MouseLeftButtonDown += Tag_MouseLeftButtonDown;
                    tx.MouseDoubleClick    += Tag_MouseDoubleClick;
                }
                connectCanvas.Children.Add(tx);
            }
        }
Ejemplo n.º 4
0
        public List <Path> GetAllLines()
        {
            List <Path> result = new List <Path>();

            foreach (Path b in LineGarbage)
            {
                b.Visibility = System.Windows.Visibility.Collapsed;
            }
            foreach (Tuple <GTagBoxTree, GTagBoxTree, int> p_c in Lines)
            {
                result.Add(UIElementFactory.CreateBezier(p_c, this));
            }
            return(result);
        }
Ejemplo n.º 5
0
        public List <TagBox> GetAllTagBox()
        {
            List <TagBox> result = new List <TagBox>();

            //还处于垃圾箱中的TagBox,将其设置为不可见
            foreach (TagBox b in TagBoxGarbage)
            {
                b.Visibility = System.Windows.Visibility.Collapsed;
            }
            //对于每一个节点,创建TagBox()
            foreach (GTagBoxTree obj in All)
            {
                result.Add(UIElementFactory.CreateTagBox(obj.GTagBox, this));
            }
            return(result);
        }
Ejemplo n.º 6
0
 protected UITemplate(UIElementFactory factory)
 {
     m_factory = factory;
 }
Ejemplo n.º 7
0
 protected UITemplate(UIElementFactory factory)
 {
     m_factory = factory;
 }