Exemple #1
0
        private int GetTag()
        {
            TagItem item = this._comboxBoxTag.SelectedItem as TagItem;

            if (item != null)
            {
                return(item.Tag);
            }

            string g = this._textBoxGroupNum.Text.Trim();
            string e = this._textBoxElementNum.Text.Trim();

            if (g.Length == 0)
            {
                g = "0000";
            }
            if (g.Length == 1)
            {
                g = "000" + g;
            }
            if (g.Length == 2)
            {
                g = "00" + g;
            }
            if (g.Length == 3)
            {
                g = "0" + g;
            }
            if (e.Length == 0)
            {
                e = "0000";
            }
            if (e.Length == 1)
            {
                e = "000" + e;
            }
            if (e.Length == 2)
            {
                e = "00" + e;
            }
            if (e.Length == 3)
            {
                e = "0" + e;
            }

            return(DHelper.HexString2Int(g + e));
        }