Exemplo n.º 1
0
 public object CallFunctionNoException(string functionName, object[] parameters)
 {
     try
     {
         TimeCollector.Start("CallFunctionNoException");
         return(ScriptEngine.CallFunctionNoException(functionName, parameters));
     }
     finally
     {
         TimeCollector.Pause("CallFunctionNoException");
     }
 }
Exemplo n.º 2
0
        public object CreateScreen(string screenName, IValueStack stack, IScreenController controller, object styleCache)
        {
            controller.SetCurrentScreenController();

            string tsName = "CreateScreen: " + screenName;

            TimeStamp.Start(tsName);

            var screenStream = ApplicationContext.Current.Dal.GetScreenByName(screenName);

            if (screenStream == null)
            {
                throw new Exception(String.Format("Can't load screen {0}", screenName));
            }

            TimeStamp.Log(tsName, "Prepare");
            TimeStamp.Start(tsName);

            controller.OnLoading(screenName);

            TimeStamp.Log(tsName, "OnLoading invoke");
            TimeStamp.Start(tsName);

            var scr = (IControl <object>)ObjectFactory.CreateObject(stack, screenStream);

            TimeStamp.Log(tsName, "Parse screen");
            TimeStamp.Start(tsName);

//            GC.Collect();
//            TimeStamp.Log(tsName, "GC collect");
//            TimeStamp.Start(tsName);

            scr.CreateView(); // TODO: Replace to platform controllers

            TimeStamp.Log(tsName, "Create views");

            ApplyStyles(screenName, scr, styleCache);

            TimeStamp.Start(tsName);

            controller.OnLoad(screenName);

            TimeStamp.Log(tsName, "OnLoad invoke");

            ApplicationContext.Current.Dal.ClearStringCache();

            TimeStamp.WriteAll();
            TimeCollector.WriteAll();

            return(scr);
        }
Exemplo n.º 3
0
        public object CreateScreen <T>(String screenName, ValueStack.ValueStack stack, BitMobile.Controllers.ScreenController controller) where T : StyleSheet, new()
        {
            string TS_NAME = "CreateScreen: " + screenName;

            TimeStamp.Start("Total");
            TimeStamp.Start(TS_NAME);

            System.IO.Stream screenStream = ApplicationContext.Context.DAL.GetScreenByName(screenName);
            if (screenStream == null)
            {
                throw new Exception(String.Format("Can't load screen {0}", screenName));
            }

            TimeStamp.Log(TS_NAME, "Prepare");
            TimeStamp.Start(TS_NAME);

            controller.OnLoading();

            TimeStamp.Log(TS_NAME, "OnLoading invoke");
            TimeStamp.Start(TS_NAME);

            IControl <object> scr = (IControl <object>)objectFactory.CreateObject(stack, screenStream);

            TimeStamp.Log(TS_NAME, "CreateInstance objects");
            TimeStamp.Start(TS_NAME);

            scr.CreateView(); // TODO: Replace to platform controllers

            TimeStamp.Log(TS_NAME, "CreateInstance views");
            TimeStamp.Start(TS_NAME);

            ApplyStyles(screenName, scr as IStyledObject, new T());

            TimeStamp.Log(TS_NAME, "Apply styles");
            TimeStamp.Start(TS_NAME);

            controller.OnLoad();

            TimeStamp.Log(TS_NAME, "OnLoad invoke");

            TimeStamp.Log("Total");
            TimeStamp.WriteLog();
            TimeCollector.Write("CallFunction");
            TimeCollector.Stop("CallFunction");
            TimeCollector.Write("CallFunctionNoException");
            TimeCollector.Stop("CallFunctionNoException");

            return(scr);
        }
Exemplo n.º 4
0
        public object CallFunction(string functionName, object[] parameters)
        {
            try
            {
                TimeStamp.Start("CallFunction: " + functionName);
                TimeCollector.Start("CallFunction");

                return(scriptEngine.CallFunction(functionName, parameters));
            }
            finally
            {
                TimeCollector.Pause("CallFunction");
                TimeStamp.Log("CallFunction: " + functionName);
            }
        }