|
Resource IDs: msg#00082gnome.mono.monodevelop.general
Hi, currently the resource ID of an embedded resource will be it's filename in MD (at least for c# projects, I haven't checked the others). This is different from what Visual Studio does. What VS does is explained here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbgrffileswithoutembeddedcultureinfostrings.asp I think this is a better way of assigning the IDs because currently in MD it can cause problems if you have two resources with the same filename (e.g. res/small/logo.png, res/big/logo.png). Besides this, it makes life easier for people that use MD and VS to work on the same project. The patch I attached modifies the way MD assigns embedded resources' IDs (only for c# projects). It works as follows: 1. If the resource file is "inside" the project base directory then its ID will be its relative path with the directory separator character replaced with '.'. 2. Otherwise it gets the same ID as before. Would anyone please review the patch? Thanks, Andras Index: Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs =================================================================== --- Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs (revision 2468) +++ Core/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs (working copy) @@ -128,7 +128,13 @@ break; case BuildAction.EmbedAsResource: // FIXME: workaround 60990 - writer.WriteLine(@"""/res:{0},{1}""", finfo.Name, Path.GetFileName (finfo.Name)); + string resourceId; + if(finfo.RelativePath.StartsWith ("." + Path.DirectorySeparatorChar)) { + resourceId = finfo.RelativePath.Substring(2).Replace (Path.DirectorySeparatorChar, '.'); + } else { + resourceId = Path.GetFileName (finfo.Name); + } + writer.WriteLine(@"""/res:{0},{1}""", finfo.Name, resourceId); break; } } |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [GUI Bug] "Infinite" "Application Output" tabs: 00082, Xoen |
|---|---|
| Next by Date: | Re: Resource IDs: 00082, Todd Berman |
| Previous by Thread: | [GUI Bug] "Infinite" "Application Output" tabsi: 00082, Xoen |
| Next by Thread: | Re: Resource IDs: 00082, Todd Berman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |