コード例 #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);
        }
コード例 #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);
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
ファイル: Import.cs プロジェクト: gahadzikwa/GAPP
        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;
        }
コード例 #4
0
ファイル: Import.cs プロジェクト: gahadzikwa/GAPP
 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);
                     }
                 }
             }
         }
     }
 }