Sets the user's activity to the specified activity value(s).

Namespace: S22.Xmpp.Client
Assembly: S22.Xmpp (in S22.Xmpp.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public void SetActivity(
	GeneralActivity activity,
	SpecificActivity specific = SpecificActivity.Other,
	string description = null
)

Parameters

activity
Type: S22.Xmpp.Extensions..::..GeneralActivity
A value from the GeneralActivity enumeration to set the user's general activity to.
specific (Optional)
Type: S22.Xmpp.Extensions..::..SpecificActivity
A value from the SpecificActivity enumeration best describing the user's activity in more detail.
description (Optional)
Type: System..::..String
A natural-language description of, or reason for, the activity.

Examples

This example demonstrates how to use the SetActivity method in order to publish the user's current activity.
CopyC#
  string hostname = "jabber.se",
    username = "myUsername",
    password = "myPassword";

  using (var cl = new XmppClient(hostname, username, password)) {
    cl.Connect();

    // Let your contacts know what you are currently doing.
    cl.SetActivity(GeneralActivity.Eating, SpecificActivity.HavingBreakfast);

    Console.WriteLine("Type 'quit' to exit.");
    while(Console.ReadLine() != "quit");
}

Exceptions

ExceptionCondition
System..::..InvalidOperationExceptionThe XmppClient instance is not connected to a remote host, or the XmppClient instance has not authenticated with the XMPP server.
System..::..ObjectDisposedExceptionThe XmppClient object has been disposed.

See Also