本文整理汇总了C#中agsXMPP类的典型用法代码示例。如果您正苦于以下问题:C# agsXMPP类的具体用法?C# agsXMPP怎么用?C# agsXMPP使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
agsXMPP类属于命名空间,在下文中一共展示了agsXMPP类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Search
internal Search( agsXMPP.protocol.iq.search.Search search, Service service )
: base(_keyBase, service.Jid.Bare)
{
InitializeComponent() ;
_search.Setup( search, service ) ;
}
示例2: load
private async void load(agsXMPP.protocol.client.Presence message)
{
try
{
Client.Log("FriendRequest stuff coming");
Client.Log(message.From.User.Replace("sum", string.Empty));
var x = await RiotCalls.GetAllPublicSummonerDataByAccount(message.From.User.Replace("sum", string.Empty).ToInt());
Client.Log(x.Summoner.InternalName);
SummonerLeaguesDTO playerLeagues =
await RiotCalls.GetAllLeaguesForPlayer(x.Summoner.AcctId);
string rank = string.Empty;
foreach (LeagueListDTO l in playerLeagues.SummonerLeagues.Where(l => l.Queue == "RANKED_SOLO_5x5"))
rank = l.Tier + " " + l.RequestorsRank;
if (string.IsNullOrEmpty(rank))
rank = "Unranked";
NotificationTextBox.Text = string.Format(@"{0} would like to have you as a friend
Level: {1}
Rank: {2}", x.Summoner.InternalName, x.SummonerLevel.Level, rank);
}
catch
{
NotificationTextBox.Text = string.Format(@"{0} would like to have you as a friend", message.From.User);
}
}
示例3: MucRoomInfo
public MucRoomInfo(agsXMPP.protocol.x.data.Data xData)
{
foreach (Node node in xData.ChildNodes)
{
Field field = node as Field;
if (field != null
&& field.Label != null
&& field.GetValues().Length > 0
&& field.Var != null)
{
_data.Add(field);
if (field.GetValues() != null
&& field.GetValues().Length > 0)
{
switch (field.Var)
{
case "muc#roominfo_occupants":
{
_occupants = Int32.Parse((field.GetValues()[0]));
break;
}
case "muc#roominfo_description":
{
_description = field.GetValues()[0];
break;
}
}
}
}
}
}
示例4: OnIq
/// <summary>
/// An IQ Element is received. Now check if its one we are looking for and
/// raise the event in this case.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void OnIq(object sender, agsXMPP.protocol.client.IQ iq)
{
if (iq == null)
return;
// the tracker handles on iq responses, which are either result or error
if (iq.Type != IqType.error && iq.Type != IqType.result)
return;
string id = iq.Id;
if(id == null)
return;
TrackerData td;
lock (m_grabbing)
{
td = (TrackerData) m_grabbing[id];
if (td == null)
{
return;
}
m_grabbing.Remove(id);
}
td.cb(this, iq, td.data);
}
示例5: GetRosterImageIndex
public static int GetRosterImageIndex(agsXMPP.protocol.client.Presence pres)
{
if (pres.Type == PresenceType.unavailable)
{
return 0;
}
else if (pres.Type == PresenceType.error)
{
// presence error, we dont care in the miniclient here
}
else
{
switch (pres.Show)
{
case ShowType.NONE:
return 1;
case ShowType.away:
return 2;
case ShowType.chat:
return 4;
case ShowType.xa:
return 3;
case ShowType.dnd:
return 5;
}
}
return 0;
}
示例6: IncomingMessage
public void IncomingMessage(agsXMPP.protocol.client.Message msg)
{
rtfChat.SelectionColor = Color.Red;
rtfChat.AppendText(_nickname + " said: ");
rtfChat.SelectionColor = Color.Black;
rtfChat.AppendText(msg.Body);
rtfChat.AppendText("\r\n");
}
示例7: OnSaslStart
private void OnSaslStart(object sender, agsXMPP.Sasl.SaslEventArgs args)
{
Instrumentation.Xmpp.SaslStart();
args.Auto = false;
args.Mechanism = agsXMPP.protocol.sasl.Mechanism.GetMechanismName(MechanismType.PLAIN);
}
示例8: OutgoingMessage
private void OutgoingMessage(agsXMPP.protocol.client.Message msg)
{
rtfChat.SelectionColor = Color.Blue;
rtfChat.AppendText("Me said: ");
rtfChat.SelectionColor = Color.Black;
rtfChat.AppendText(msg.Body);
rtfChat.AppendText("\r\n");
}
示例9: SocketConnectionTypeConverter
/// <summary>
/// Convertit le type de connexion utilis� par agsXMPP en type utilis� par nJim
/// </summary>
/// <param name="type">Type de connexion</param>
/// <returns>Type de connexion</returns>
public static SocketConnectionType SocketConnectionTypeConverter(agsXMPP.net.SocketConnectionType type)
{
switch (type)
{
case agsXMPP.net.SocketConnectionType.HttpPolling: return SocketConnectionType.Http;
case agsXMPP.net.SocketConnectionType.Bosh: return SocketConnectionType.Bosh;
default: return SocketConnectionType.Normal;
}
}
示例10: profilenimbuzz
public profilenimbuzz(agsXMPP.XmppClientConnection dbcon)
{
// TODO: Complete member initialization
InitializeComponent();
this.dbcon = dbcon;
// dbcon.OnIq += new agsXMPP.protocol.client.IqHandler(dbcon_iq);
// dbcon.OnReadXml += new XmlHandler(dbcon_xmlread);
// dbcon.OnWriteXml += new XmlHandler(dbcon_xmlwrite);
}
示例11: Contact
/// <summary>
/// Constructeur
/// </summary>
public Contact(agsXMPP.Jid jid, string nickname, agsXMPP.Xml.Dom.ElementList grps)
{
_identity = new Identity(jid);
if (nickname != null && nickname.Trim() != string.Empty)
{
_identity.nickname = nickname;
}
if (grps != null)
{
foreach (agsXMPP.protocol.Base.Group g in grps)
{
if (!_groups.Contains(g.Name))
{
_groups.Add(g.Name);
}
}
}
_status = new Status();
_status.type = Enums.StatusType.Unavailable;
_status.message = string.Empty;
_mood = new Mood();
_mood.type = Enums.MoodType.none;
_mood.text = string.Empty;
_activity = new Activity();
_activity.type = Enums.ActivityType.none;
_activity.text = string.Empty;
_location = new Location();
_location.altitude = 0;
_location.latitude = 0;
_location.longitude = 0;
_location.bearing = 0;
_location.error = 0;
_location.speed = 0;
_location.area = string.Empty;
_location.building = string.Empty;
_location.country = string.Empty;
_location.datum = string.Empty;
_location.description = string.Empty;
_location.floor = string.Empty;
_location.locality = string.Empty;
_location.postalcode = string.Empty;
_location.region = string.Empty;
_location.room = string.Empty;
_location.street = string.Empty;
_location.text = string.Empty;
_location.timestamp = new DateTime();
_location.uri = string.Empty;
_tune = new Tune();
_tune.artist = string.Empty;
_tune.length = 0;
_tune.rating = 1;
_tune.source = string.Empty;
_tune.title = string.Empty;
_tune.track = 0;
_tune.uri = string.Empty;
}
示例12: MucMessage
public MucMessage(agsXMPP.protocol.client.Message message, MucContact sender)
{
_message = message;
_sender = sender;
if (_message.XDelay != null)
{
DateTime = new RelativeOldness(_message.XDelay.Stamp);
}
}
示例13: SearchServiceResult
protected void SearchServiceResult( agsXMPP.protocol.iq.search.Search search, Service service )
{
BaseWindow window = WindowManager.Find(WindowManager.MakeKey(UI.Search._keyBase, service.Jid.Bare)) as BaseWindow;
if (window != null)
{
((UI.Search)window).DisplaySearchResult(search, service);
window.Show();
window.Activate();
}
}
示例14: FriendInvite
public FriendInvite(ChatSubjects subject, agsXMPP.protocol.client.Presence message)
{
InitializeComponent();
if (subject == ChatSubjects.XMPP_SUBSCRIBE)
{
jid = message.From;
Client.Log(jid.Bare);
load(message);
}
}
示例15: loggednimbuzz
// private agsXMPP.XmppClientConnection dbco2;
public loggednimbuzz(ListBox.ObjectCollection objectCollection, agsXMPP.XmppClientConnection dbcon)
{
// TODO: Complete member initialization
InitializeComponent();
this.objectCollection = objectCollection;
this.dbcon = dbcon;
// dbcon.OnRosterItem += new XmppClientConnection.RosterHandler(dbcon_OnRosterItem);
dbcon.OnMessage += new agsXMPP.protocol.client.MessageHandler(dcon_onmsg);
dbcon.OnPresence += new agsXMPP.protocol.client.PresenceHandler(dbcon_onpresence);
}