本文整理汇总了C#中agsXMPP.protocol.client.Presence类的典型用法代码示例。如果您正苦于以下问题:C# Presence类的具体用法?C# Presence怎么用?C# Presence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Presence类属于agsXMPP.protocol.client命名空间,在下文中一共展示了Presence类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Client
public Client()
{
Xmpp = new XmppClientConnection("skylabsonline.com");
Xmpp.OnRegistered += XmppOnOnRegistered;
Xmpp.OnRegisterError += XmppOnOnRegisterError;
Xmpp.OnXmppConnectionStateChanged += XmppOnOnXmppConnectionStateChanged;
Xmpp.OnLogin += XmppOnOnLogin;
Xmpp.OnAuthError += XmppOnOnAuthError;
Xmpp.OnRosterItem += XmppOnOnRosterItem;
Xmpp.OnRosterEnd += XmppOnOnRosterEnd;
Xmpp.OnRosterStart += XmppOnOnRosterStart;
Xmpp.OnMessage += XmppOnOnMessage;
Xmpp.OnPresence += XmppOnOnPresence;
Xmpp.OnAgentItem += XmppOnOnAgentItem;
Xmpp.OnIq += XmppOnOnIq;
Xmpp.OnReadXml += XmppOnOnReadXml;
Notifications = new List<Notification>();
Friends = new List<NewUser>();
//GroupChats = new List<NewUser>();
myPresence = new Presence();
Chatting = new Chat(this,Xmpp);
CurrentHostedGamePort = -1;
_games = new List<HostedGameData>();
agsXMPP.Factory.ElementFactory.AddElementType("gameitem", "octgn:gameitem", typeof(HostedGameData));
}
开发者ID:bejumi,项目名称:OCTGN,代码行数:25,代码来源:Client.cs
示例2: GetRosterImageIndex
public static int GetRosterImageIndex(Presence pres)
{
if (pres.Type == PresenceType.unavailable)
{
return 0;
}
else if (pres.Type == PresenceType.error)
{
// Don't do anythng 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;
}
开发者ID:koralarts,项目名称:HipsterChat,代码行数:28,代码来源:Util.cs
示例3: Contact
public Contact(Presence presence)
{
_rosterItem = new RosterItem();
_rosterItem.Jid = presence.From;
BuildSearchText();
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:7,代码来源:Contact.cs
示例4: GetPointsOfShowType
private static int GetPointsOfShowType(Presence presence)
{
if (presence == null)
{
return 0;
}
if (presence.Type == PresenceType.available)
{
switch (presence.Show)
{
case ShowType.dnd:
{
return 3;
}
case ShowType.xa:
{
return 4;
}
case ShowType.away:
{
return 5;
}
default:
{
return 6;
}
}
}
else
{
return 0;
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:34,代码来源:PresenceCompare.cs
示例5: update
//TODO: also check showType
public void update(Presence presence)
{
string sJid = presence.From.Bare;
string sText = presence.Status;
bool isOnline = false;
//handle PresenceType
if ((presence.Type == PresenceType.available) || (presence.Type == PresenceType.invisible)) {
isOnline = true;
} else if (presence.Type == PresenceType.subscribe) {
//TODO: handle subscribe request
} else if (presence.Type == PresenceType.subscribed) {
//TODO: handle answered subscribe message
} else if (presence.Type == PresenceType.unavailable) {
isOnline = false;
}
//update presenceList
for (int i = 0; i < m_PresenceList.Count; i++) {
if (m_PresenceList [i].sJid == sJid) {
m_PresenceList.RemoveAt (i);
break;
}
}
//add ContactPresence if it does not exist
ContactPresence newPresence = new ContactPresence ();
newPresence.sJid = sJid;
newPresence.bIsOnline = isOnline;
newPresence.sText = sText;
this.m_PresenceList.Add (newPresence);
}
开发者ID:crypto-ink,项目名称:CryptoInkLib,代码行数:34,代码来源:PresenceManager.cs
示例6: XmppConnectOnOnPresence
public void XmppConnectOnOnPresence(object sender, Presence pres)
{
try
{
if (pres.GetAttribute("name") == "Facebook User")
{
return;
}
Core.Presences.Add(pres);
try
{
var chatItem = new ChatPlayerItem
{
Group = pres.GetAttribute("group"),
IsOnline = true,
Jid = new Jid(pres.GetAttribute("jid")),
Messages = new List<string>(),
Username = pres.GetAttribute("name")
};
Core.AllPlayers.Add(pres.GetAttribute("name"), chatItem);
}
catch
{
var item = Core.AllPlayers[pres.GetAttribute("name")];
Core.AllPlayers.Remove(pres.GetAttribute("name"));
item.IsOnline = true;
Core.AllPlayers.Add(pres.GetAttribute("name"), item);
}
}
catch
{
//MessageBox.Show(ex.ToString());
}
}
开发者ID:huynkprovn,项目名称:Facebook-Desktop,代码行数:34,代码来源:LoginPage.xaml.cs
示例7: Unsubcribe
/// <summary>
/// Unsubscribe from a contact
/// </summary>
/// <param name="to">Bare Jid of the rosteritem we want to unsubscribe</param>
public void Unsubcribe(Jid to)
{
// <presence to='[email protected]' type='subscribe'/>
Presence pres = new Presence();
pres.Type = PresenceType.unsubscribe;
pres.To = to;
m_connection.Send(pres);
}
开发者ID:SiteView,项目名称:ECC8.13,代码行数:13,代码来源:PresenceManager.cs
示例8: EventPresenceChanged
public EventPresenceChanged(Contact contact, Presence oldPresence, Presence newPresence)
: base(String.Empty, EventSeverity.Info)
{
_contact = contact;
_oldPresence = oldPresence;
_newPresence = newPresence;
Expiration = DateTime.Now.AddSeconds(Settings.Default.UI_Notify_Presence_Exp);
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:9,代码来源:EventStatusChanged.cs
示例9: RefuseSubscriptionRequest
//Example: Refusing a presence subscription request:
//<presence to='[email protected]' type='unsubscribed'/>
/// <summary>
/// Refuse subscription request
/// </summary>
/// <param name="to">Bare Jid to approve</param>
public void RefuseSubscriptionRequest(Jid to)
{
// <presence to='[email protected]' type='subscribe'/>
Presence pres = new Presence();
pres.Type = PresenceType.unsubscribed;
pres.To = to;
m_connection.Send(pres);
}
开发者ID:jptoto,项目名称:argsxmpp,代码行数:15,代码来源:PresenceManager.cs
示例10: Subcribe
/// <summary>
/// Subscribe to a contact
/// </summary>
/// <param name="to">Bare Jid of the rosteritem we want to subscribe</param>
/// <param name="message">a message which normally contains the reason why we want to subscibe to this contact</param>
public void Subcribe(Jid to, string message)
{
Presence pres = new Presence();
pres.Type = PresenceType.subscribe;
pres.To = to;
pres.Status = message;
m_connection.Send(pres);
}
开发者ID:SiteView,项目名称:ECC8.13,代码行数:14,代码来源:PresenceManager.cs
示例11: AskAuthorization
public AskAuthorization(Presence presence)
: base(_keyBase, presence.From.Bare)
{
InitializeComponent();
Contact contact = new Contact(presence);
DataContext = contact;
_contact.Content = contact;
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:10,代码来源:AskAuthorization.xaml.cs
示例12: OnPresence
private void OnPresence(object sender, Presence pres)
{
foreach (var presenceHandler in _handlers)
{
if (presenceHandler.IsApplicable(pres))
{
presenceHandler.UpdateState(pres);
}
}
}
开发者ID:Irdis,项目名称:VSTalk,代码行数:10,代码来源:PresenceObserver.cs
示例13: frmGroupChat_FormClosed
/// <summary>
/// Envio una precencia de aviso de abandono de sala
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmGroupChat_FormClosed(object sender, FormClosedEventArgs e)
{
if (_RoomJid != null)
{
Presence pres = new Presence();
pres.To = _RoomJid;
pres.Type = PresenceType.unavailable;
Util.XmppServices.XmppCon.Send(pres);
}
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:15,代码来源:frmGroupChat.cs
示例14: xmpp_OnPresence
private void xmpp_OnPresence(object sender, Presence pres)
{
if (pres.Type == PresenceType.subscribe)
{
xmpp.PresenceManager.ApproveSubscriptionRequest(pres.From);
}
else if (pres.Type == PresenceType.available)
{
//Xmpp.Send(new Message(pres.From, "Versículo de hoje: \"Porque Deus amou ao mundo de tal maneira que deu o seu Filho unigênito, para que todo o que nele crê não pereça, mas tenha a vida eterna.\" João 3:16"));
}
}
开发者ID:abibliafalada,项目名称:abibliafalada-v2,代码行数:11,代码来源:GTalkBot.cs
示例15: OnPresence
public void OnPresence(Client client, Presence presence)
{
var clientContext = SessionModel.GetClientContext(client);
if (clientContext.Jid.Equals(presence.From, new CaseInsensitiveComparer()))
{
return;
}
var fromJid = presence.From.ToString().ToLower();
var capsKey = new CapsSource(client, fromJid);
ProcessedPresence(capsKey, presence);
}
开发者ID:Irdis,项目名称:VSTalk,代码行数:11,代码来源:CapsService.cs
示例16: xmpp_OnLogin
private void xmpp_OnLogin(object sender)
{
Presence p = new Presence(ShowType.chat, "Online");
p.Type = PresenceType.invisible;
xmpp.Send(p);
xmpp.MessageGrabber.Add(new Jid(Properties.Settings.Default.JabberBroadcaster),
new BareJidComparer(),
new MessageCB(MessageCallBack),
null);
}
开发者ID:R3MUSDevPack,项目名称:ReconnectedServerStuff,代码行数:11,代码来源:JabberListener.cs
示例17: findPresence
public static Presence findPresence(List<Presence> haystack, Presence needle)
{
Presence findPres = haystack.Find(
delegate(Presence pr)
{
return pr.From.User == needle.From.User;
}
);
return findPres;
}
开发者ID:DarkActive,项目名称:LoLQuery,代码行数:11,代码来源:RiotChat.cs
示例18: frmGroupChat_Load
/// <summary>
/// Se envia la precencia a la sala
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void frmGroupChat_Load(object sender, EventArgs e)
{
if (_RoomJid != null)
{
Presence pres = new Presence();
Jid to = new Jid(_RoomJid.ToString());
to.Resource = m_Nickname;
pres.To = to;
Util.XmppServices.XmppCon.Send(pres);
}
}
开发者ID:spzenk,项目名称:sfdocsamples,代码行数:17,代码来源:frmGroupChat.cs
示例19: OnPresence
private void OnPresence(object sender, Presence pres)
{
if (m_listener == null)
return;
if (pres.From.Bare != Jid)
return;
m_listener.OnPresence(
new PresenceMessage(
pres.From.Resource,
pres.From,
pres.Type == PresenceType.unavailable,
pres.Show == ShowType.away));
}
开发者ID:dustyburwell,项目名称:jell,代码行数:15,代码来源:XmppChatRoom.cs
示例20: ShowPresence
private void ShowPresence(Presence presence)
{
try
{
AskAuthorization authorization = new AskAuthorization(presence);
authorization.Show();
authorization.Activate();
}
catch (WindowExistsException e)
{
e.ActivateControl();
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:15,代码来源:Authorization.cs
注:本文中的agsXMPP.protocol.client.Presence类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论