Пример #1
0
        public static LinqBindingNode GetSlotNode(Application application, UIElement rootElement, UIElement element, UIElement innerContext, int createdId, int enabledId, int updatedId, int lateId, string slotName, TemplateScope templateScope, int slotContextSize)
        {
            LinqBindingNode node = new LinqBindingNode(); // todo -- pool

            node.root           = rootElement;
            node.element        = element;
            node.innerContext   = innerContext;
            element.bindingNode = node;

            // todo -- profile this against skip tree
            UIElement ptr = element.parent;

            while (ptr != null)
            {
                if (ptr.bindingNode != null)
                {
                    node.parent = ptr.bindingNode;
                    break;
                }

                ptr = ptr.parent;
            }

            node.InitializeContextArray(slotName, templateScope, slotContextSize);

            node.SetBindings(application, rootElement, createdId, enabledId, updatedId, lateId);

            return(node);
        }
Пример #2
0
        [UsedImplicitly] // called from template functions,
        public static LinqBindingNode Get(Application application, UIElement rootElement, UIElement element, UIElement innerContext, int createdId, int enabledId, int updatedId, int lateId)
        {
            LinqBindingNode node = new LinqBindingNode(); // todo -- pool

            node.root           = rootElement;
            node.element        = element;
            node.innerContext   = innerContext;
            element.bindingNode = node;

            // todo -- profile this against skip tree
            UIElement ptr = element.parent;

            while (ptr != null)
            {
                if (ptr.bindingNode != null)
                {
                    node.parent = ptr.bindingNode;
                    break;
                }

                ptr = ptr.parent;
            }

            node.SetBindings(application, rootElement, createdId, enabledId, updatedId, lateId);

            return(node);
        }
Пример #3
0
        public static LinqBindingNode GetSlotModifyNode(Application application, UIElement rootElement, UIElement element, UIElement innerContext, int createdId, int enabledId, int updatedId, int lateId)
        {
            LinqBindingNode node = s_NodePool.Get();

            node.Initialize(rootElement, element, innerContext);

            // todo -- profile this against skip tree
            UIElement ptr = element.parent;

            while (ptr != null)
            {
                if (ptr.bindingNode != null)
                {
                    node.parent = ptr.bindingNode;
                    break;
                }

                ptr = ptr.parent;
            }

            node.referencedContexts    = new UIElement[1];
            node.referencedContexts[0] = innerContext;

            node.SetBindings(application, rootElement, createdId, enabledId, updatedId, lateId);

            return(node);
        }