Ejemplo n.º 1
0
            object m_ptr;                 //void *              m_ptr;


            entry_t(string stname, datatype_t dt, object owner, int count, object ptr)
            {
                m_name     = stname;
                m_dt       = dt;
                m_owner    = owner;
                m_callback = null;
                m_count    = count;
                m_ptr      = ptr;
            }
Ejemplo n.º 2
0
 entry_t(string stname, object owner, callback_t callback)
 {
     m_name     = stname;
     m_dt       = new datatype_t(true);
     m_owner    = owner;
     m_callback = callback;
     m_count    = 0;
     m_ptr      = null;
 }
Ejemplo n.º 3
0
            object m_ptr;                 //void *              m_ptr;


            entry_t(string stname, datatype_t dt, object owner, size_t count, object ptr)  //entry_t(const pstring &stname, const datatype_t &dt, const void *owner, const std::size_t count, void *ptr)
            {
                m_name     = stname;
                m_dt       = dt;
                m_owner    = owner;
                m_callback = null;
                m_count    = count;
                m_ptr      = ptr;
            }
Ejemplo n.º 4
0
        // AnySqlDataFeed.DataFeed.SendFeed(tableName);
        public static void SendFeed(string tableName)
        {
            // application/xml;charset=utf-8
            // return Content("Id (" + this.Request.HttpMethod + "): " + id,"application/xml");
            // if (StringComparer.OrdinalIgnoreCase.Equals(this.Request.HttpMethod, "HEAD")) return Content("");

            System.Web.HttpResponse Response = System.Web.HttpContext.Current.Response;


            Response.Headers.Add("Cache-Control", "no-cache");
            Response.Headers.Add("DataServiceVersion", "1.0;");
            Response.Headers.Add("Date", "Thu, 27 Aug 2015 20:16:35 GMT");
            Response.Headers.Add("X-Content-Type-Options", "nosniff");

            // string foo = XML.Test.Serialize();
            // return Content(foo, "application/xml");

            object     m_objectToSerialize = null;
            callback_t m_CallBack          = null;

            // XmlResult res = null;

            if (string.IsNullOrEmpty(tableName))
            {
                // res = new XmlResult(Feed.Test.GetSerializationData());
                m_objectToSerialize = OData.TableListFeed.GetSerializationData();
            }
            else
            {
                //res = new XmlResult(tableName, Feed.TableDataTest.Test);
                m_CallBack = OData.TableDataFeed.GetSerializationData;
            }


            // res.ExecuteResult();
            System.Web.HttpContext context = System.Web.HttpContext.Current;
            context.Response.Clear();


            // Because we have references to disposable tables, we can't get the object
            if (m_CallBack != null)
            {
                context.Response.ContentType = "application/atom+xml;type=feed";
                m_CallBack(tableName, context.Response.Output);
            }

            if (m_objectToSerialize != null)
            {
                context.Response.ContentType = "application/xml";
                Tools.XML.Serialization.SerializeToXml(m_objectToSerialize, context.Response.Output);
            }
        }
Ejemplo n.º 5
0
 public XmlResult(string table_name, callback_t callbackFunction)
 {
     this.m_TableName = table_name;
     this.m_CallBack = callbackFunction;
 }
Ejemplo n.º 6
0
 public void Detach() { m_callback = null; }
Ejemplo n.º 7
0
 public void Attach(callback_t funptr) { m_callback = funptr; }
Ejemplo n.º 8
0
 public XmlResult(string table_name, callback_t callbackFunction)
 {
     this.m_TableName = table_name;
     this.m_CallBack  = callbackFunction;
 }