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 PingbackPingCompletedEventArgs : EventArgs, IComparable
Visual Basic (Declaration)
Public Class PingbackPingCompletedEventArgs _
	Inherits EventArgs _
	Implements IComparable
Visual C++
public ref class PingbackPingCompletedEventArgs : public EventArgs, 
	IComparable

Remarks

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

Examples

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

using Argotic.Core.Net;

namespace Argotic.Test
{
    public class PingbackPingCompletedEventArgsCS
    {
        public PingbackPingCompletedEventArgsCS()
        {
            //------------------------------------------------------------
            //    Initialize the pingback client
            //------------------------------------------------------------
            PingbackClient client          = new PingbackClient();
            client.SendCompleted           += new EventHandler<PingbackPingCompletedEventArgs>(Client_SendCompleted);

            //------------------------------------------------------------
            //    Define the pingback ping message to send
            //------------------------------------------------------------
            PingbackMessage message         = new PingbackMessage();
            message.Source                  = new Uri("http://alice.example.org/#p123");
            message.Target                  = new Uri("http://bob.example.net/#foo");
            message.Encoding                = Encoding.UTF8;
            message.UserAgent               = XmlRpcMessage.FrameworkUserAgent;

            //------------------------------------------------------------
            //    Send the trackback ping
            //------------------------------------------------------------
            XmlRpcResponse pingResponse;
            pingResponse                    = client.SendAsync(new Uri("http://bob.example.net/xmlrpcserver"), message, null);

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

                //------------------------------------------------------------
                //    Determine if pingback ping was sucessful
                //------------------------------------------------------------
                if(pingResponse.HasFault)
                {
                    //------------------------------------------------------------
                    //    Get reason provided for pingback ping failure
                    //------------------------------------------------------------
                    int failureFaultCode        = pingResponse.FaultCode;
                    string reasonForPingFailure = pingResponse.FaultReason;
                }
            }
        }
    }
}

Inheritance Hierarchy

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

See Also