Exemplo n.º 1
0
 /// <summary>
 /// Tag单击事件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Label_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (tagType)
     {
         Label tmp = (Label)sender;
         if (e.LeftButton == MouseButtonState.Pressed)
         {
             lineMap.TagClick(Times, Convert.ToInt32(tmp.Tag), GetData, table, true);
         }
         else if (e.RightButton == MouseButtonState.Pressed)
         {
             int           s      = 0;
             List <object> list   = null;
             bool          type   = false;
             int           TagUnm = 0;
             int           Index  = 0;
             for (int i = 0; i < GetData.Items.Count; i++)
             {
                 if (Convert.ToInt32(((DataRowView)GetData.Items[i])[0].ToString().Trim()).Equals(Convert.ToInt32(tmp.Tag)))
                 {
                     if (i.Equals(0))
                     {
                         list   = ((DataRowView)GetData.Items[i]).Row.ItemArray.ToList();
                         TagUnm = Convert.ToInt32(tmp.Tag);
                         Index  = i;
                         type   = true;
                     }
                     else
                     {
                         list   = ((DataRowView)GetData.Items[i]).Row.ItemArray.ToList();
                         TagUnm = Convert.ToInt32(((DataRowView)GetData.Items[i - 1])["Tag"].ToString());
                         Index  = i;
                     }
                     s++;
                 }
             }
             if (s.Equals(1))//(判断Tag是否在表格中存在)存在重复Tag只可在表格修改
             {
                 TagLine tag = new TagLine(list, Times, type, TagUnm, GetData, Index, table, lineMap);
                 tag.Show();
             }
         }
     }
 }
Exemplo n.º 2
0
        public void LineMapShow(List <object> list, bool type, int TagUnm, int Index)
        {
            TagLine tag = new TagLine(list, Times, type, TagUnm, GetData, Index, table, lineMap);

            tag.Show();
        }