Пример #1
0
        /// <summary>
        /// Verifies the Connection to the Path of Exile API
        /// </summary>
        /// <returns></returns>
        public async Task VerifyConnectionAsync()
        {
            var request = new Request(UserAgent);

            string urlToTest = $"{ApiUrl}leagues";

            int status = await request.GetStatusAsync(urlToTest);

            if (status.ToString().StartsWith("2"))
            {
                ConnectedEventArgs e = new ConnectedEventArgs
                {
                    Status = status,
                    URL    = urlToTest
                };

                IsConnected = true;

                OnConnected(e);
            }
        }
Пример #2
0
 /// <summary>
 ///     Overridable OnConnected Method. Raises Connection Event
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnConnected(ConnectedEventArgs e)
 {
     Connected?.Invoke(this, e);
 }