using System;
using System.Xml;
using jabber.protocol;
namespace Sample
{
///
///
///
///
///
///
///
///
public class JingleIQ : jabber.protocol.client.IQ
{
public JingleIQ(XmlDocument doc) : base(doc) { }
public XmlElement Jingle
{
get { return this["jingle"]; }
}
public XmlElement Description
{
get { return this["description"]; }
}
public XmlElement Transport
{
get { return this["transport"]; }
}
}
///
///
///
///
///
///
public class Jingle : jabber.protocol.Element
{
public Jingle(XmlDocument doc) : base("jingle", URI.JINGLE, doc) { }
public Jingle(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
public string Action
{
get { return GetAttribute("action"); }
set { SetAttribute("action", value); }
}
public string Initiator
{
get { return GetAttribute("initiator"); }
set { SetAttribute("initiator", value); }
}
public string SID
{
get { return GetAttribute("sid"); }
set { SetAttribute("sid", value); }
}
public XmlElement Description
{
get { return this["description"]; }
}
public JingleTransport Transport
{
get
{
try
{
JingleTransport transport = (JingleTransport)this["transport"];;
return transport;
}
catch (Exception e)
{
Console.WriteLine();
}
return null;
}
}
}
///
///
///
///
///
///
public class JingleTransport : jabber.protocol.Element
{
public JingleTransport(XmlDocument doc) : base("transport", URI.JINGLE_IAX, doc) { }
public JingleTransport(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
public string Version
{
get { return GetAttribute("version"); }
set { SetAttribute("version", value); }
}
public string Secure
{
get { return GetAttribute("secure"); }
set { SetAttribute("secure", value); }
}
public string User
{
get { return GetAttribute("user"); }
set { SetAttribute("user", value); }
}
public string Password
{
get { return GetAttribute("password"); }
set { SetAttribute("password", value); }
}
public JingleCandidate[] Candidates
{
get
{
XmlNodeList nl = GetElementsByTagName("candidate");
JingleCandidate[] items = new JingleCandidate[nl.Count];
int i=0;
foreach (XmlNode n in nl)
{
items[i] = (JingleCandidate) n;
i++;
}
return items;
}
}
}
///
///
///
public class JingleCandidate : jabber.protocol.Element
{
public JingleCandidate(XmlDocument doc) : base("candidate", doc) { }
public JingleCandidate(string prefix, XmlQualifiedName qname, XmlDocument doc) : base(prefix, qname, doc) { }
public new string Name
{
get { return GetAttribute("name"); }
set { SetAttribute("name", value); }
}
public string IP
{
get { return GetAttribute("ip"); }
set { SetAttribute("ip", value); }
}
public string Port
{
get { return GetAttribute("port"); }
set { SetAttribute("port", value); }
}
public string URI
{
get { return GetAttribute("uri"); }
set { SetAttribute("uri", value); }
}
}
}