public void BindRootView()
        {
            var rootView = new RootView()
                               {
                                   Contexts = new List<ReflectContext>()
                               };
            rootView.Contexts.Add(new ReflectContext()
                                      {
                                          Folder = "C:\teste",
                                          Name = "Context1"
                                      }
                );
            rootView.Contexts.Add(new ReflectContext()
            {
                Folder = "C:\teste2",
                Name = "Context2"
            }
                );

            ViewBinder.RootFolder = @"..\..\..\Views\ReflectorView.Test\";
            var output = ViewBinder.BindView(rootView);
            
            var sb = new StringBuilder();

            using (TextReader reader = File.OpenText(ViewBinder.RootFolder + "RootViewOut.txt"))
            {
                sb.Append(reader.ReadToEnd());
            }

            Assert.AreEqual(sb.ToString(),output);
        }
 public  Control view()
 {
     Control v = new RootView();
     v.DataContext = this;
     return v;
 }
Example #3
0
        public void Load(ContentManager contentManager)
        {
            SpriteFont font = contentManager.Load<SpriteFont>("Segoe_UI_15_Regular");
            FontManager.DefaultFont = Engine.Instance.Renderer.CreateFont(font);

            _rootView = new RootView();
            _rootViewModel = new RootViewModel();

            _rootView.DataContext = _rootViewModel;

            FontManager.Instance.LoadFonts(contentManager);

            Time = new TextBlockWrapper(_rootViewModel.Time);
            Task = new TextBlockWrapper(_rootViewModel.Task);
            Score = new TextBlockWrapper(_rootViewModel.Score);
            Status = new TextBlockWrapper(_rootViewModel.Status);
            PuzzleFractions = new List<PuzzleFraction>();
        }
Example #4
0
        public override void HandleMatching(EventBean[] triggerEvents, EventBean[] matchingEvents)
        {
            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().QInfraOnAction(OnTriggerType.ON_SELECT, triggerEvents, matchingEvents);
            }

            EventBean[] newData;

            // clear state from prior results
            _resultSetProcessor.Clear();

            // build join result
            // use linked hash set to retain order of join results for last/first/window to work most intuitively
            var newEvents = BuildJoinResult(triggerEvents, matchingEvents);

            // process matches
            var pair = _resultSetProcessor.ProcessJoinResult(newEvents, _oldEvents, false);

            newData = (pair != null ? pair.First : null);

            if (_parent.IsDistinct)
            {
                newData = EventBeanUtility.GetDistinctByProp(newData, _parent.EventBeanReader);
            }

            if (_tableStateInstanceInsertInto != null)
            {
                if (newData != null)
                {
                    foreach (var aNewData in newData)
                    {
                        if (_audit)
                        {
                            AuditPath.AuditInsertInto(ExprEvaluatorContext.EngineURI, ExprEvaluatorContext.StatementName, aNewData);
                        }
                        _tableStateInstanceInsertInto.AddEventUnadorned(aNewData);
                    }
                }
            }
            else if (_parent.InternalEventRouter != null)
            {
                if (newData != null)
                {
                    foreach (var aNewData in newData)
                    {
                        if (_audit)
                        {
                            AuditPath.AuditInsertInto(ExprEvaluatorContext.EngineURI, ExprEvaluatorContext.StatementName, aNewData);
                        }
                        _parent.InternalEventRouter.Route(aNewData, _parent.StatementHandle, _parent.InternalEventRouteDest, ExprEvaluatorContext, _parent.IsAddToFront);
                    }
                }
            }

            // The on-select listeners receive the events selected
            if ((newData != null) && (newData.Length > 0))
            {
                // And post only if we have listeners/subscribers that need the data
                if (_parent.StatementResultService.IsMakeNatural || _parent.StatementResultService.IsMakeSynthetic)
                {
                    UpdateChildren(newData, null);
                }
            }
            _lastResult = newData;

            // clear state from prior results
            _resultSetProcessor.Clear();

            // Events to delete are indicated via old data
            if (_isDelete)
            {
                RootView.Update(null, matchingEvents);
            }

            if (InstrumentationHelper.ENABLED)
            {
                InstrumentationHelper.Get().AInfraOnAction();
            }
        }
 /// <summary>
 ///     Utility shorthand to FindViewById on current view.
 /// </summary>
 /// <param name="id">View Id.</param>
 /// <typeparam name="T">The type od the View behind the Id.</typeparam>
 protected T FindViewById <T>(int id)
     where T : View
 {
     return(RootView.FindViewById <T>(id));
 }
Example #6
0
 protected override Rect CalculateGUIRect()
 {
     return(new Rect(RootView.ToWindowPosition(Task.Position - EditorConfiguration.NodeSize / 2), EditorConfiguration.NodeSize));
 }
Example #7
0
 protected T FindViewById <T>(int id) where T : View => RootView.FindViewById <T>(id);