Exemplo n.º 1
0
        public void csWork()
        {
#if DEBUGON
            memoryTimer += 50;
            if (memoryTimer > 1000)
            {
                memoryTimer -= 1000;

                object totalmemory = DeviceExtendedProperties.GetValue("DeviceTotalMemory");
                object appmemory   = DeviceExtendedProperties.GetValue("ApplicationCurrentMemoryUsage");
                object peakmemory  = DeviceExtendedProperties.GetValue("ApplicationPeakMemoryUsage");

                MainPage.m_d3dInterop.Print("memory - total: " + totalmemory + " app: " + appmemory + " peak: " + peakmemory);
            }
#endif

            String actionString = MainPage.m_d3dInterop.csActionRequest();
            if (actionString.Length > 0)
            {
                String action, actionData;
                {
                    String[] split = Regex.Split(actionString, ", ");
                    action     = split[0];
                    actionData = split.Length > 1 ? split[1] : "";
                    for (int i = 2; i < split.Length; ++i)
                    {
                        actionData += ", ";
                        actionData += split[i];
                    }
                }

                if (CSURLManager.csWork(action, actionData))
                {
                }

                else if (action == "CCFileManager::syncToIsoStore")
                {
                    fileManager_SyncToIsoStore(actionData);
                }

                else if (m_csWeb.csWork(action, actionData))
                {
                }

                else if (CSAudioManager.csWork(action, actionData))
                {
                }

                else if (action == "CCAppManager::InAppPurchase")
                {
                    String productID = actionData;
                    inAppPurchase_Purchase(productID);
                }

                else if (action == "CCAppManager::KeyboardToggle")
                {
                    bool show = (actionData == "true");

                    if (show)
                    {
                        if (m_textBox == null)
                        {
                            m_textBox = new TextBox();
                            MainPage.m_mainPage.LayoutRoot.Children.Insert(0, m_textBox);
                            m_textBox.Opacity = 0.0;
                            m_textBox.Focus();

                            m_textBox.KeyUp += new System.Windows.Input.KeyEventHandler(textBox_keyUp);
                        }
                    }
                    else
                    {
                        if (m_textBox != null)
                        {
                            MainPage.m_mainPage.LayoutRoot.Children.Remove(m_textBox);
                            m_textBox = null;
                        }
                    }

                    MainPage.m_d3dInterop.csActionResult("CCAppManager::KeyboardToggled", "");
                }
            }
        }
Exemplo n.º 2
0
 public void Application_Activated()
 {
     m_d3dInterop.Application_Activated();
     CSAudioManager.Application_Activated();
 }