public override bool Action(string action) { bool result = base.Action(action); if (result) { List <Framework.Data.Geocache> gcList = null; if (action == ACTION_ADD_ALL) { gcList = (from Framework.Data.Geocache a in Core.Geocaches where a.PublishedTime > DateTime.Now select a).ToList(); } else if (action == ACTION_ADD_SELECTED) { gcList = (from Framework.Data.Geocache a in Core.Geocaches where a.Selected && a.PublishedTime > DateTime.Now select a).ToList(); } else if (action == ACTION_ADD_ACTIVE) { if (Core.ActiveGeocache != null && Core.ActiveGeocache.PublishedTime > DateTime.Now) { gcList = new List <Framework.Data.Geocache>(); gcList.Add(Core.ActiveGeocache); } } if (gcList == null || gcList.Count == 0) { System.Windows.Forms.MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_NOGEOCACHESELECTED), Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } else { using (AddToCalendarForm dlg = new AddToCalendarForm(Core, gcList)) { dlg.ShowDialog(); } } } return(result); }
public override bool Action(string action) { bool result = base.Action(action); if (result) { List<Framework.Data.Geocache> gcList = null; if (action == ACTION_ADD_ALL) { gcList = (from Framework.Data.Geocache a in Core.Geocaches where a.PublishedTime>DateTime.Now select a).ToList(); } else if (action == ACTION_ADD_SELECTED) { gcList = (from Framework.Data.Geocache a in Core.Geocaches where a.Selected && a.PublishedTime > DateTime.Now select a).ToList(); } else if (action == ACTION_ADD_ACTIVE) { if (Core.ActiveGeocache != null && Core.ActiveGeocache.PublishedTime > DateTime.Now) { gcList = new List<Framework.Data.Geocache>(); gcList.Add(Core.ActiveGeocache); } } if (gcList == null || gcList.Count == 0) { System.Windows.Forms.MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_NOGEOCACHESELECTED), Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } else { using (AddToCalendarForm dlg = new AddToCalendarForm(Core, gcList)) { dlg.ShowDialog(); } } } return result; }