Esempio n. 1
0
        public async override Task <bool> ActionAsync(string action)
        {
            bool result = base.Action(action);

            if (result)
            {
                if (Utils.API.GeocachingLiveV6.CheckAPIAccessAvailable(Core, true))
                {
                    using (ImportForm dlg = new ImportForm(Core))
                    {
                        if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            _gcList = dlg.SelectedGCCodes;
                            if (_gcList != null && _gcList.Count > 0)
                            {
                                _gcList = Utils.GeocacheIgnoreSupport.Instance.FilterGeocaches(_gcList);

                                if (_gcList != null && _gcList.Count > 0)
                                {
                                    _errormessage = null;
                                    await PerformImport();

                                    if (!string.IsNullOrEmpty(_errormessage))
                                    {
                                        System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
 public void ImportBookmark(string name, string url)
 {
     if (Utils.API.GeocachingLiveV6.CheckAPIAccessAvailable(Core, true))
     {
         using (ImportForm dlg = new ImportForm(Core, name, url))
         {
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 _gcList = dlg.SelectedGCCodes;
                 if (_gcList != null && _gcList.Count > 0)
                 {
                     _errormessage = null;
                     PerformImport();
                     if (!string.IsNullOrEmpty(_errormessage))
                     {
                         System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                     }
                 }
             }
         }
     }
 }
Esempio n. 3
0
        public async override Task<bool> ActionAsync(string action)
        {
            bool result = base.Action(action);
            if (result)
            {
                if (Utils.API.GeocachingLiveV6.CheckAPIAccessAvailable(Core, true))
                {
                    using (ImportForm dlg = new ImportForm(Core))
                    {
                        if (dlg.ShowDialog()== System.Windows.Forms.DialogResult.OK)
                        {
                            _gcList = dlg.SelectedGCCodes;
                            if (_gcList != null && _gcList.Count > 0)
                            {
                                _gcList = Utils.GeocacheIgnoreSupport.Instance.FilterGeocaches(_gcList);

                                if (_gcList != null && _gcList.Count > 0)
                                {
                                    _errormessage = null;
                                    await PerformImport();
                                    if (!string.IsNullOrEmpty(_errormessage))
                                    {
                                        System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return result;
        }
Esempio n. 4
0
 public void ImportBookmark(string name, string url)
 {
     if (Utils.API.GeocachingLiveV6.CheckAPIAccessAvailable(Core, true))
     {
         using (ImportForm dlg = new ImportForm(Core, name, url))
         {
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 _gcList = dlg.SelectedGCCodes;
                 if (_gcList != null && _gcList.Count > 0)
                 {
                     _errormessage = null;
                     PerformImport();
                     if (!string.IsNullOrEmpty(_errormessage))
                     {
                         System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                     }
                 }
             }
         }
     }
 }