Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2008 Adding resources dynamically (CodeDom)

$
0
0
Hi all , I've been wondering how I can add custom ressources to my codedom builder. I have some data to store in but I'd like to avoid to add the default format which is : .resource

Is there a way to change that to anything I'd want? Like .something and read it as string.


Thats how I Attach resource on codedom params :
Code:

    Parameters.EmbeddedResources.Add("t.resources")
Then outside from the class, I write them to my builder form so I can retrieve on build.
Code:

Dim w As New Resources.ResourceWriter("t.resources")
                w.AddResource("Somename", "somedata")

Then on my generated form (codedom) I use a onload event to call it :

Code:

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
 
 Dim m As New Resources.ResourceManager("t", System.Reflection.Assembly.GetExecutingAssembly())
       
               
                m.GetObject("Somename")
      m.ReleaseAllResources()
               
  End Sub

Whenever I change the .resource to anything like .myownfile , I cannot open it on my codedom built form. Any clues ? Thanks ! :afrog:

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>