Exemplo n.º 1
0
        void OnDescendantAdded(Element child)
        {
            DescendantAdded?.Invoke(this, new ElementEventArgs(child));

            if (RealParent != null)
            {
                RealParent.OnDescendantAdded(child);
            }
        }
Exemplo n.º 2
0
        void OnDescendantRemoved(Element child)
        {
            if (DescendantRemoved != null)
            {
                DescendantRemoved(this, new ElementEventArgs(child));
            }

            if (RealParent != null)
            {
                RealParent.OnDescendantRemoved(child);
            }
        }
Exemplo n.º 3
0
 public void TestReplaceParent() {
     Persister persister = new Persister();
     Set<String> children = new HashSet<String>();
     RealParent parent = new RealParent(children);
     children.add("Tom");
     children.add("Dick");
     children.add("Harry");
     StringWriter writer = new StringWriter();
     persister.write(parent, writer);
     String text = writer.toString();
     System.out.println(text);
     AssertEquals(text.indexOf("Tom"), -1);
     AssertEquals(text.indexOf("Dick"), -1);
     AssertEquals(text.indexOf("Harry"), -1);
     validate(persister, parent);
 }
Exemplo n.º 4
0
 void OnDescendantRemoved(Element child)
 {
     DescendantRemoved?.Invoke(this, new ElementEventArgs(child));
     RealParent?.OnDescendantRemoved(child);
 }