Ejemplo n.º 1
0
        private void ServerList_Click(object sender, EventArgs e)
        {
            _retrievingData.Visible = true;

            try
            {
                String assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version.ToString();

                if (_reintroduce)
                {
                    _pendingAsyncResult = (WebClientAsyncResult)_service.BeginGetExtinctSpecies(assemblyVersion, "", new AsyncCallback(ExtinctSpeciesCallback), null);
                }
                else
                {
                    _pendingAsyncResult = (WebClientAsyncResult)_service.BeginGetAllSpecies(assemblyVersion, "", new AsyncCallback(AllSpeciesCallback), null);
                }
            }
            catch (WebException)
            {
                MessageBox.Show(this, "The connection to the server timed out.  Please try again later.");
            }
        }
Ejemplo n.º 2
0
        private void ServerList_Click(object sender, EventArgs e)
        {
            this.retrievingData.Visible = true;

            service         = new SpeciesService();
            service.Timeout = 10000;
            service.Url     = GameConfig.WebRoot + "/Species/AddSpecies.asmx";

            try
            {
                if (reintroduce)
                {
                    pendingAsyncResult = (WebClientAsyncResult)service.BeginGetExtinctSpecies(Assembly.GetExecutingAssembly().GetName().Version.ToString(), "", new AsyncCallback(ExtinctSpeciesCallback), null);
                }
                else
                {
                    pendingAsyncResult = (WebClientAsyncResult)service.BeginGetAllSpecies(Assembly.GetExecutingAssembly().GetName().Version.ToString(), "", new AsyncCallback(AllSpeciesCallback), null);
                }
            }
            catch (WebException)
            {
                MessageBox.Show(this, "The connection to the server timed out.  Please try again later.");
            }
        }