本文整理汇总了C#中agsXMPP.XmppClientConnection类的典型用法代码示例。如果您正苦于以下问题:C# XmppClientConnection类的具体用法?C# XmppClientConnection怎么用?C# XmppClientConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmppClientConnection类属于agsXMPP命名空间,在下文中一共展示了XmppClientConnection类的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: Run
public override Task Run()
{
_xmppConnection = new XmppClientConnection
{
Server = _host,
ConnectServer = _connectHost,
AutoResolveConnectServer = true,
Username = _username,
Password = _password,
};
_xmppConnection.OnLogin += OnLogin;
_xmppConnection.OnError += OnError;
_xmppConnection.OnMessage += OnMessage;
_xmppConnection.OnPresence += XmppConnectionOnOnPresence;
_xmppConnection.OnRosterItem += OnClientRosterItem;
CancelPreviousLogin();
_loginTcs = new TaskCompletionSource<bool>();
_xmppConnection.Open();
//return _loginTcs == null ? Task.FromResult(false) : _loginTcs.Task;
return Task.FromResult(false);
}
开发者ID:jamessantiago,项目名称:mmbot,代码行数:28,代码来源:XmppAdapter.cs
示例3: Init
public override void Init(XmppClientConnection con)
{
base.XmppClientConnection = con;
DoClientAuth();
}
开发者ID:don59,项目名称:agsXmpp,代码行数:7,代码来源:XGoogleTokenMechanism.cs
示例4: XMPPClient
public XMPPClient()
{
_connection = new XmppClientConnection(XMPPServer);
_connection.OnLogin += ConnectionOnLogin;
_connection.OnMessage += OnMessage;
ConnectToXmppServer();
}
开发者ID:Rophuine,项目名称:GitHub-XMPP,代码行数:7,代码来源:XMPPClient.cs
示例5: Conectar
public void Conectar(string user, string password)
{
XmppClientConnection xmpp = new XmppClientConnection("pvp.net");
xmpp.UseSSL = true;
xmpp.Port = 5223;
xmpp.Resource = "xiff";
xmpp.AutoResolveConnectServer = false;
xmpp.ConnectServer = "chat.euw1.lol.riotgames.com";
//Presence p = new Presence(ShowType.chat, "Online");
//p.Type = PresenceType.available;
//xmpp.Send(p);
xmpp.OnRosterItem += new XmppClientConnection.RosterHandler( xmpp_OnRosterItem);
xmpp.OnPresence += new PresenceHandler(xmpp_OnPresence);
xmpp.Open(user, "AIR_" + password);
//xmpp.OnLogin += delegate (object o) { MessageBox.Show("Logged in as " + xmpp.Username); };
System.Threading.Thread.Sleep(2000);
foreach (string nome in Contactos_Todos)
{
Offline_Friends.Items.Add(nome);
}
foreach (string nome in Contactos)
{
Online_Friends.Items.Add(nome);
}
button.Background = Brushes.Green;
button.IsEnabled = false;
button.Content = "CONECTED!";
}
开发者ID:TheWebs,项目名称:LeagueOfLegends_Chat,代码行数:34,代码来源:MainWindow.xaml.cs
示例6: RemakeXmpp
public static void RemakeXmpp()
{
if (Xmpp != null)
{
Xmpp.OnXmppConnectionStateChanged -= XmppOnOnXmppConnectionStateChanged;
Xmpp.Close();
Xmpp = null;
}
Xmpp = new XmppClientConnection(ServerPath);
Xmpp.RegisterAccount = false;
Xmpp.AutoAgents = true;
Xmpp.AutoPresence = true;
Xmpp.AutoRoster = true;
Xmpp.Username = XmppUsername;
Xmpp.Password = XmppPassword;
Xmpp.Priority = 1;
Xmpp.OnMessage += XmppOnOnMessage;
Xmpp.OnError += XmppOnOnError;
Xmpp.OnAuthError += new XmppElementHandler(Xmpp_OnAuthError);
Xmpp.OnStreamError += XmppOnOnStreamError;
Xmpp.KeepAlive = true;
Xmpp.KeepAliveInterval = 60;
Xmpp.OnAgentStart += XmppOnOnAgentStart;
Xmpp.OnXmppConnectionStateChanged += XmppOnOnXmppConnectionStateChanged;
Xmpp.Open();
}
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:27,代码来源:GameBot.cs
示例7: OnStartup
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
XmppConnection = new XmppClientConnection();
XmppConnection.AutoResolveConnectServer = true;
}
开发者ID:micahlmartin,项目名称:RPS-Xmpp,代码行数:7,代码来源:App.xaml.cs
示例8: frmMain
public frmMain()
{
InitializeComponent();
// initialize Combo Status
InitStatusCombo();
// initilaize XmppConnection and setup all event handlers
XmppCon = new XmppClientConnection();
XmppCon.OnReadXml += new XmlHandler(XmppCon_OnReadXml);
XmppCon.OnWriteXml += new XmlHandler(XmppCon_OnWriteXml);
XmppCon.OnRosterStart += new ObjectHandler(XmppCon_OnRosterStart);
XmppCon.OnRosterEnd += new ObjectHandler(XmppCon_OnRosterEnd);
XmppCon.OnRosterItem += new agsXMPP.XmppClientConnection.RosterHandler(XmppCon_OnRosterItem);
XmppCon.OnAgentStart += new ObjectHandler(XmppCon_OnAgentStart);
XmppCon.OnAgentEnd += new ObjectHandler(XmppCon_OnAgentEnd);
XmppCon.OnAgentItem += new agsXMPP.XmppClientConnection.AgentHandler(XmppCon_OnAgentItem);
XmppCon.OnLogin += new ObjectHandler(XmppCon_OnLogin);
XmppCon.OnClose += new ObjectHandler(XmppCon_OnClose);
XmppCon.OnError += new ErrorHandler(XmppCon_OnError);
XmppCon.OnPresence += new PresenceHandler(XmppCon_OnPresence);
XmppCon.OnMessage += new MessageHandler(XmppCon_OnMessage);
XmppCon.OnIq += new IqHandler(XmppCon_OnIq);
XmppCon.ClientSocket.OnReceive += new agsXMPP.net.ClientSocket.OnSocketDataHandler(ClientSocket_OnReceive);
XmppCon.ClientSocket.OnSend += new agsXMPP.net.ClientSocket.OnSocketDataHandler(ClientSocket_OnSend);
}
开发者ID:phiree,项目名称:dzdocs,代码行数:31,代码来源:frmMain.cs
示例9: frmLogin
public frmLogin(XmppClientConnection con)
{
InitializeComponent();
this.DialogResult = DialogResult.Cancel;
_xmppCon = con;
}
开发者ID:koralarts,项目名称:HipsterChat,代码行数:7,代码来源:frmLogin.cs
示例10: Login
public void Login(string username, string password)
{
if (!LoggedIn)
{
try
{
_xmppClient = new XmppClientConnection("chat.facebook.com", 5222);
_xmppClient.OnXmppConnectionStateChanged += (sender, state) =>
{
if (OnConnectionStateChanged != null) OnConnectionStateChanged(state.ToString());
};
_xmppClient.UseStartTLS = true;
_xmppClient.OnPresence += UpdateContactList;
_xmppClient.OnLogin += OnLogin;
_xmppClient.OnAuthError += (sender, element) =>
{
if (OnAuthError != null) OnAuthError(element.ToString());
};
_xmppClient.Open(username, password);
}
catch
{
if (OnLoginResult != null)
OnLoginResult(false);
}
}
}
开发者ID:sebastianbrand,项目名称:FacebookXMPP,代码行数:28,代码来源:FacebookChatClient.cs
示例11: Chat
public Chat(Client c, XmppClientConnection xmpp)
{
_client = c;
Rooms = new ThreadSafeList<NewChatRoom>();
_xmpp = xmpp;
_xmpp.OnMessage += XmppOnOnMessage;
}
开发者ID:LordNat,项目名称:OCTGN,代码行数:7,代码来源:Chat.cs
示例12: Form1
public Form1(XmppClientConnection con)
{
InitializeComponent();
connection = con;
Jid jid_ = new Jid(tb_login.Text, tb_ip.Text, connection.Resource);
jid = jid_.ToString();
}
开发者ID:phiree,项目名称:dzdocs,代码行数:7,代码来源:Form1.cs
示例13: FileTransfer
public FileTransfer(XmppClientConnection xmppCon, IContact recipient, string filename)
: base(recipient, filename)
{
_xmppConnection = xmppCon;
_fileLength = new FileInfo(filename).Length;
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:7,代码来源:FileTransfer.cs
示例14: DiscoHelper
public DiscoHelper(XmppClientConnection con)
{
xmppCon = con;
con.OnIq += new IqHandler(con_OnIq);
m_Features.Add(agsXMPP.Uri.DISCO_INFO);
}
开发者ID:phiree,项目名称:dzdocs,代码行数:7,代码来源:DiscoHelper.cs
示例15: frmFileTransfer
public frmFileTransfer(XmppClientConnection XmppCon, IQ iq)
{
InitializeComponent();
cmdSend.Enabled = false;
this.Text = "Receive File from " + iq.From.ToString();
siIq = iq;
si = iq.SelectSingleElement(typeof(agsXMPP.protocol.extensions.si.SI)) as agsXMPP.protocol.extensions.si.SI;
// get SID for file transfer
m_Sid = si.Id;
m_From = iq.From;
file = si.File;
if (file != null)
{
m_lFileLength = file.Size;
this.lblDescription.Text = file.Description;
this.lblFileName.Text = file.Name;
this.lblFileSize.Text = HRSize(m_lFileLength);
this.txtDescription.Visible = false;
}
m_XmppCon = XmppCon;
this.progress.Maximum = 100;
//this.Text += iq.From.ToString();
//this.tbFileSize.Text = FileTransferUtils.ConvertToByteString(m_lFileLength);
XmppCon.OnIq += new IqHandler(XmppCon_OnIq);
}
开发者ID:phiree,项目名称:dzdocs,代码行数:33,代码来源:frmFileTransfer.cs
示例16: Init
public override void Init(XmppClientConnection con)
{
m_XmppClient = con;
// <auth mechanism="PLAIN" xmlns="urn:ietf:params:xml:ns:xmpp-sasl">$Message</auth>
m_XmppClient.Send(new protocol.sasl.Auth(protocol.sasl.MechanismType.PLAIN, Message()));
}
开发者ID:jptoto,项目名称:argsxmpp,代码行数:7,代码来源:PlainMechanism.cs
示例17: InitInstance
public static void InitInstance(Jid client, string password)
{
RPCWrapper.con = new XmppClientConnection();
RPCWrapper.client = client;
RPCWrapper.con.Password = password;
RPCWrapper.con.Username = client.User;
RPCWrapper.con.Server = client.Server;
RPCWrapper.con.AutoAgents = false;
RPCWrapper.con.AutoPresence = true;
RPCWrapper.con.AutoRoster = true;
RPCWrapper.con.AutoResolveConnectServer = true;
try
{
RPCWrapper.con.OnRosterStart += new ObjectHandler(RPCWrapper.OnRosterStart);
RPCWrapper.con.OnRosterItem += new XmppClientConnection.RosterHandler(RPCWrapper.OnRosterItem);
RPCWrapper.con.OnRosterEnd += new ObjectHandler(RPCWrapper.OnRosterEnd);
RPCWrapper.con.OnPresence += new PresenceHandler(RPCWrapper.OnPresence);
RPCWrapper.con.OnMessage += new MessageHandler(RPCWrapper.OnMessage);
RPCWrapper.con.OnLogin += new ObjectHandler(RPCWrapper.OnLogin);
RPCWrapper.con.Open();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Wait();
}
开发者ID:SiteView,项目名称:ECC8.13,代码行数:33,代码来源:RPCWrapper.cs
示例18: frmGroupChat
public frmGroupChat(XmppClientConnection xmppCon, Jid roomJid)
{
InitializeComponent();
this.rtfSend.Select();
_roomJid = roomJid;
_xmppCon = xmppCon;
this.groupChatServerLabel.Text = "Room Name: " + _roomJid.User;
frmInputBox input = new frmInputBox("Nickname", "Nickname");
if (!Util.GroupChatForms.Contains(roomJid.Bare) && input.ShowDialog() == DialogResult.OK)
{
_nickname = input.Result;
Util.GroupChatForms.Add(roomJid.Bare.ToLower(), this);
this.Show();
}
else
{
return;
}
// Setup new Message Callback
_xmppCon.MessageGrabber.Add(roomJid, new BareJidComparer(), new MessageCB(MessageCallback), null);
// Setup new Presence Callback
_xmppCon.PresenceGrabber.Add(roomJid, new BareJidComparer(), new PresenceCB(PresenceCallback), null);
}
开发者ID:koralarts,项目名称:HipsterChat,代码行数:26,代码来源:frmGroupChat.cs
示例19: GtalkCommunication
public GtalkCommunication(MainWindow _mw, ChatWindows _cw)
{
cm = ContactManager.getInstance();
xmppCon = new XmppClientConnection();
mW = _mw;
cW = _cw;
}
开发者ID:soufatn,项目名称:Windows8-XMPP-Client,代码行数:7,代码来源:GtalkCommunication.cs
示例20: RosterObesrver
public RosterObesrver(Client client, XmppClientConnection connection)
{
_dispatcher = Dispatcher.CurrentDispatcher;
_connection = connection;
_listHandler = new RosterListHandler(client);
_itemHandler = new RosterItemHandler(client);
}
开发者ID:Irdis,项目名称:VSTalk,代码行数:7,代码来源:RosterObesrver.cs
注:本文中的agsXMPP.XmppClientConnection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论