Beispiel #1
0
        public MainPage()
        {
            System.Diagnostics.Debug.WriteLine("UserAgent: " + getUserAgent());
            _instance   = this;
            _uiThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
            updateScreenSize();
            InitializeComponent();
            ApplicationBar.IsVisible = false;
            _screenOrientation       = Orientation;
            try
            {
                // initialize C# extensions factories
                CSharpExtensions.InitializeExtensions();
                // create rhodes runtime object
                var _rhoruntime = CRhoRuntime.getInstance(new MainPageWrapper(this));
                _rhoruntime.setCryptoEngine(new CryptoEngineWrapper(new RhoCrypt()));
                // create and start rhodes main thread
                _rhoruntimeThread = new Thread(_rhoruntime.Execute);
                _rhoruntimeThread.Start();

                //temporary solutions, to do refactoring
                //Thread.Sleep(200);
                _rhoruntime.onActivate(0);
            }
            catch (Exception e)
            {
                RhodesWebBrowser.NavigateToString("<html><head><title>Exception</title></head><body>Exception: " + e.Message + "</body></html>");
            }
        }
Beispiel #2
0
 public void DisplayMessage(string msg)
 {
     if (!isUIThread)
     {
         Dispatcher.BeginInvoke(delegate() { DisplayMessage(msg); }); return;
     }
     RhodesWebBrowser.NavigateToString("<html><head><title>Message</title></head><body>" + msg + "</body></html>");
 }
Beispiel #3
0
 // this method is used for updating UI controls from C++ non-UI thread
 public void UpdateWebView(int counter)
 {
     // perform this action on UI thread only
     if (!isUIThread)
     {
         Dispatcher.BeginInvoke(delegate() { UpdateWebView(counter); });  return;
     }
     // update WebView
     RhodesWebBrowser.NavigateToString("<html><head><title>Loading...</title></head><body>" + counter + "<input type=\"text\" name=\"test\" size=\"25\"/></body></html>");
 }
Beispiel #4
0
        public MainPage()
        {
            _uiThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
            InitializeComponent();
            try
            {
                // create rhodes runtime object
                var rhoruntime = new CRhoRuntime(this);

                // create and start rhodes main thread
                _rhoruntimeThread = new Thread(rhoruntime.Execute);
                _rhoruntimeThread.Start();
            }
            catch (Exception e)
            {
                RhodesWebBrowser.NavigateToString("<html><head><title>Exception</title></head><body>Exception: " + e.Message + "</body></html>");
            }
        }
Beispiel #5
0
        public MainPage()
        {
            _uiThreadID           = System.Threading.Thread.CurrentThread.ManagedThreadId;
            _screenWidth          = Application.Current.Host.Content.ActualWidth;
            _screenHeight         = Application.Current.Host.Content.ActualHeight;
            _screenPhysicalHeight = 4;                                                      // assuming 4 inches
            _screenPhysicalWidth  = (_screenPhysicalHeight / _screenHeight) * _screenWidth; // assuming square pixels

            InitializeComponent();
            try
            {
                // create rhodes runtime object
                var rhoruntime = new CRhoRuntime(this);
                // create and start rhodes main thread
                _rhoruntimeThread = new Thread(rhoruntime.Execute);
                _rhoruntimeThread.Start();
            }
            catch (Exception e)
            {
                RhodesWebBrowser.NavigateToString("<html><head><title>Exception</title></head><body>Exception: " + e.Message + "</body></html>");
            }
        }
Beispiel #6
0
        public MainPage()
        {
            _uiThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
            updateScreenSize();
            InitializeComponent();
            ApplicationBar.IsVisible = false;
            try
            {
                // create rhodes runtime object
                var _rhoruntime = CRhoRuntime.getInstance(new MainPageWrapper(this));
                // create and start rhodes main thread
                _rhoruntimeThread = new Thread(_rhoruntime.Execute);
                _rhoruntimeThread.Start();

                //temporary solutions, to do refactoring
                Thread.Sleep(5000);
                _rhoruntime.onActivate(0);
            }
            catch (Exception e)
            {
                RhodesWebBrowser.NavigateToString("<html><head><title>Exception</title></head><body>Exception: " + e.Message + "</body></html>");
            }
        }
Beispiel #7
0
        public MainPage()
        {
            _uiThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
            InitializeComponent();
            try
            {
                // create rhodes runtime object
                var rhoruntime = new CRhoRuntime();

                // set callback methods
                rhoruntime.SetWaitCallback(new WaitCallbackPointer(this.DoWait));
                rhoruntime.SetUpdateWebViewCallback(new UpdateWebViewCallbackPointer(this.UpdateWebView));
                rhoruntime.SetExitCallback(new ExitCallbackPointer(this.DoExit));

                // create and start rhodes main thread
                _rhoruntimeThread = new Thread(rhoruntime.Execute);
                _rhoruntimeThread.Start();
            }
            catch (Exception e)
            {
                RhodesWebBrowser.NavigateToString("<html><head><title>Exception</title></head><body>Exception: " + e.Message + "</body></html>");
            }
        }