private void CoverageList_SelectedIndexChanged(object sender, EventArgs e) { if (CoverageList.SelectedItems != null && CoverageList.SelectedIndices.Count > 0) { if (!CommonData.CoverageList[CoverageList.FocusedItem.Index].IsCustom) { CommonData.CoverageIndex = CoverageList.FocusedItem.Index; if (CommonData.CoverageList[CoverageList.FocusedItem.Index].Type.Contains("Object AOI")) { if (CommonData.CoverageList[CommonData.CoverageIndex].TargetName == "Earth") { HomeView_Click(sender, e); } else { string className = SmartViewFunctions.GetClassName(CommonData.CoverageList[CommonData.CoverageIndex].TargetName); try { string cmd = "VO * View FromTo FromRegName \"STK Object\" FromName \"" + className + "/" + CommonData.CoverageList[CommonData.CoverageIndex].TargetName + "\" ToRegName \"STK Object\" ToName \"" + className + "/" + CommonData.CoverageList[CoverageList.FocusedItem.Index].TargetName + "\" WindowID 1"; CommonData.StkRoot.ExecuteCommand(cmd); CommonData.StkRoot.ExecuteCommand("VO * View Top WindowID 1"); CommonData.StkRoot.ExecuteCommand("VO * View Zoom WindowID 1 FractionofCB -1"); } catch (Exception) { } } } else if (CommonData.CoverageList[CommonData.CoverageIndex].Type.Contains("Country/Region")) { try { string cmd = "VO * View FromTo FromRegName \"STK Object\" FromName \"AreaTarget/" + CommonData.CoverageList[CommonData.CoverageIndex].Country.Replace(' ', '_') + "\" ToRegName \"STK Object\" ToName \"AreaTarget/" + CommonData.CoverageList[CoverageList.FocusedItem.Index].Country.Replace(' ', '_') + "\" WindowID 1"; CommonData.StkRoot.ExecuteCommand(cmd); CommonData.StkRoot.ExecuteCommand("VO * View Top WindowID 1"); CommonData.StkRoot.ExecuteCommand("VO * View Zoom WindowID 1 FractionofCB -1"); } catch (Exception) { } } else if (CommonData.CoverageList[CommonData.CoverageIndex].Type.Contains("Global")) { HomeView_Click(sender, e); } CoverageDetails.Text = ""; string details = ReadWrite.WriteCoverageDetails(CommonData.CoverageList[CommonData.CoverageIndex].CdName); CoverageDetails.Text = details; CoverageFunctions.RemoveFomLegends(); CoverageFunctions.ShowLegend(); } } }
private void ClearLegends_Click(object sender, EventArgs e) { CoverageFunctions.RemoveFomLegends(); }