Created
July 25, 2012 02:12
-
-
Save carlosrivera/3173965 to your computer and use it in GitHub Desktop.
WindowsLive Messenger Agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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