コード例 #1
0
        public void ResourceManager()
        {
            var resourceManager = new EmbeddedResourceManager(typeof(GoldenCoreTests).Assembly, "Golden.Tests.Resources");

            var xSampleData = resourceManager.GetFileAsText("Files/SampleData.xml");
            var marks       =
                XDocument.Parse(xSampleData).Root
                .Elements("Mark")
                .Select(e => float.Parse(e.Value))
                .ToArray();

            var winIcon  = resourceManager.GetIcon("Icons/Home.ico", size: 128);
            var winImage = resourceManager.GetImage("Images/VS2010_256.png");

            var wpfIcon  = resourceManager.GetIconImageSource("Icons/Home.ico");
            var wpfImage = resourceManager.GetImageSource("Images/VS2010_256.png");

            Debugger.Break();
        }