private void btnFlyAnimationPlay_Click(object sender, EventArgs e) { try { if (!(sender is ButtonItem)) { return; } if (flyAnimationClass == null) { flyAnimationClass = new FlyAccordingPath.Fly(); } ButtonItem bi = (ButtonItem)sender; switch (bi.Name) { case "btnItem_AnimationPlay": FlyAnimationPlayStart(); break; case "btnItem_AnimationPause": FlyAnimationPlayPause(); break; case "btnItem_AnimationStop": FlyAnimationPlayStop(); break; case "btnItem_AnimationClose": //切换显示的tab this.ribbonControl1.SelectedRibbonTabItem = this.ribbonTabItem1; this.ribbonTab_FlyAnimation.Visible = false; flyAnimationClass.StopAnimation(); //停止飞行 if (threadFlyAnimation != null) { threadFlyAnimation.Abort(); //终止线程 } break; default: break; } } catch { } }
//飞行路径 点击事件 private void btnFlyTo_Click(object sender, EventArgs e) { try { //判断是否为按钮 if (!(sender is ButtonItem)) { return; //如果不是按钮,则返回 } ButtonItem bi = (ButtonItem)sender; switch (bi.Name) { case "btnFlyPathManager": //打开相应文件夹 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); psi.Arguments = "/e," + FlyPathFoldPath; System.Diagnostics.Process.Start(psi); break; case "btnFlyAlong6Cities": FlyAlong6Cities(); //沿海经济带六个城市飞行 break; default: if (bi.Name == "btnFlyTo") { return; } //将飞行动画控制面板显示 this.ribbonTab_FlyAnimation.Visible = true; this.ribbonControl1.SelectedRibbonTabItem = this.ribbonTab_FlyAnimation; this.ribbonControl1.Refresh(); //以bookmark的方式缩放到飞行区域 string bookmarkName = UIControl.getBookmarkFromCityName(bi.Text); pSceneBookmark.ZoomToScene(bookmarkName); //System.Threading.Thread.Sleep(3000); //暂停3秒 //如果飞行动画的类为空 if (flyAnimationClass == null) { flyAnimationClass = new FlyAccordingPath.Fly(); } FlyClickedPathName = bi.Text; //刚才被点击的按钮名称 //寻找此按钮是否有对应的Polyline if (flyAnimationClass.InitAnimationPlay(this.axGlobeControl1, FlyClickedPathName, FlyPathFoldPath, this.ratingItem_FlySpeed.Rating, this.checkBoxItem_Loop.Checked, this.checkBoxItem_LookDown.Checked)) { IsFlyByPolyline = true; //是按照Polyline的方式飞行 StartFlyPathThread();// 启动多线程飞行方法 //进度条 ProgressBarValue = 0; this.progressBarItem_FlyAnimation.Value = 0; this.progressBarItem_FlyAnimation.Text = ""; this.progressBarItem_FlyAnimation.Refresh(); } else { IsFlyByPolyline = false; //不是按照Polyline的方式飞行 flyAnimationClass.InitAnimationByAgaFile(this.axGlobeControl1, bi.Text, FlyPathFoldPath, false, this.ratingItem_FlySpeed.Rating); } break; } } catch { } }
//飞行路径 点击事件 private void btnFlyTo_Click(object sender, EventArgs e) { try { //判断是否为按钮 if (!(sender is ButtonItem)) { return; //如果不是按钮,则返回 } ButtonItem bi = (ButtonItem)sender; switch (bi.Name) { case "btnFlyPathManager": //打开相应文件夹 System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo("Explorer.exe"); psi.Arguments = "/e," + FlyPathFoldPath; System.Diagnostics.Process.Start(psi); break; case "btnFlyAlong6Cities": FlyAlong6Cities(); //沿海经济带六个城市飞行 break; default: if (bi.Name == "btnFlyTo") { return; } //将飞行动画控制面板显示 this.ribbonTab_FlyAnimation.Visible = true; this.ribbonControl1.SelectedRibbonTabItem = this.ribbonTab_FlyAnimation; this.ribbonControl1.Refresh(); //以bookmark的方式缩放到飞行区域 string bookmarkName = UIControl.getBookmarkFromCityName(bi.Text); pSceneBookmark.ZoomToScene(bookmarkName); //System.Threading.Thread.Sleep(3000); //暂停3秒 //如果飞行动画的类为空 if (flyAnimationClass == null) { flyAnimationClass = new FlyAccordingPath.Fly(); } FlyClickedPathName = bi.Text; //刚才被点击的按钮名称 //寻找此按钮是否有对应的Polyline if (flyAnimationClass.InitAnimationPlay(this.axGlobeControl1, FlyClickedPathName, FlyPathFoldPath, this.ratingItem_FlySpeed.Rating, this.checkBoxItem_Loop.Checked, this.checkBoxItem_LookDown.Checked)) { IsFlyByPolyline = true; //是按照Polyline的方式飞行 StartFlyPathThread(); // 启动多线程飞行方法 //进度条 ProgressBarValue = 0; this.progressBarItem_FlyAnimation.Value = 0; this.progressBarItem_FlyAnimation.Text = ""; this.progressBarItem_FlyAnimation.Refresh(); } else { IsFlyByPolyline = false; //不是按照Polyline的方式飞行 flyAnimationClass.InitAnimationByAgaFile(this.axGlobeControl1, bi.Text, FlyPathFoldPath, false, this.ratingItem_FlySpeed.Rating); } break; } } catch { } }
private void btnFlyAnimationPlay_Click(object sender, EventArgs e) { try { if (!(sender is ButtonItem)) { return; } if (flyAnimationClass == null) { flyAnimationClass = new FlyAccordingPath.Fly(); } ButtonItem bi = (ButtonItem)sender; switch (bi.Name) { case "btnItem_AnimationPlay": FlyAnimationPlayStart(); break; case "btnItem_AnimationPause": FlyAnimationPlayPause(); break; case "btnItem_AnimationStop": FlyAnimationPlayStop(); break; case "btnItem_AnimationClose": //切换显示的tab this.ribbonControl1.SelectedRibbonTabItem = this.ribbonTabItem1; this.ribbonTab_FlyAnimation.Visible = false; flyAnimationClass.StopAnimation(); //停止飞行 if (threadFlyAnimation != null) { threadFlyAnimation.Abort(); //终止线程 } break; default: break; } } catch { } }