示例#1
0
        public void InvalidAdd1()
        {
            MyContainer co = new MyContainer();
            var         c1 = new Label("hi1");

            co.InternalAdd(c1);
        }
示例#2
0
		public void InvalidAdd2 ()
		{
			MyContainer co = new MyContainer ();
			var c1 = new Label ("hi1");
			HBox b = new HBox ();
			b.PackStart (c1);
			co.InternalAdd (c1);
		}
示例#3
0
        public void InvalidAdd2()
        {
            MyContainer co = new MyContainer();
            var         c1 = new Label("hi1");
            HBox        b  = new HBox();

            b.PackStart(c1);
            co.InternalAdd(c1);
        }
示例#4
0
        public void InternalRemoveAdd()
        {
            // The a child can be removed from internal containers and still
            // be a child of the container

            MyContainer co = new MyContainer();

            Assert.AreEqual(0, co.Surface.Children.Count());

            var c1 = new Label("hi1");

            co.Add(c1);
            Assert.AreEqual(1, co.Surface.Children.Count());

            co.InternalRemove(c1);
            Assert.AreEqual(1, co.Surface.Children.Count());
            Assert.AreSame(co, c1.Parent);

            co.InternalAdd(c1);
            Assert.AreEqual(1, co.Surface.Children.Count());
            Assert.AreSame(co, c1.Parent);
        }
示例#5
0
		public void InvalidAdd1 ()
		{
			MyContainer co = new MyContainer ();
			var c1 = new Label ("hi1");
			co.InternalAdd (c1);
		}
示例#6
0
		public void InternalRemoveAdd ()
		{
			// The a child can be removed from internal containers and still
			// be a child of the container

			MyContainer co = new MyContainer ();
			Assert.AreEqual (0, co.Surface.Children.Count ());

			var c1 = new Label ("hi1");
			co.Add (c1);
			Assert.AreEqual (1, co.Surface.Children.Count ());

			co.InternalRemove (c1);
			Assert.AreEqual (1, co.Surface.Children.Count ());
			Assert.AreSame (co, c1.Parent);

			co.InternalAdd (c1);
			Assert.AreEqual (1, co.Surface.Children.Count ());
			Assert.AreSame (co, c1.Parent);
		}