Beispiel #1
0
        public override void Refresh()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("(").Append(DHelper.Int2HexString((int)(0x0000FFFF & Tag)));
            sb.Append(",").Append(DHelper.Int2HexString((int)(Tag >> 16))).Append(")");
            string strTag = sb.ToString();

            if (SubItems.Count < 2)
            {
                SubItems.Add(strTag);
            }
            else
            {
                SubItems[1].Text = strTag;
            }

            string strDescription = DHelper.GetTagName(Tag);

            if (SubItems.Count < 3)
            {
                SubItems.Add(strDescription);
            }
            else
            {
                SubItems[2].Text = strDescription;
            }

            base.Refresh();
        }
Beispiel #2
0
        private void RefreshGroupElement(int tag)
        {
            int    g    = DHelper.GetGroup(tag);
            int    e    = DHelper.GetElement(tag);
            string strG = DHelper.Int2HexString(g);
            string strE = DHelper.Int2HexString(e);

            this._textBoxGroupNum.Text   = strE;
            this._textBoxElementNum.Text = strG;
        }
Beispiel #3
0
        public void UpdatePrivateTagList()
        {
            Dictionary <string, PrivateTag> dic = new Dictionary <string, PrivateTag>();

            foreach (MWLQueryCriteriaItem qcItem in Rule.QueryCriteria.MappingList)
            {
                if (qcItem.DPath.Type != DPathType.Normal)
                {
                    continue;
                }
                int tag = qcItem.DPath.GetTag();
                if (PrivateTagHelper.IsPrivateTag(tag))
                {
                    string strTag = DHelper.Int2HexString(tag);
                    if (!dic.ContainsKey(strTag))
                    {
                        dic.Add(strTag, new PrivateTag(strTag, qcItem.DPath.VR));
                    }
                }
            }

            // do not keep manually added item, refresh the whole private tag list

            //if (PrivateTagList != null)
            //{
            //    foreach (PrivateTag tag in PrivateTagList)
            //    {
            //        string strTag = tag.Tag;
            //        if (!dic.ContainsKey(strTag))
            //        {
            //            dic.Add(strTag, tag);
            //        }
            //    }
            //}

            XCollection <PrivateTag> xlist = new XCollection <PrivateTag>();

            foreach (KeyValuePair <string, PrivateTag> p in dic)
            {
                xlist.Add(p.Value);
            }
            PrivateTagList = xlist;
        }
Beispiel #4
0
        private void RefreshGroupElement()
        {
            TagItem item = this._comboxBoxTag.SelectedItem as TagItem;

            this._textBoxGroupNum.ReadOnly       =
                this._textBoxElementNum.ReadOnly = (item != null);

            if (item != null)
            {
                int    tag  = item.Tag;
                int    g    = DHelper.GetGroup(tag);
                int    e    = DHelper.GetElement(tag);
                string strG = DHelper.Int2HexString(g);
                string strE = DHelper.Int2HexString(e);

                _changingText = true;
                this._textBoxGroupNum.Text   = strG;
                this._textBoxElementNum.Text = strE;
                _changingText = false;
            }
        }