Commit Graph
89 Commits
Author SHA1 Message Date
Gert Driesen a0400ec347 * ResourceWriter.cs: On 2.0 profile, do not mistakenly identify an
enum as a predefined type. Fixes bug #325223.
* ResourceWriterTest.cs: Enabled test for writing enum value on 2.0
profile.

svn path=/trunk/mcs/; revision=94016
2008-01-26 19:53:48 +00:00
Gert Driesen d5dc02f026 * ResourceWriterTest.cs: Added ctor tests. Added tests for AddResource
overloads. Added test for argument null checks. Added test for bug
#339074. Added test for invoking Generate () multiple times.
* ResourceWriter.cs: On 2.0 profile, use case-insensitive SortedList. 
Changed exception messages and params to match MS. Allow null values 
in AddResource overloads. In Dispose (bool), also generate resources
(header) if no resources were added. Fixes bug #339074. When Generate
is done, reset resources to null to prevent further editing.  This      
also avoids the need for a separate bool to indicate whether generate
was already invoked. Code formatting.

svn path=/trunk/mcs/; revision=89412
2007-11-10 19:10:06 +00:00
Gert Driesen 23d32e135d * ResourceManager.cs: Removed temporary workaround for bug #43567.
Reworked basename to only throw ArgumentException if resource with
name ending on ".resources" does not actually exist. Fixes bug      
#336283. Do not throw exception in GetStream since this is already
done in InternalGetResourceSet. In InternalGetResourceSet, do not
throw MissingManifestResourceException when culture is null. Fixed
MissingManifestResourceException message to match MS. When using
file-based ResourceManager, then also throw an exception when file 
does not exist for neutral culture.
* ResourceManager.cs: Added tests for null argument checks. Added test
for GetStream with resource file that does not exist.

svn path=/trunk/mcs/; revision=88308
2007-10-27 15:32:24 +00:00
Gert Driesen 43f7164507 * ResourceManager.cs: Move code for determining manifest resource
name into separate method. Only use satellite assemblies for
non-invariant cultures. For invariant culture, only load resources 
from main assembly.

svn path=/trunk/mcs/; revision=85900
2007-09-17 16:35:59 +00:00
Gert Driesen 53fbc5fb1a * ResourceManager.cs: BaseName(Field) should return only the name.
Added resourceSource field to store the actual type, which we need for
the namespace. Added CheckBaseName method to avoid code duplication.
Only check whether basename does not end in '.resources' on 1.0 
profile. Fixed paramname of ArgumentNullExceptions to match MS.
Modified GetManifestResourceStreamNoCase to use resourceSource field
to construct manifest resource name. Modified GetStream to use   
CurrentUICulture when culture is null. Fixed InternalGetResourceSet
to use invariant resources when culture is the neutral culture.
Code formatting.
* ResourceManagerTest.cs: Restore the original UI Culture on TearDown.
Added ctor tests. Added tests for CreateFileBasedResourceManager.
Added tests for GetObject, GetString and GetResourceFileName.
Improved tests for GetStream. Added test for IgnoreCase.

svn path=/trunk/mcs/; revision=85866
2007-09-17 10:38:08 +00:00
Gert Driesen f20bb3562f * ResourceReader.cs: Fixed exception message to match MS. Removed
duplicate checks from string ctor.


svn path=/trunk/mcs/; revision=84799
2007-08-24 11:22:04 +00:00
Atsushi Eno df8743aab1 2007-08-09 Atsushi Enomoto <[email protected]>
* ResourceReader.cs : implemented GetResourceData(). Resources with
	  unresolvable types could still be parsed, so hold type names
	  instead of types.

	* ResourceReaderTest.cs : added tests for GetResourceData()


svn path=/trunk/mcs/; revision=83761
2007-08-09 15:10:58 +00:00
Miguel de Icaza e12b3020bc A few more changes from Jesse Jones, use SupressFinalize on
Dispose(true) cases


svn path=/trunk/mcs/; revision=82916
2007-07-28 16:10:50 +00:00
Rodrigo Kumpera 2f188f9c68 2007-07-16 Rodrigo Kumpera <[email protected]>
* ResourceReader.cs (ResourceValue): Put the null resource check
	  before the resource version 2 check, this fixes bug #81757


svn path=/trunk/mcs/; revision=82066
2007-07-16 23:40:51 +00:00
Atsushi Eno 41aa2767b5 2007-05-28 Atsushi Enomoto <[email protected]>
* ResourceWriter.cs : fix for runtime serialization type index.
	  Fixed bug #81759.

	* ResourceWriterTest.cs : new test, contains one for bug #81759.

	* corlib_test.dll.sources : added ResourceWriterTest.cs.


svn path=/trunk/mcs/; revision=78069
2007-05-28 16:02:23 +00:00
Atsushi Eno ebd1600c52 2007-05-28 Atsushi Enomoto <[email protected]>
* ResourceWriter.cs : temporarily disable 2.0 output until I get
	  bug #81759 fixed.


svn path=/trunk/mcs/; revision=78061
2007-05-28 14:34:26 +00:00
Atsushi Eno c98ee48759 2007-05-28 Atsushi Enomoto <[email protected]>
* IResourceWriter.cs NeutralResourcesLanguageAttribute.cs
	  SatelliteContractVersionAttribute.cs ResourceManager.cs
	  IResourceReader.cs ResourceSet.cs ResourceWriter.cs
	  ResourceReader.cs UltimateResourceFallbackLocation.cs
	  MissingManifestResourceException.cs :
	  implemented 2.0 resource support (write, and remaining read bits)
	  and GetStream(). Cosmetic attributes fixes.

	* UnmanagedMemoryStream.cs : added Closed event for sys.Resources use.
	* IntPtrStream.cs : added internal get_BaseAddress(), for the same.

	* ResourceManagerTest.cs : added tests for GetStream() (including
	  2.0 resource format tests).


svn path=/trunk/mcs/; revision=78024
2007-05-28 03:35:21 +00:00
Atsushi Eno 6aaf482259 2007-05-25 Atsushi Enomoto <[email protected]>
* MissingSatelliteAssemblyException.cs : new file.


svn path=/trunk/mcs/; revision=77943
2007-05-25 13:18:08 +00:00
Miguel de Icaza eedf39a535 Add new ctor
svn path=/trunk/mcs/; revision=74858
2007-03-22 23:35:03 +00:00
Miguel de Icaza b3214f6334 Add
svn path=/trunk/mcs/; revision=74855
2007-03-22 23:26:06 +00:00
Miguel de Icaza 51784e0b01 Assist in debugging
svn path=/trunk/mcs/; revision=74209
2007-03-13 21:29:47 +00:00
Gert Driesen b10b15c73d * ResourceReader.cs: Fixed typo.
svn path=/trunk/mcs/; revision=72979
2007-02-16 07:56:21 +00:00
Alexander Olk e988c2faeb * ResourceManager.cs: Don't create the ResourceSets hashtable in the
protected ctor, instead move it to the public ctors. Fixes some not
	working nunit tests. Also, return a closed ResourceSet instead of
	creating a new one. Fixes one more test. If only BaseNameField is
	provided, try to create a resource set from the BaseNameField. One
	more test that passes now.
	* ResourceSet.cs: Remove isDisposed. Not needed anymore.

2006-12-30  Alexander Olk  <[email protected]>


svn path=/trunk/mcs/; revision=70271
2006-12-30 21:51:30 +00:00
Alexander Olk 741a9a9c21 2006-12-30 Alexander Olk <[email protected]>
* ResourceManager.cs: Iterate through the values of the ResourceSets
	hashtable in ReleaseAllResources instead through the hashtable itself.


svn path=/trunk/mcs/; revision=70258
2006-12-30 16:07:24 +00:00
Gert Driesen 209ed36ee8 * ResourceReader.cs: Support reading byte arrays in v2 resource files.
Patch provided by Red Forks. Fixes bug #79976.
* ResourceReaderTest.cs: Added test for reading byte array.
No longer derive from Assertion class.

svn path=/trunk/mcs/; revision=70246
2006-12-29 23:40:46 +00:00
Alexander Olk 31181ed8f3 In System/System.ComponentModel:
2006-10-29 Alexander Olk <[email protected]>

	* ComponentResourceManager.cs: Don't close the resource set in
	  ApplyResources, it is possible to call ApplyResources multiple
	  times. Closing the resource set means that it gets disposed.
	  Fixes bug #79182.

In corlib/System.Resources:
2006-10-29  Alexander Olk  <[email protected]>

	* ResourceSet.cs, ResourceManager.cs: Calling ResourceSet.Close()
	  disposes a resource set. A closed resource set will now be
	  removed from ResourceSets. Fixes bug #79182.


svn path=/trunk/mcs/; revision=67076
2006-10-29 10:02:00 +00:00
Robert Jordan 410e0af78e 2006-03-14 Robert Jordan <[email protected]>
* ResourceManager.cs: Don't stop the resource set lookup until
	the invariant culture is reached. Fixes bug #77242.


svn path=/trunk/mcs/; revision=57937
2006-03-14 02:04:40 +00:00
Robert Jordan a8d88f55e6 Reverted until I get more details. See #77242.
svn path=/trunk/mcs/; revision=55648
2006-01-16 19:24:18 +00:00
Robert Jordan d9f3f2a889 2006-01-13 Robert Jordan <[email protected]>
* ResourceManager.cs: Fixed GetString/GetObject's recursion
	which never fall back to the invariant or neutral culture if
	the key was not found in a specific culture. Fixes bug #77242.


svn path=/trunk/mcs/; revision=55573
2006-01-14 10:14:45 +00:00
Zoltan Varga be3a2504ec 2005-11-19 Zoltan Varga <[email protected]>
* Win32Resources.cs: Add a new 'FileVersion' property.

svn path=/trunk/mcs/; revision=53274
2005-11-19 18:37:36 +00:00
Marek Safar eb747338c8 2005-07-25 Marek Safar <[email protected]>
*  ResourceReader.cs: Implemented reading of primitives for version 2.

svn path=/trunk/mcs/; revision=47640
2005-07-25 13:10:50 +00:00
Ben Maurer b27c8e1534 remove .cvsignore from everywhere, as it is useless on svn
svn path=/trunk/mcs/; revision=46564
2005-06-27 15:55:58 +00:00
Raja R Harinath e0cfa4925e Set svn:eol-style=native, delete svn:executable.
Fix line endings of System/Decimal.cs (only actual "change" in text, to force recompile of mscorlib to reflect changes in decimal constant handling in the compiler)


svn path=/trunk/mcs/; revision=44558
2005-05-16 12:23:26 +00:00
Sebastien Pouliot 9f5941f64b 2005-03-31 Sebastien Pouliot <[email protected]>
*  ResourceReader.cs, ResourceSet.cs: Added a LinkDemand for 
	SerializationFormatter when using a Stream constructor (other ctors
	have different security - e.g. FileIOPermission for opening a file).


svn path=/trunk/mcs/; revision=42422
2005-03-31 13:40:08 +00:00
Gonzalo Paniagua Javier 04dfc04887 2005-03-22 Gonzalo Paniagua Javier <[email protected]>
* ResourceManager.cs: use culture.Equals in InternalGetResourceSet().


svn path=/trunk/mcs/; revision=42130
2005-03-23 03:22:49 +00:00
Geoff Norton fd7d7eaae5 2005-02-12 Geoff Norton <[email protected]>
* ResourceReader.cs: If a resource type index is -1 return null
         instead of throwing an exception         
	* ResourceWriter.cs: If an object is null; encode it with type index
         -1 instead of throwing an exception.

svn path=/trunk/mcs/; revision=40569
2005-02-12 23:23:20 +00:00
Zoltan Varga 252cbe6b37 2005-02-11 Zoltan Varga <[email protected]>
* Win32Resources.cs: Fix warning.

svn path=/trunk/mcs/; revision=40484
2005-02-11 16:26:23 +00:00
Ben Maurer 2b4b651057 some warning silence
svn path=/trunk/mcs/; revision=37938
2004-12-19 18:21:41 +00:00
Ben Maurer 415b4749e8 2004-12-06 Ben Maurer <[email protected]>
* ResourceManager.cs (InternalResourceManager): on msft, they
	search for a case-insenstitive match too here.


svn path=/trunk/mcs/; revision=37277
2004-12-07 03:17:14 +00:00
Raja R Harinath 97553bb62e cvs ignores, sorry about the spam
svn path=/trunk/mcs/; revision=33874
2004-09-14 09:59:51 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Sebastien Pouliot 1e3d58625d 2004-05-02 Sebastien Pouliot <[email protected]>
* ResourceManager.cs: Avoid endless recursion when a resource file
	isn't found.

svn path=/trunk/mcs/; revision=28707
2004-06-02 16:27:02 +00:00
Lluis Sanchez ab1391e476 * ResourceSet.cs: Added minor null check.
svn path=/trunk/mcs/; revision=25232
2004-04-08 19:57:47 +00:00
Jackson Harper 947c30e6d8 * ResourceSet.cs: Do not throw an exception for null strings.
svn path=/trunk/mcs/; revision=22746
2004-02-03 19:23:26 +00:00
Zoltan Varga 405a2f77a9 2004-01-13 Zoltan Varga <[email protected]>
* Win32Resources.cs (Win32VersionInfoResource): Add more properties.

svn path=/trunk/mcs/; revision=22017
2004-01-13 13:17:04 +00:00
Zoltan Varga a6566fdf7e 2004-01-09 Zoltan Varga <[email protected]>
* Win32Resources.cs: Fix warnings not detected by mcs.

svn path=/trunk/mcs/; revision=21876
2004-01-09 14:45:45 +00:00
Zoltan Varga cab2b25c67 2004-01-09 Zoltan Varga <[email protected]>
* Win32Resources.cs (Win32VersionInfoResource:WriteTo): Add padding
	at the end of each string entry.

svn path=/trunk/mcs/; revision=21871
2004-01-09 13:17:03 +00:00
Zoltan Varga 7566fbaa5e 2004-01-08 Zoltan Varga <[email protected]>
* Win32Resources.cs (Win32VersionInfoResource): Fix version number
	calculation. Add Language property.

svn path=/trunk/mcs/; revision=21853
2004-01-08 16:32:13 +00:00
Zoltan Varga dabbcb3890 2004-01-08 Zoltan Varga <[email protected]>
* Win32Resources.cs: Organize win32 resources into a class hierarchy
	with the class Win32Resource as the abstract superclass. Add
	Win32ResFileReader and Win32IconFileReader classes and the
	corresponding resource types.

svn path=/trunk/mcs/; revision=21850
2004-01-08 14:44:38 +00:00
Zoltan Varga 2ced932e50 2004-01-05 Zoltan Varga <[email protected]>
* Win32Resources.cs: New file.

	* Win32Resources.cs: The value of properties can't be empty.

	* Win32Resources.cs: Add Win32ResourceType enumeration. Add accessors
	for well-known property names. Add missing namespace declaration.

svn path=/trunk/mcs/; revision=21719
2004-01-05 17:31:46 +00:00
Zoltan Varga 7fd76f30f8 2004-01-05 Zoltan Varga <[email protected]>
* Win32Resources.cs: The value of properties can't be empty.

svn path=/trunk/mcs/; revision=21718
2004-01-05 16:45:43 +00:00
Zoltan Varga 5e500a3537 2004-01-05 Zoltan Varga <[email protected]>
* corlib.dll.sources: Added System.Resources.Win32Resources.cs.

svn path=/trunk/mcs/; revision=21717
2004-01-05 16:24:42 +00:00
Zoltan Varga 22c9df4393 2003-12-17 Zoltan Varga <[email protected]>
* ResourceWriter.cs (Stream): New internal property used by Ref.Emit.

svn path=/trunk/mcs/; revision=21278
2003-12-17 16:38:07 +00:00
Dick Porter f204bdc417 Do string compares with the Invariant culture.
Use the char forms of IndexOf and LastIndexOf, so that the comparison is
done with the Invariant culture.

svn path=/trunk/mcs/; revision=20593
2003-11-28 18:22:08 +00:00
Andreas N a43df02714 2003-11-18 Andreas Nahr <[email protected]>
* ResourceSet.cs: Implemented v1.1 updates

svn path=/trunk/mcs/; revision=20192
2003-11-18 21:19:54 +00:00