private void Invoke()
        {
            //string apicall = @"http://api.geonames.org/wikipediaBoundingBoxJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=devfish";
            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            WikipediaBoundingBoxHelper _apihelper = new WikipediaBoundingBoxHelper(_username, 44.2, -10, -22.5, 55.3);

            string _apicall = _apihelper.TargetURL;

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            api_findNearbyPlaces.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }
Exemple #2
0
        private void Invoke()
        {
            m_msghelper.clr();
            m_msghelper.msg(System.DateTime.Now.ToString() + " : " + "Invoke()");

            //string apicall = @"http://api.geonames.org/wikipediaBoundingBoxJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=devfish";
            string _username = APIMASHGlobals.Instance.UserID;

            if (_username.Length <= 0)
            {
                MessageDialogHelper.ShowMsg("username", "valid geonames username is required to be set, use the CHARMS=>SETTINGS menu to enter yours");
                return;
            }

            double _latUL = 0.0;
            double _lonUL = 0.0;
            double _lonLR = 0.0;
            double _latLR = 0.0;

            try
            {
                _latUL = System.Convert.ToDouble(TextBox_LatUL.Text);
                _lonUL = System.Convert.ToDouble(TextBox_LonUL.Text);
                _latLR = System.Convert.ToDouble(TextBox_LatLR.Text);
                _lonLR = System.Convert.ToDouble(TextBox_LonLR.Text);
            }
            catch
            {
                m_msghelper.msg("one of the latlon pairs is in invalid format");
                return;
            }

            WikipediaBoundingBoxHelper _apihelper = new WikipediaBoundingBoxHelper(_username, _latUL, _latLR, _lonUL, _lonLR);

            string _apicall = _apihelper.TargetURL;

            System.Diagnostics.Debug.WriteLine("TargetURL=" + _apicall);

            m_msghelper.msg("invoking against " + _apicall);
            api_findNearbyPlaces.Invoke <APIMASH_WikiPediaLib.APIMASH_OM>(_apicall);
        }