separat resource files for different resolutions

Topics: Mobile Client Software Factory
Nov 1, 2006 at 11:16 PM
originally posted by: Faraz_Mahmood

well i have used the OAC and i must appreciate your efforts. i want to create different resoruce dll for different resolution ,can you guid me , how this will be acheived. at moment all the resrources get embeded in the controls' assembly file,
i have checked the source file for ResourceManager ,and found a note that the build process should be fixed to achieve this behaviour, can you explain a bit further,. this note can be found where you setup private field of the resource manager so that it loads the resource from assembly,

Nov 2, 2006 at 2:09 AM
originally posted by: dcazzulino

I'm working on precisely that feature for our extended version of the control (see
It's not trivial to implement, as I found that generating multiple resource files also breaks the cool design-time experience we have now for embedded OACs (where they show the layout that matches that of the containing control/form).

You can notice that this doesn't work either for the standard .NET localization feature. Try localizing a user control. dropping it in a parent control/form and change the parent language. The embedded child control will not refresh to show the corresponding culture.

Fixing that is proving to be quite tricky, but I'm confident we'll have a CTP before the end of november, and an RTM version before EOY.

Nov 5, 2006 at 8:13 AM
originally posted by: Faraz_Mahmood

i got some success in generating separate satellite assemblies for different resoultion,
i added resolution related BUILD ACTION TYPE in project file.
<AvailableItemName Include="EmbeddedResource320_240" />
<AvailableItemName Include="EmbeddedResource480_640" />
<AvailableItemName Include="EmbeddedResource640_480" />

assigne each resoultion related resource file its build specified build type
then override the AfterResGen build target as follows

<Target Name="AfterResGen">

<CreateItem Include="@(EmbeddedResource320_240)" AdditionalMetadata="Culture=320-240">
<Output TaskParameter="Include" ItemName="OACResrouceWithCustomCulture"/>

<CreateItem Include="@(EmbeddedResource480_640)" AdditionalMetadata="Culture=480-640">
<Output TaskParameter="Include" ItemName="OACResrouceWithCustomCulture"/>

<CreateItem Include="@(EmbeddedResource640_480)" AdditionalMetadata="Culture=640-480">
<Output TaskParameter="Include" ItemName="OACResrouceWithCustomCulture"/>

<MakeDir Directories="$(IntermediateOutputPath)%(OACResrouceWithCustomCulture.Culture)"/>
<GenerateResource Sources="@(OACResrouceWithCustomCulture)" OutputResources="@(OACResrouceWithCustomCulture->'$(IntermediateOutputPath)%(LogicalName)')">

<Output TaskParameter="OutputResources" ItemName="OACResrouces"/>
<Output TaskParameter="FilesWritten" ItemName="FileWrites"/>

<AL EmbedResources="@(OACResrouces)"
OutputAssembly= "$(IntermediateOutputPath)%(OACResrouces.Culture)\$(TargetName).resources.dll">

<Output TaskParameter="OutputAssembly" ItemName="OACSatelliteAssemblies"/>


<Copy SourceFiles="@(OACSatelliteAssemblies)"

<Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>



that does the job , but i dont know what will happen in case you have localized file of OAC resource for different langauges. i.e 320-240_ar etc etc