Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
        public void CreateForm(agsXMPP.protocol.iq.search.Search search)
        {
            /*
             * Send: <iq xmlns="jabber:client" id="agsXMPP_9" type="get" to="users.jabber.org"><query xmlns="jabber:iq:search" />
             * </iq>
             *  Recv: <iq xmlns="jabber:client" to="[email protected]/SharpIM" type="result" id="agsXMPP_9" from="users.jabber.org">
             * <query xmlns="jabber:iq:search">
             * <instructions>Find a contact by entering the search criteria in the given fields. Note: Each field supports wild card searches (%)</instructions>
             * <first />
             * <last />
             * <nick />
             * <email />
             * </query></iq>
             */

            this.SuspendLayout();

            this.panelFields.SuspendLayout();
            this.panelFields.Controls.Clear();

            //lblTitle.Text = xdata.Title;
            lblInstructions.Text = search.Instructions;

            XDataControl_Resize(this, null);

            agsXMPP.Xml.Dom.ElementList list = new agsXMPP.Xml.Dom.ElementList();
            foreach (agsXMPP.Xml.Dom.Node n in search.ChildNodes)
            {
                if (n.NodeType == agsXMPP.Xml.Dom.NodeType.Element)
                {
                    list.Add(n as agsXMPP.Xml.Dom.Element);
                }
            }

            for (int i = list.Count - 1; i >= 0; i--)
            {
                agsXMPP.Xml.Dom.Element el = list.Item(i);
                if (el.TagName == "key")
                {
                    CreateField(CreateDummyHiddenField(el.TagName, el.Value), i);
                }
                else if (el.TagName == "instructions")
                {
                }
                else
                {
                    CreateField(CreateDummyTextField(el.TagName, el.TagName), i);
                }
            }

            this.panelFields.ResumeLayout();

            this.ResumeLayout();
        }
Exemplo n.º 3
0
        public void CreateForm(agsXMPP.protocol.iq.search.Search search)
        {
            /*
             * Send: <iq xmlns="jabber:client" id="agsXMPP_9" type="get" to="users.jabber.org"><query xmlns="jabber:iq:search" />
             * </iq>
                Recv: <iq xmlns="jabber:client" to="[email protected]/SharpIM" type="result" id="agsXMPP_9" from="users.jabber.org">
             * <query xmlns="jabber:iq:search">
             * <instructions>Find a contact by entering the search criteria in the given fields. Note: Each field supports wild card searches (%)</instructions>
             * <first />
             * <last />
             * <nick />
             * <email />
             * </query></iq>
             */

            this.SuspendLayout();

            this.panelFields.SuspendLayout();
            this.panelFields.Controls.Clear();

            //lblTitle.Text = xdata.Title;
            lblInstructions.Text =  search.Instructions;

            XDataControl_Resize(this, null);

            agsXMPP.Xml.Dom.ElementList list = new agsXMPP.Xml.Dom.ElementList();
            foreach (agsXMPP.Xml.Dom.Node n in search.ChildNodes)
            {
                if (n.NodeType == agsXMPP.Xml.Dom.NodeType.Element)
                    list.Add(n as agsXMPP.Xml.Dom.Element);
            }

            for (int i = list.Count -1; i >= 0; i--)
            {
                agsXMPP.Xml.Dom.Element el = list.Item(i);
                if (el.TagName == "key")
                {
                    CreateField(CreateDummyHiddenField(el.TagName, el.Value), i);
                }
                else if (el.TagName == "instructions")
                {

                }
                else
                {
                    CreateField(CreateDummyTextField(el.TagName, el.TagName), i);
                }

            }

            this.panelFields.ResumeLayout();

            this.ResumeLayout();
        }