Пример #1
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);
        }
Пример #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;
        }