public override void SetListText(ListViewItem lvi, SHDataObject selDataObject)
            {
                SHConditions conds = (SHConditions)(selDataObject);

                if (lvi == null)
                {
                    return;
                }
                if (lvi.SubItems.Count > 1)
                {
                    lvi.SubItems.Clear();
                }

                conds.Compile();
                conds.Build(m_XmlCore);

                lvi.Text = (conds.idSpecified) ? conds.id.ToString() : String.Empty;

                lvi.SubItems.AddRange(new String[] { (conds.comment != null) ? conds.comment : String.Empty });

                if (!conds.Passed)
                {
                    lvi.ImageIndex = 7;
                }
                else
                {
                    lvi.ImageIndex = -1;
                }

                lvi.Tag       = conds;
                lvi.ForeColor = (conds.Passed) ? Color.Black : Color.Red;
                lvi.BackColor = (conds.Passed) ? Color.White : Color.Yellow;
            }
Exemplo n.º 2
0
            protected override bool CheckFilter(SHDataObject dataObject, string strHead, string strFilter)
            {
                SHConditions conds = (SHConditions)(dataObject);

                if (strHead.ToLower() == "id")
                {
                    return(ExistFilterString(strFilter, conds.id.ToString()));
                }
                if (strHead.ToLower() == "comment" || strHead == "주석")
                {
                    return(ExistFilterString(strFilter, conds.comment));
                }

                if (ExistFilterString(strFilter, conds.id.ToString()))
                {
                    return(true);
                }
                if (ExistFilterString(strFilter, conds.comment))
                {
                    return(true);
                }


                return(false);
            }
        private void subItemCondsAdd_Click(object sender, EventArgs e)
        {
            int nSelCondsID = m_ListViewController.MakeNewID();

            SHConditions newConds = new SHConditions();

            newConds.id = nSelCondsID;

            xmlCore.ItemConditions.Add(newConds);

            m_ListViewController.AddItem(newConds);

            Global._VelixianForms.FindForm("ITEMCONDITION").Touch();
        }
            protected override int GetDataObjectID(object listViewItemTag)
            {
                if (listViewItemTag.GetType() != typeof(SHConditions))
                {
                    return(0);
                }

                SHConditions selConds = (SHConditions)listViewItemTag;

                if (selConds != null)
                {
                    return(selConds.id);
                }
                return(0);
            }
            protected override bool _PasteDataObject(SHDataObject tarDataObject)
            {
                if (m_XmlCore.ItemConditions.IsValid(m_nCopyObjectID) == false)
                {
                    return(false);
                }

                SHConditions srcConds = m_XmlCore.ItemConditions[m_nCopyObjectID];
                SHConditions tarConds = (SHConditions)(tarDataObject);

                tarConds.Assign(srcConds);

                Global._VelixianForms.FindForm("ITEMCONDITION").Touch();

                return(true);
            }
        private void pgConditionElement_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            TreeNode     node = null;
            ListView     lv   = null;
            TreeView     tv   = null;
            VelixianForm tab  = null;

            node = tvIConditionDetail.SelectedNode;
            lv   = lvIConditions;
            tv   = tvIConditionDetail;
            tab  = Global._VelixianForms.FindForm("ITEMCONDITION");

            if (node.Tag.GetType() == typeof(SHConditions))
            {
                SHConditions conds = (SHConditions)node.Tag;
                node.Text = conds.GetString(xmlCore);
            }
            else if (node.Tag.GetType() == typeof(SHCondition))
            {
                SHCondition cond = (SHCondition)node.Tag;
                node.Text = cond.GetString(xmlCore);
            }
            else if (node.Tag.GetType() == typeof(SHAnd))
            {
                SHAnd and = (SHAnd)node.Tag;
                node.Text = and.GetString(xmlCore);
            }
            else if (node.Tag.GetType() == typeof(SHOr))
            {
                SHOr or = (SHOr)node.Tag;
                node.Text = or.GetString(xmlCore);
            }

            if (node.Tag != null)
            {
                if (lv.SelectedItems[0].Tag == tv.TopNode.Tag)
                {
                    SHConditions conds = (SHConditions)tv.Nodes[0].Tag;
                    m_ListViewController.SetListText(lv.SelectedItems[0], conds);
                }
            }

            tab.Touch();
        }
Exemplo n.º 7
0
        public bool CondORClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList)
        {
            if (tvList.SelectedNode == null || tvList.SelectedNode.Tag == null)
            {
                return(false);
            }

            Type nodeType = tvList.SelectedNode.Tag.GetType();

            SHOr newOr = new SHOr();

            if (nodeType == typeof(SHConditions))
            {
                SHConditions conds = (SHConditions)tvList.SelectedNode.Tag;
                conds.or = newOr;
            }
            else if (nodeType == typeof(SHAnd))
            {
                SHAnd and = (SHAnd)tvList.SelectedNode.Tag;
                and.or = newOr;
            }
            else if (nodeType == typeof(SHOr))
            {
                SHOr or = (SHOr)tvList.SelectedNode.Tag;
                or.or = newOr;
            }
            else if (nodeType == typeof(SHCondition))
            {
                SHCondition cond = (SHCondition)tvList.SelectedNode.Tag;
                cond.or = newOr;
            }
            else
            {
                return(false);
            }

            TreeNode newNode = ProcessOr(xmlCore, tvList.SelectedNode, newOr);

            tvList.SelectedNode = newNode;

            return(true);
        }
Exemplo n.º 8
0
        public bool CondAddCondClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList)
        {
            if (tvList.SelectedNode == null || tvList.SelectedNode.Tag == null)
            {
                return(false);
            }

            Type nodeType = tvList.SelectedNode.Tag.GetType();

            SHCondition newCondition = new SHCondition();

            newCondition.Compile();
            newCondition.Build(xmlCore);

            if (nodeType == typeof(SHConditions))
            {
                SHConditions conds = (SHConditions)tvList.SelectedNode.Tag;
                conds.dataList.Add(newCondition);
            }
            else if (nodeType == typeof(SHAnd))
            {
                SHAnd and = (SHAnd)tvList.SelectedNode.Tag;
                and.dataList.Add(newCondition);
            }
            else if (nodeType == typeof(SHOr))
            {
                SHOr or = (SHOr)tvList.SelectedNode.Tag;
                or.dataList.Add(newCondition);
            }
            else
            {
                return(true);
            }

            TreeNode newNode = ProcessCondition(xmlCore, tvList.SelectedNode, newCondition);

            tvList.SelectedNode = newNode;


            return(true);
        }
        private void lvIConditions_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvIConditions.SelectedItems.Count > 0)
            {
                ListViewItem lvi = lvIConditions.SelectedItems[0];
                if (lvi != null && lvi.Tag != null && lvi.Tag.GetType() == typeof(SHConditions))
                {
                    SHConditions conds = (SHConditions)lvi.Tag;
                    if (conds != null)
                    {
                        pgIConditionElement.SelectedObject = conds;
                        pgIConditionElement.Tag            = lvi;

                        ConditionHelper conditionHelper = new ConditionHelper();
                        conditionHelper.ProcessConditions(xmlCore, tvIConditionDetail, conds);
                        Global._mainForm.SetStatusLabelText(conds.CompiledMessage);
                    }
                }
            }
            m_ListViewController.OnSelectedIndexChanged();
        }
Exemplo n.º 10
0
        /// <param name="lvTarget">구체적인 조건들이 명시될 리스트뷰를 지정한다.</param>
        /// <param name="conds">조건들의 목록</param>
        public TreeNode ProcessConditions(SHXmlCore xmlCore, TreeView tvList, SHConditions conds)
        {
            if (conds == null)
            {
                return(null);
            }

            TreeNode nodeRoot = new TreeNode(conds.GetString(xmlCore));

            nodeRoot.ImageIndex         = 4;
            nodeRoot.SelectedImageIndex = 4;
            nodeRoot.Tag = conds;

            if (conds.and != null)
            {
                ProcessAnd(xmlCore, nodeRoot, conds.and);
            }

            if (conds.or != null)
            {
                ProcessOr(xmlCore, nodeRoot, conds.or);
            }

            for (int i = 0; i < conds.dataList.Count; i++)
            {
                SHCondition cond = conds.dataList[i] as SHCondition;
                ProcessCondition(xmlCore, nodeRoot, cond);
            }

            tvList.Tag = conds;

            tvList.Nodes.Clear();
            tvList.Nodes.Add(nodeRoot);
            tvList.ExpandAll();
            tvList.SelectedNode = nodeRoot;

            return(nodeRoot);
        }
Exemplo n.º 11
0
        public bool CondDelClick(object sender, EventArgs e, SHXmlCore xmlCore, TreeView tvList, ListView lvMainList)
        {
            SHConditions conds = tvList.Tag as SHConditions;


            if (tvList == null || conds == null || lvMainList == null || tvList.SelectedNode == null)
            {
                return(false);
            }

            TreeNode selectedNode = tvList.SelectedNode;

            if (selectedNode == null || selectedNode.Tag == null)
            {
                return(false);
            }

            if (selectedNode.Tag.GetType() == typeof(SHAnd))
            {
                SHAnd and = selectedNode.Tag as SHAnd;

                if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions))
                {
                    SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag;
                    parentConditions.and = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd))
                {
                    SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag;
                    parentAnd.and = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr))
                {
                    SHOr parentOr = (SHOr)selectedNode.Parent.Tag;
                    parentOr.and = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHCondition))
                {
                    SHCondition parentCondition = (SHCondition)selectedNode.Parent.Tag;
                    parentCondition.and = null;
                }
                else
                {
                    return(false);
                }
            }
            else if (selectedNode.Tag.GetType() == typeof(SHOr))
            {
                SHOr or = selectedNode.Tag as SHOr;

                if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions))
                {
                    SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag;
                    parentConditions.or = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd))
                {
                    SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag;
                    parentAnd.or = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr))
                {
                    SHOr parentOr = (SHOr)selectedNode.Parent.Tag;
                    parentOr.or = null;
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHCondition))
                {
                    SHCondition parentCondition = (SHCondition)selectedNode.Parent.Tag;
                    parentCondition.or = null;
                }
                else
                {
                    return(false);
                }
            }
            else if (selectedNode.Tag.GetType() == typeof(SHCondition))
            {
                SHCondition cond = selectedNode.Tag as SHCondition;

                if (selectedNode.Parent.Tag.GetType() == typeof(SHConditions))
                {
                    SHConditions parentConditions = (SHConditions)selectedNode.Parent.Tag;
                    parentConditions.dataList.Remove(cond);
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHAnd))
                {
                    SHAnd parentAnd = (SHAnd)selectedNode.Parent.Tag;
                    parentAnd.dataList.Remove(cond);
                }
                else if (selectedNode.Parent.Tag.GetType() == typeof(SHOr))
                {
                    SHOr parentOr = (SHOr)selectedNode.Parent.Tag;
                    parentOr.dataList.Remove(cond);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }

            tvList.Nodes.Remove(selectedNode);
            selectedNode = selectedNode.Parent;

            return(true);
        }