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

            if (result && action == ACTION_IMPORT)
            {
                if (SiteManager.Instance.CheckAPIAccess())
                {
                    using (ImportByRadiusForm dlg = new ImportByRadiusForm(Core))
                    {
                        if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                        {
                            _filter    = dlg.Filter;
                            _radiusKm  = dlg.RadiusKm;
                            _centerLoc = dlg.Center;
                            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 async override Task<bool> ActionAsync(string action)
 {
     bool result = base.Action(action);
     if (result && action == ACTION_IMPORT)
     {
         if (SiteManager.Instance.CheckAPIAccess())
         {
             using (ImportByRadiusForm dlg = new ImportByRadiusForm(Core))
             {
                 if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     _filter = dlg.Filter;
                     _radiusKm = dlg.RadiusKm;
                     _centerLoc = dlg.Center;
                     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;
 }