Skip to content

Instantly share code, notes, and snippets.

@carlosrivera
Created July 25, 2012 02:12
Show Gist options
  • Save carlosrivera/3173965 to your computer and use it in GitHub Desktop.
Save carlosrivera/3173965 to your computer and use it in GitHub Desktop.
WindowsLive Messenger Agent
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Messenger;
namespace WindowsLiveMessengerAgent
{
public class MessengerAddIn
: IMessengerAddIn
{
private MessengerClient _client;
private void IncomingTextMessage(object sender, IncomingTextMessageEventArgs e)
{
if (_client.LocalUser.Status == UserStatus.Away)
_client.SendTextMessage(
"Lo siento, en este momento me encuentro ausente" +
"\nDeja tu mensaje y me comunico más tarde\n\n" +
_client.LocalUser.FriendlyName, e.UserFrom
);
}
#region IMessengerAddIn Members
public void Initialize(MessengerClient messenger)
{
_client = messenger;
_client.AddInProperties.FriendlyName = "WindowsLiveMessengerAgent";
_client.AddInProperties.Description = "Este agente responde cuando no estas en linea.";
_client.IncomingTextMessage +=
new EventHandler<IncomingTextMessageEventArgs> (this.IncomingTextMessage);
}
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment