コード例 #1
0
        public void LayerCollection_LayerStatus()
        {
            using (new LifeTimeScope())
            {
                WFloInterface WFInt = new WFloInterface();
                WFInt.AddRef();

                string sfile = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\layers active.wflx");
                string sfileOutPut = WellFloFileLocation.BaselineWPSModel("WPS_Layer\\Saved layers active.wflx");

                WFInt.OpenFile(sfile);

                LayerCollection pLayerCollection = new LayerCollection();
                pLayerCollection.AddRef();

                WFInt.WellModel.AddRef().GetLayerCollectionData(pLayerCollection);

                pLayerCollection.SetLayerStatus(2, true);
                pLayerCollection.SetLayerStatus(1, true);

                WFInt.WellModel.AddRef().SetLayerCollectionData(pLayerCollection);

                WFInt.SaveFile(sfileOutPut);

                WFloInterface WFInt1 = new WFloInterface();
                WFInt1.AddRef();
                WFInt1.OpenFile(sfileOutPut);

                LayerCollection pLayerCollection1 = new LayerCollection();
                pLayerCollection1.AddRef();

                WFInt1.WellModel.AddRef().GetLayerCollectionData(pLayerCollection1);

                bool ActualStatus1 = pLayerCollection1.GetLayerStatus(1);
                string ActualName1 = pLayerCollection1.GetLayerName(1);
                bool ActualStatus2 = pLayerCollection1.GetLayerStatus(2);
                string ActualName2 = pLayerCollection1.GetLayerName(2);

                Assert.AreEqual(true, ActualStatus1);
                Assert.AreEqual("Layer 1", ActualName1);
                Assert.AreEqual(true, ActualStatus2);
                Assert.AreEqual("New Layer *1", ActualName2);
            }
        }