public void SetDisplaySet()
        {
            ImageBox          imageBox    = new ImageBox();
            IDisplaySet       displaySet1 = new DisplaySet();
            IDisplaySet       displaySet2 = new DisplaySet();
            PresentationImage image1      = new TestPresentationImage();
            PresentationImage image2      = new TestPresentationImage();

            displaySet1.PresentationImages.Add(image1);
            displaySet2.PresentationImages.Add(image2);

            imageBox.DisplaySet = displaySet1;
            Assert.IsTrue(displaySet1.Visible);
            Assert.AreEqual(imageBox, displaySet1.ImageBox);

            imageBox.DisplaySet = null;
            Assert.IsFalse(displaySet1.Visible);
            Assert.IsNull(displaySet1.ImageBox);

            imageBox.DisplaySet = displaySet1;
            Assert.IsTrue(displaySet1.Visible);
            Assert.AreEqual(imageBox, displaySet1.ImageBox);

            imageBox.DisplaySet = displaySet2;
            Assert.IsTrue(displaySet2.Visible);
            Assert.IsFalse(displaySet1.Visible);
            Assert.AreEqual(imageBox, displaySet2.ImageBox);
            Assert.IsNull(displaySet1.ImageBox);
        }
        public void ReplaceDisplaySet()
        {
            IDisplaySet        displaySet1 = new DisplaySet();
            IPresentationImage image1      = new TestPresentationImage();

            displaySet1.PresentationImages.Add(image1);

            IDisplaySet        displaySet2 = new DisplaySet();
            IPresentationImage image2      = new TestPresentationImage();

            displaySet2.PresentationImages.Add(image2);

            ImageViewerComponent viewer = new ImageViewerComponent();

            IImageBox imageBox1 = new ImageBox();

            viewer.PhysicalWorkspace.ImageBoxes.Add(imageBox1);

            imageBox1.SetTileGrid(2, 2);
            imageBox1.DisplaySet = displaySet1;
            imageBox1[0, 0].Select();

            Assert.IsTrue(displaySet1.Selected);
            Assert.IsTrue(image1.Selected);

            imageBox1.DisplaySet = displaySet2;

            Assert.IsFalse(displaySet1.Selected);
            Assert.IsFalse(image1.Selected);

            Assert.IsTrue(displaySet2.Selected);
            Assert.IsTrue(image2.Selected);
        }
        public void LayoutImageBoxes()
        {
            IImageViewer viewer = new ImageViewerComponent();

            viewer.PhysicalWorkspace.SetImageBoxGrid(2, 1);

            IDisplaySet       displaySet1 = new DisplaySet();
            IDisplaySet       displaySet2 = new DisplaySet();
            PresentationImage image1      = new TestPresentationImage();
            PresentationImage image2      = new TestPresentationImage();

            displaySet1.PresentationImages.Add(image1);
            displaySet2.PresentationImages.Add(image2);

            viewer.PhysicalWorkspace.ImageBoxes[0].DisplaySet = displaySet1;
            viewer.PhysicalWorkspace.ImageBoxes[1].DisplaySet = displaySet2;
            viewer.PhysicalWorkspace.SetImageBoxGrid(1, 1);

            Assert.IsFalse(displaySet1.Visible);
            Assert.IsFalse(displaySet2.Visible);
        }