Provides data for the SendCompleted event.

Namespace:  Argotic.Core.Net
Assembly:  Argotic.Core (in Argotic.Core)
Version: 2007.3.0.0 (2007.3.0.0)

Syntax

C#
public class TrackbackPingCompletedEventArgs : EventArgs, IComparable
Visual Basic (Declaration)
Public Class TrackbackPingCompletedEventArgs _
	Inherits EventArgs _
	Implements IComparable
Visual C++
public ref class TrackbackPingCompletedEventArgs : public EventArgs, 
	IComparable

Remarks

A SendCompleted event occurs whenever the SendAsync(TrackbackMessage, Object) method is called.

Examples

The following code example demonstrates the usage of TrackbackPingCompletedEventArgs.
CopyC#
using System;
using System.Text;

using Argotic.Core.Net;

namespace Argotic.Test
{
    public class TrackbackPingCompletedEventArgsCS
    {
        public TrackbackPingCompletedEventArgsCS()
        {
            //------------------------------------------------------------
            //    Initialize the trackback client
            //------------------------------------------------------------
            TrackbackClient client          = new TrackbackClient();
            client.SendCompleted            += new EventHandler<TrackbackPingCompletedEventArgs>(Client_SendCompleted);

            //------------------------------------------------------------
            //    Define the trackback ping message to send
            //------------------------------------------------------------
            TrackbackMessage message    = new TrackbackMessage();
            message.Permalink               = new Uri("http://www.bar.com/");
            message.Encoding                = Encoding.UTF8;
            message.Title                   = "Foo Bar";
            message.BlogName                = "Foo";
            message.Excerpt                 = "My Excerpt";

            //------------------------------------------------------------
            //    Send the trackback ping
            //------------------------------------------------------------
            TrackbackResponse pingResponse;
            pingResponse                    = client.SendAsync(new Uri("http://www.example.com/trackback/5"), message, null);

            /// <summary>
            /// Handles the SendCompleted event for the TrackbackClient.
            /// </summary>
            /// <param name="sender">The source of the event.</param>
            /// <param name="e">A <see cref="Argotic.Core.Net.TrackbackPingCompletedEventArgs"/> containing the event data.</param>
            private void Client_SendCompleted(Object sender, TrackbackPingCompletedEventArgs e)
            {
                //------------------------------------------------------------
                //    Get trackback ping response returned by async operation
                //------------------------------------------------------------
                TrackbackResponse pingResponse  = e.Response;

                //------------------------------------------------------------
                //    Determine if trackback ping was sucessful
                //------------------------------------------------------------
                if(pingResponse.HasError)
                {
                    //------------------------------------------------------------
                    //    Get reason provided for trackback ping failure
                    //------------------------------------------------------------
                    string reasonForPingFailure = pingResponse.Message;
                }
            }
        }
    }
}

Inheritance Hierarchy

System..::.Object
  System..::.EventArgs
    Argotic.Core.Net..::.TrackbackPingCompletedEventArgs

See Also