Hi Colm,
Thanks for the response, it clears it up for me why i can't directly access the resource file.
I was looking through the Localization Document with DotNetNuke and it seems to say it can be done. I found the below wording.
If you need to get a message from a class that is not directly tied to a visual control (user
control or page), for example a component class, you have to include the resources for
this messages in a special resource file (SharedRecources.resx) and specify this file in the
method call.
You can also use this feature to centralize in a single file common messages that are used
in many places in the module, preventing to have to localize the same messages in more
than one file.
Sample bad code:
Class ObjectController
Public Function AMethod() As String
return “a message”
End Function
End Class
Which should be corrected to:
Class ObjectController
Private SharedResourceFile As String = ApplicationPath + “/DesktopModules/<ModuleFolder>/App_LocalResources/SharedResources.resx”
Public Function AMethod() As String
return Localization.GetString(“Message”, SharedResourceFile)
End Function
Now frustratingley im a self taught C# guy which will come handy in the summer but for now i have to convert Vb to C#. Which with the above seems pretty simple, except i can't seem to access the ApplicationPath property within my mailer.cs file. Is there a different class to access in C# (or is that a dumb question)?
If there is, or there is another way, will the above example work?