コード例 #1
0
ファイル: GarminCommunicator.cs プロジェクト: RH-Code/GAPP
        public override bool Action(string action)
        {
            bool result = base.Action(action);
            if (result)
            {
                if (action == ACTION_EXPORT_ACTIVE || action == ACTION_EXPORT_SELECTED)
                {
                    List<Framework.Data.Geocache> gcList = null;
                    if (action == ACTION_EXPORT_SELECTED)
                    {
                        gcList = Utils.DataAccess.GetSelectedGeocaches(Core.Geocaches);
                    }
                    else
                    {
                        if (Core.ActiveGeocache != null)
                        {
                            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 (GarminCommunicatorForm dlg = new GarminCommunicatorForm(Core, gcList))
                        {
                            dlg.ShowDialog();
                        }
                    }
                }
            }
            return result;
        }
コード例 #2
0
        public override bool Action(string action)
        {
            bool result = base.Action(action);

            if (result)
            {
                if (action == ACTION_EXPORT_ACTIVE || action == ACTION_EXPORT_SELECTED)
                {
                    List <Framework.Data.Geocache> gcList = null;
                    if (action == ACTION_EXPORT_SELECTED)
                    {
                        gcList = Utils.DataAccess.GetSelectedGeocaches(Core.Geocaches);
                    }
                    else
                    {
                        if (Core.ActiveGeocache != null)
                        {
                            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 (GarminCommunicatorForm dlg = new GarminCommunicatorForm(Core, gcList))
                        {
                            dlg.ShowDialog();
                        }
                    }
                }
            }
            return(result);
        }