예제 #1
0
        public void SetSelected_Container()
        {
            var target = new XProject();

            var document = XDocument.Create();

            target.Documents = target.Documents.Add(document);

            var page = XContainer.CreatePage();

            document.Pages = document.Pages.Add(page);

            var layer = XLayer.Create("Layer1", page);

            page.Layers = page.Layers.Add(layer);

            bool raised = false;

            layer.InvalidateLayer += (sender, e) =>
            {
                raised = true;
            };

            target.SetSelected(page);

            Assert.Equal(document, target.CurrentDocument);
            Assert.Equal(page, target.CurrentContainer);
            Assert.True(raised);
        }
예제 #2
0
        public void SetSelected_Layer()
        {
            var target = new XProject();

            var page  = new XContainer();
            var layer = XLayer.Create("Layer1", page);

            target.SetSelected(layer);

            Assert.Equal(layer, page.CurrentLayer);
        }
예제 #3
0
        public void SetSelected_Document()
        {
            var target = new XProject();

            var document = XDocument.Create();

            target.Documents = target.Documents.Add(document);

            target.SetSelected(document);

            Assert.Equal(document, target.CurrentDocument);
        }