Beispiel #1
0
        public void Init(WebBrowser browser, PhoneApplicationPage appMainPage)
        {
            initAppUrls();
            RhoLogger.InitRhoLog();
            LOG.INFO("Init");

            CRhoFile.recursiveCreateDir(CFilePath.join(getBlobsDirPath()," "));

            m_webBrowser = browser;
            m_appMainPage = appMainPage;
            m_appMainPage.ApplicationBar = null;
            m_httpServer = new CHttpServer(CFilePath.join(getRhoRootPath(), "apps"));
            CRhoResourceMap.deployContent();
            RhoRuby.Init(m_webBrowser);

            DBAdapter.initAttrManager();

            LOG.INFO("Starting sync engine...");
            SyncThread sync = null;
            try{
	        	sync = SyncThread.Create();
	        	
	        }catch(Exception exc){
	        	LOG.ERROR("Create sync failed.", exc);
	        }
	        if (sync != null) {
	        	//sync.setStatusListener(this);
	        }
	        
	        RhoRuby.InitApp();
	        RhoRuby.call_config_conflicts();
            RHOCONF().conflictsResolved();
        }
Beispiel #2
0
 public CServerCommand(CHttpServer Parent, CRoute route,
                       String method, String uri, String query, String body, int nCommand)
 {
     m_Parent   = Parent;
     m_method   = method;
     m_uri      = uri;
     m_query    = query;
     m_body     = body;
     m_route    = route;
     m_nCommand = nCommand;
 }
Beispiel #3
0
 public CServerCommand(CHttpServer Parent, CRoute route, 
     String method, String uri, String query, String body, int nCommand)
 {
     m_Parent = Parent;
     m_method = method;
     m_uri = uri;
     m_query = query;
     m_body = body;
     m_route = route;
     m_nCommand = nCommand;
 }
Beispiel #4
0
        public void Init(WebBrowser browser, PhoneApplicationPage appMainPage)
        {
            initAppUrls();
            RhoLogger.InitRhoLog();
            LOG.INFO("Init");

            CRhoFile.recursiveCreateDir(CFilePath.join(getBlobsDirPath()," "));

            m_webBrowser = browser;
            m_appMainPage = appMainPage;
            m_appMainPage.ApplicationBar = null;

            m_httpServer = new CHttpServer(CFilePath.join(getRhoRootPath(), "apps"));
        }
Beispiel #5
0
        public void Init(WebBrowser browser, PhoneApplicationPage appMainPage, Grid layoutRoot, RhoView rhoView)
        {
            initAppUrls();
            RhoLogger.InitRhoLog();
            LOG.INFO("Init");

            CRhoFile.recursiveCreateDir(CFilePath.join(getBlobsDirPath()," "));

            m_webBrowser = browser;
            if (m_appMainPage == null)
                m_appMainPage = appMainPage;
            if (m_layoutRoot == null)
                m_layoutRoot = layoutRoot;
            //m_appMainPage.ApplicationBar = null;

            if (m_httpServer == null)
                m_httpServer = new CHttpServer(CFilePath.join(getRhoRootPath(), "apps"));

            m_rhoView = rhoView;
            if (m_rhoView.MasterView)
                m_masterView = rhoView;
        }
Beispiel #6
0
            public CServerCommand(CHttpServer Parent, CRoute route,
                                  String method, String uri, IDictionary headers, IDictionary data, int nCommand, String strAjaxContext, int tabIndex)
            {
                m_Parent         = Parent;
                m_method         = (null != method) ? method.toUpperCase() : "GET";
                m_uri            = (0 <= uri.indexOf('?')) ? uri.substring(0, uri.indexOf('?')) : uri;
                m_route          = route;
                m_nCommand       = nCommand;
                m_strAjaxContext = strAjaxContext;
                m_iTabIndex      = tabIndex;

                m_body = "";

                m_headers = new Dictionary <String, String>();
                if (null != headers)
                {
                    foreach (object key in headers.Keys)
                    {
                        m_headers[key.ToString()] = headers[key].ToString();
                    }
                }

                // Query parameters from URL are added first, then data parameters added.
                m_query = (0 <= uri.indexOf('?')) ? uri.substring(uri.indexOf('?') + 1) : "";
                if (null != data)
                {
                    StringBuilder sb = new StringBuilder(m_query);
                    foreach (object key in data.Keys)
                    {
                        if (0 < sb.Length)
                        {
                            sb.Append("&");
                        }
                        sb.Append(key.ToString() + "=" + (null != data[key] ? data[key].ToString() : ""));
                    }
                    m_query = sb.ToString();
                }
            }
Beispiel #7
0
            public CServerCommand(CHttpServer Parent, CRoute route,
                String method, String uri, IDictionary headers, IDictionary data, int nCommand, String strAjaxContext, int tabIndex)
            {
                m_Parent = Parent;
                m_method = (null != method) ? method.toUpperCase() : "GET";
                m_uri = (0 <= uri.indexOf('?')) ? uri.substring(0, uri.indexOf('?')) : uri;
                m_route = route;
                m_nCommand = nCommand;
                m_strAjaxContext = strAjaxContext;
                m_iTabIndex = tabIndex;

                m_body = "";

                m_headers = new Dictionary<String, String>();
                if (null != headers)
                {
                    foreach (object key in headers.Keys)
                    {
                        m_headers[key.ToString()] = headers[key].ToString();
                    }
                }

                // Query parameters from URL are added first, then data parameters added.
                m_query = (0 <= uri.indexOf('?')) ? uri.substring(uri.indexOf('?') + 1) : "";
                if (null != data)
                {
                    StringBuilder sb = new StringBuilder(m_query);
                    foreach (object key in data.Keys)
                    {
                        if (0 < sb.Length) sb.Append("&");
                        sb.Append(key.ToString() + "=" + (null != data[key] ? data[key].ToString() : ""));
                    }
                    m_query = sb.ToString();
                }
            }