/// <summary> /// 设定热点点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (this.txt_name.Text == "" || this.txt_name.Text.Equals(null)) //this.txt_name.Text.Equals(null)这个没有看明白 //而且,换行是怎么做到的? { MessageBox.Show("请先填入当前关注点的名称,然后点击设置", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { int groupId = Program.TE.FindItem("热点"); if (groupId == 0) { groupId = Program.TE.CreateGroup("热点", 0); } GetPositionInfo gp = new GetPositionInfo(); gp.GetPosition(); ITerrainLocation5 itl = Program.TE.IObjectManager51_CreateLocation(gp.Longitude, gp.Latitude, gp.Height, gp.Yaw, gp.CameraDeltaPitch, 90, HeightStyleCode.HSC_DEFAULT, groupId, this.txt_name.Text.ToString()); this.tree_hotDot.Nodes.Clear(); this.InitTree(); } catch (Exception) { } }
/// <summary> /// �趨�ȵ����¼� /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { if (this.txt_name.Text == "" || this.txt_name.Text.Equals(null)) //this.txt_name.Text.Equals(null)���û�п����� //���ң���������ô�����ģ� { MessageBox.Show("�������뵱ǰ��ע������ƣ�Ȼ��������", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } try { int groupId = Program.TE.FindItem("�ȵ�"); if (groupId == 0) { groupId = Program.TE.CreateGroup("�ȵ�", 0); } GetPositionInfo gp = new GetPositionInfo(); gp.GetPosition(); ITerrainLocation5 itl = Program.TE.IObjectManager51_CreateLocation(gp.Longitude, gp.Latitude, gp.Height, gp.Yaw, gp.CameraDeltaPitch, 90, HeightStyleCode.HSC_DEFAULT, groupId, this.txt_name.Text.ToString()); this.tree_hotDot.Nodes.Clear(); this.InitTree(); } catch (Exception) { } }