private void LoadStatus() { switch (p.importSource) { case RiverSimulationProfile.ImportSource.ImportFile: inputFileRdo.Checked = true; break; case RiverSimulationProfile.ImportSource.UserInput: inputGridRdo.Checked = true; break; default: inputFileRdo.Checked = false; inputGridRdo.Checked = false; break; } switch (p.coorType) { case PictureBoxCtrl.GridPictureBox.CoorType.None: noneRdo.Checked = true; break; case PictureBoxCtrl.GridPictureBox.CoorType.TWD97: twd97Rdo.Checked = true; break; case PictureBoxCtrl.GridPictureBox.CoorType.TWD67: twd67Rdo.Checked = true; break; } verticalLevelNumberTxt.Text = p.verticalLevelNumber.ToString(); switch (p.GetBackgroundMapType()) { case RiverSimulationProfile.BackgroundMapType.None: noBgRdo.Checked = true; break; case RiverSimulationProfile.BackgroundMapType.GoogleStaticMap: useGoogleBgRdo.Checked = true; break; case RiverSimulationProfile.BackgroundMapType.ImportImage: selectBgRdo.Checked = true; break; } }
public static void InitialGridPictureBoxByProfile(ref PictureBoxCtrl.GridPictureBox gp, RiverSimulationProfile p) { RiverSimulationProfile.BackgroundMapType t = p.GetBackgroundMapType(); if (RiverSimulationProfile.profile.inputGrid != null) { gp.Grid = p.inputGrid; } if (RiverSimulationProfile.BackgroundMapType.ImportImage == t) { gp.SetMapBackground(p.imagePath, p.sourceE, p.sourceN, p.sourceW, p.sourceH); } else if (RiverSimulationProfile.BackgroundMapType.GoogleStaticMap == t) { gp.SetMapBackground(p.tl, p.tr, p.bl, p.br); } else //if (RiverSimulationProfile.BackgroundMapType.None == t) { gp.ClearMapBackground(); } }