ResourceDllProviderBase, which makes it easy to get started.
Implementations must decorate the class with the ResourceProvider attribute, which NetServer will use to discover and load at runtime. The first parameter must be a name that uniquely identifies your provider. The second parameter is a priority number that can force your provider to be called before others, and thus override already-existing stuff. This is not normally a recommended practice, however, the lowest priority value is used first. SuperOffice default priority values are int.MaxValue divided by 2. If another provider that includes the same resource names with a lower priority value, such as int.MaxValue / 3, it takes precedence and overrides default resources supplied by SuperOffice.
The constructor expects two parameters:
- the name of the executing assembly
- the name of the resx resource files that contains the language-specific text resources.
Code example
Dependencies
Assemblies must be declared in the application’s configuration file. The key here is not special or mapped to anything else. It only needs to unique from other assemblies declared in the DynamicLoad section. The value must be the name of the resource assembly. The value is optionally a full path, or when placed in the applications directory only needs to be the name of the assembly.Example .NET project
In the example below, the project uses the NuGet packageSuperOffice.NetServer.Core to easily get a reference to the SuperOffice.Plugins.dll.
Resource Codes
Do it yourself
If you have special requirements, implement theIResourceProvider interface, or override the base class implementation. The methods CanInitialize(), Initialize(), GetSupportedLanguages(), and GetResource(string symbol) are easy to understand and implement.
The idea behind CanInitialize is that some providers may need database access, and so they should not be initialized too early. By doing a quick check and returning true only when everything is ready, you can postpone the initialization to the correct moment.