c# - Getting image names from DLL as a List? -


I created a DLL to encode my images and after that I get the image name from DLL as a list Want to Before posting this post, I went about it and I saw an example below.

  Public Stable List & lt; String & gt; GetImageList () {List & lt; String & gt; ImageList; system. reflection. Assembly BOAUIRSources = System.Reflection.Assembly.GetExecutingAssembly (); String [] resource = BOAUIRSources.GetManifestResourceNames (); Return Resources List & lt; String & gt; (); }  

This code is accessing just the image names that the action property is created Because of the "embedded resource" access to WPF, the creation of my images is the type of "resource" Should be defined as.

How can I list the image names, which is defined as the formation of the work resource, from the DLL?

Try it (taken from book - Chris Saras, Programming WPF by Ian Griffith)

  public static list & lt; String & gt; GetImageList () {System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly (); System Globalization. Culture Info = Thread. Present. String resource name = asm.GetName (). Name + ".g"; System.Resources.ResourceManager rm = New System. Resources. Resource manager (resource name, asm); System.Resources.ResourceSet Resourcesset = rm.GetResourceSet (culture, true, true); & Lt; String & gt; Resource = new list & lt; String & gt; (); Foreach (resource source entry in resource processing) {resources.Add (string) resource.key); } Rm.ReleaseAllResources (); Return processing; }  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -