Пример #1
0
        public override bool Action(string action)
        {
            bool result = base.Action(action);

            if (result)
            {
                if (action == ACTION_EDIT_ALL || action == ACTION_EDIT_SELECTED)
                {
                    List <Framework.Data.Geocache> gcList = null;
                    if (action == ACTION_EDIT_ALL)
                    {
                        gcList = (from Framework.Data.Geocache a in Core.Geocaches select a).ToList();
                    }
                    else if (action == ACTION_EDIT_SELECTED)
                    {
                        gcList = Utils.DataAccess.GetSelectedGeocaches(Core.Geocaches);
                    }
                    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 (MassGCEditorForm dlg = new MassGCEditorForm(Core, gcList))
                        {
                            dlg.ShowDialog();
                        }
                    }
                }
            }
            return(result);
        }
Пример #2
0
 public override bool Action(string action)
 {
     bool result = base.Action(action);
     if (result)
     {
         if (action == ACTION_EDIT_ALL || action==ACTION_EDIT_SELECTED)
         {
             List<Framework.Data.Geocache> gcList = null;
             if (action == ACTION_EDIT_ALL)
             {
                 gcList = (from Framework.Data.Geocache a in Core.Geocaches select a).ToList();
             }
             else if (action == ACTION_EDIT_SELECTED)
             {
                 gcList = Utils.DataAccess.GetSelectedGeocaches(Core.Geocaches);
             }
             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 (MassGCEditorForm dlg = new MassGCEditorForm(Core, gcList))
                 {
                     dlg.ShowDialog();
                 }
             }
         }
     }
     return result;
 }