public void loadXMLTriggers(XPathNodeIterator inIterator) { try { mLog.Debug("inside loadXMLTriggers for " + this.mMapType + " MapManager"); mMyTriggers = new MapSwapTrigger[inIterator.Count]; int index = -1; while (inIterator.MoveNext()) { index++; MapSwapTrigger mst = new MapSwapTrigger(); XPathNodeIterator tempIT = inIterator.Current.Select("StartDate"); tempIT.MoveNext(); mst.StartDate = System.Convert.ToDateTime(tempIT.Current.Value); tempIT = inIterator.Current.Select("StartTime"); tempIT.MoveNext(); mst.StartDate = mst.StartDate.AddHours(System.Convert.ToInt32(tempIT.Current.Value)); //Author: Bob Cummings added setting the orginal start date. //will also modify writting out the XML file to using original start date. mst.OriginalStartDate = mst.StartDate; tempIT = inIterator.Current.Select("Path"); tempIT.MoveNext(); mst.Path = tempIT.Current.Value; tempIT = inIterator.Current.Select("FileName"); tempIT.MoveNext(); mst.Filename = tempIT.Current.Value; tempIT = inIterator.Current.Select("TriggerType"); tempIT.MoveNext(); switch (tempIT.Current.Value) { case "HOURLY": mst.MyTriggerType = MapSwapTrigger.mTriggerType.HOURLY; break; case "DAILY": mst.MyTriggerType = MapSwapTrigger.mTriggerType.DAILY; break; case "YEARLY": mst.MyTriggerType = MapSwapTrigger.mTriggerType.YEARLY; break; case "STATIC": mst.MyTriggerType = MapSwapTrigger.mTriggerType.STATIC; break; } mMyTriggers[index] = mst; } } catch (System.Exception ex) { #if (DEBUG) System.Windows.Forms.MessageBox.Show(ex.Message); #endif eLog.Debug(ex); } }
private void btnBrowse_Click(object sender, System.EventArgs e) { try { //fw.writeLine("inside frmInput.loadMap called from button " + mapType + " map click event"); this.ofdCommon.Filter = "Shape Files *.shp|*.shp"; this.ofdCommon.Title = "Browse for " + mapType + " MapManager"; if (this.ofdCommon.ShowDialog() == System.Windows.Forms.DialogResult.OK) { mMst = new MapSwapTrigger(); mMst.Path = System.IO.Path.GetDirectoryName(this.ofdCommon.FileName); mMst.Filename = System.IO.Path.GetFileNameWithoutExtension(this.ofdCommon.FileName); mMst.StartDate = this.createDate(); mMst.OriginalStartDate = mMst.StartDate; this.Hide(); } } catch (InvalidMapException ime) { MessageBox.Show(ime.Message); } catch (System.Exception ex) { eLog.Debug(ex); } }
public frmMapSelectForm() { InitializeComponent(); fillDescriptionLabel(); mMst = new MapSwapTrigger(); mCancel = false; }
public frmMapTimes(ref SimulatonManager inSimManager, ref MapSwapTrigger tmpMst, String mMapType) : this(ref inSimManager) { myMST = tmpMst; lblTimeInstr.Text = "Set time for " + mMapType + " map."; lblYear.Text = myMST.YearGrp.ToString(); lblSeason.Text = myMST.SeasonGrp.ToString(); lblDay.Text = myMST.DayGrp.ToString(); }
public void AddTrigger(MapSwapTrigger inTrigger) { mMyTriggers = new MapSwapTrigger[1]; List <MapSwapTrigger> t = new List <MapSwapTrigger>(); t.AddRange(MyTriggers); t.Add(inTrigger); MyTriggers = t.ToArray(); }
public frmMapSelectForm(ref SimulatonManager inSimManager, ref MapSwapTrigger mst, String mMapType, string mapPath) : this() { lblMapType.Text = mMapType; mapType = mMapType; mMst = mst; mySimManager = inSimManager; myMapManager = MapManager.GetUniqueInstance(); this.ofdCommon.InitialDirectory = mapPath; }