예제 #1
0
                public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
                {
                    if (vNode.node.Parent != null)
                    {
                        var pchildren = vNode.node.Parent.Children;
                        int index     = pchildren.IndexOf(vNode.node);

                        vPatch.node.Parent = vNode.node.Parent; // change parent
                        pchildren[index]   = vPatch.node;       // change node
                        vNode.node.Parent.MarkAsDirty();

                        // runtime context
                        vNode.Parent.Children[index] = vPatch;
                        vPatch.Parent = vNode.Parent;

                        // change child
                        if (bridge != null)
                        {
                            var pra = GetNodeRuntimeAttribute(vNode.node.Parent);
                            vPatch.element = bridge.CreateElement(vPatch.node, vPatch.template.TagName, vPatch.StringAttr);
                            pra.element?.OnReplaceChild(vNode.element, vPatch.element);

                            PatchInsertChildRecursive(vPatch, bridge);
                        }
                    }
                }
예제 #2
0
                public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
                {
                    vNode.textDataBindExpressCurrentValue = text;

                    // chaneg attr
                    if (bridge != null)
                    {
                        if (vNode.element != null)
                        {
                            vNode.element.OnChangeText(text);
                        }
                    }
                }
예제 #3
0
 public void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
 {
     foreach (var group in groupList)
     {
         if (group.list != null)
         {
             foreach (var p in group.list)
             {
                 p.DoPatch(shadowPlay, bridge);
             }
         }
         else if (group.monoPatch != null)
         {
             group.monoPatch.DoPatch(shadowPlay, bridge);
         }
     }
 }
예제 #4
0
                public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
                {
                    if (vNode.node.Parent != null)
                    {
                        // flex remove
                        vNode.node.Parent.RemoveChild(vNode.node);

                        // runtime remove
                        vNode.Parent.Children.Remove(vNode);

                        // factory remove
                        if (bridge != null)
                        {
                            var pra = vNode.Parent;
                            pra.element?.OnRemove(vNode.element);
                        }
                    }
                }
예제 #5
0
                public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
                {
                    // flex add child
                    vPatch.node.Parent = null;
                    vNodePrent.node.AddChild(vPatch.node);

                    // runtime insert
                    vNodePrent.AppendChild(vPatch);

                    // factory add child
                    if (bridge != null)
                    {
                        vPatch.element = bridge.CreateElement(vPatch.node, vPatch.template.TagName, vPatch.StringAttr);
                        vNodePrent.element?.OnAddChild(vPatch.element);

                        PatchInsertChildRecursive(vPatch, bridge);
                    }
                }
예제 #6
0
                public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
                {
                    var props = vNode.attributes;

                    foreach (var kv in PropertiesDiff)
                    {
                        props[kv.Key] = kv.Value;

                        // try change style
                        shadowPlay.ProcessNodeStyle(vNode.node, kv.Key.TargetName, kv.Value != null ? kv.Value.ToString() : "");
                    }

                    // chaneg attr
                    if (bridge != null)
                    {
                        if (vNode.element != null)
                        {
                            foreach (var kv in PropertiesDiff)
                            {
                                vNode.element.OnChangeAttributes(kv.Key.TargetName, kv.Value);
                            }
                        }
                    }
                }
 /// <summary>
 /// Return binded text, otherwies return nul.
 /// </summary>
 /// <returns></returns>
 public string GetText()
 {
     return(ShadowPlay <T> .GetNodeRuntimeAttribute(node).textDataBindExpressCurrentValue);
 }
예제 #8
0
 public abstract void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge);
예제 #9
0
 public override void DoPatch(ShadowPlay <T> shadowPlay, Bridge <T> bridge)
 {
     // TODO: ..................
 }