Example #1
0
        /// <summary>
        /// Start an XDB request.
        /// </summary>
        /// <param name="root"></param>
        /// <param name="xtype"></param>
        /// <param name="owner"></param>
        /// <param name="ns"></param>
        /// <param name="action"></param>
        /// <param name="cb"></param>
        /// <param name="cbArg"></param>
        public void BeginXdb(XmlElement root, XdbType xtype,
                             string owner, string ns, XdbAction action,
                             XdbCB cb, object cbArg)
        {
            Debug.Assert(owner != null);
            Debug.Assert(ns != null);
            Xdb xdb = new Xdb(m_comp.Document);

            xdb.NS   = ns;
            xdb.Type = xtype;
            xdb.To   = owner;
            xdb.From = m_comp.ComponentID;
            if (action != XdbAction.NONE)
            {
                xdb.Action = action;
            }
            if (root != null)
            {
                xdb.AddChild(root);
            }
            // if no callback, ignore response.
            if (cb != null)
            {
                TrackerData td = new TrackerData();
                td.cb   = cb;
                td.data = cbArg;
                lock (m_pending)
                {
                    m_pending[xdb.ID] = td;
                }
            }
            m_comp.Write(xdb);
        }
Example #2
0
 /// <summary>
 /// Start an XDB request.
 /// </summary>
 /// <param name="root"></param>
 /// <param name="owner"></param>
 /// <param name="ns"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 public void BeginXdbSet(XmlElement root, string owner, string ns,
                         XdbCB cb, object cbArg)
 {
     BeginXdb(root, XdbType.set, owner, ns, XdbAction.NONE, cb, cbArg);
 }
Example #3
0
 /// <summary>
 /// Start an XDB request.
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="ns"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 public void BeginXdbGet(string owner, string ns,
                         XdbCB cb, object cbArg)
 {
     BeginXdb(null, XdbType.get, owner, ns, XdbAction.NONE, cb, cbArg);
 }
Example #4
0
 /// <summary>
 /// Start an XDB request.
 /// </summary>
 /// <param name="root"></param>
 /// <param name="xtype"></param>
 /// <param name="owner"></param>
 /// <param name="ns"></param>
 /// <param name="action"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 public void BeginXdb(XmlElement root, XdbType xtype,
     string owner, string ns, XdbAction action,
     XdbCB cb, object cbArg)
 {
     Debug.Assert(owner != null);
     Debug.Assert(ns    != null);
     Xdb xdb  = new Xdb(m_comp.Document);
     xdb.NS   = ns;
     xdb.Type = xtype;
     xdb.To   = owner;
     xdb.From = m_comp.ComponentID;
     if (action != XdbAction.NONE)
         xdb.Action = action;
     if (root != null)
         xdb.AddChild(root);
     // if no callback, ignore response.
     if (cb != null)
     {
         TrackerData td = new TrackerData();
         td.cb   = cb;
         td.data = cbArg;
         lock (m_pending)
         {
             m_pending[xdb.ID] = td;
         }
     }
     m_comp.Write(xdb);
 }
Example #5
0
 /// <summary>
 /// Start an XDB request.
 /// </summary>
 /// <param name="root"></param>
 /// <param name="xtype"></param>
 /// <param name="owner"></param>
 /// <param name="ns"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 public void BeginXdb(XmlElement root, XdbType xtype,
     string owner, string ns,
     XdbCB cb, object cbArg)
 {
     BeginXdb(root, xtype, owner, ns, XdbAction.NONE, cb, cbArg);
 }
Example #6
0
 /// <summary>
 /// Start an XDB request.
 /// </summary>
 /// <param name="owner"></param>
 /// <param name="ns"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 public void BeginXdbGet(string owner, string ns,
     XdbCB cb, object cbArg)
 {
     BeginXdb(null, XdbType.get, owner, ns, XdbAction.NONE, cb, cbArg);
 }