You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
committed by
Jo Shields
parent
183bba2c9a
commit
6992685b86
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
//
|
||||
// System.Resources.IResourceReader.cs
|
||||
//
|
||||
// Author:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public interface IResourceReader : IEnumerable, IDisposable
|
||||
{
|
||||
void Close();
|
||||
new IDictionaryEnumerator GetEnumerator();
|
||||
}
|
||||
}
|
@@ -1,48 +0,0 @@
|
||||
//
|
||||
// System.Resources.IResourceWriter.cs
|
||||
//
|
||||
// Author:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public interface IResourceWriter : IDisposable
|
||||
{
|
||||
void AddResource (string name, byte[] value);
|
||||
void AddResource (string name, object value);
|
||||
void AddResource (string name, string value);
|
||||
|
||||
void Close();
|
||||
|
||||
void Generate();
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
//
|
||||
// System.Resources.MissingManifestResourceException.cs
|
||||
//
|
||||
// Author:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public class MissingManifestResourceException: SystemException
|
||||
{
|
||||
// Constructors
|
||||
public MissingManifestResourceException ()
|
||||
: base (Locale.GetText ("The assembly does not contain the resources for the required culture."))
|
||||
{
|
||||
}
|
||||
|
||||
public MissingManifestResourceException (string message)
|
||||
:base (message)
|
||||
{
|
||||
}
|
||||
|
||||
protected MissingManifestResourceException (SerializationInfo info, StreamingContext context)
|
||||
:base (info, context)
|
||||
{
|
||||
}
|
||||
|
||||
public MissingManifestResourceException (String message, Exception inner)
|
||||
:base (message, inner)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,74 +0,0 @@
|
||||
//
|
||||
// System.Resources.MissingSatelliteAssemblyException.cs
|
||||
//
|
||||
// Author:
|
||||
// Atsushi Enomoto <atsushi@ximian.com>
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public class MissingSatelliteAssemblyException : SystemException
|
||||
{
|
||||
private string culture;
|
||||
|
||||
// Constructors
|
||||
public MissingSatelliteAssemblyException ()
|
||||
: base (Locale.GetText ("The satellite assembly was not found for the required culture."))
|
||||
{
|
||||
}
|
||||
|
||||
public MissingSatelliteAssemblyException (string message)
|
||||
:base (message)
|
||||
{
|
||||
}
|
||||
|
||||
public MissingSatelliteAssemblyException (string message, string cultureName)
|
||||
:base (message)
|
||||
{
|
||||
this.culture = cultureName;
|
||||
}
|
||||
|
||||
protected MissingSatelliteAssemblyException (SerializationInfo info, StreamingContext context)
|
||||
:base (info, context)
|
||||
{
|
||||
}
|
||||
|
||||
public MissingSatelliteAssemblyException (String message, Exception inner)
|
||||
: base (message, inner)
|
||||
{
|
||||
}
|
||||
|
||||
public string CultureName {
|
||||
get { return culture; }
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,76 +0,0 @@
|
||||
//
|
||||
// System.Resources.NeutralResourcesLanguageAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
public sealed class NeutralResourcesLanguageAttribute : Attribute
|
||||
{
|
||||
|
||||
string culture;
|
||||
UltimateResourceFallbackLocation loc;
|
||||
|
||||
// Constructors
|
||||
public NeutralResourcesLanguageAttribute (string cultureName)
|
||||
{
|
||||
if(cultureName==null) {
|
||||
throw new ArgumentNullException("culture is null");
|
||||
}
|
||||
|
||||
culture = cultureName;
|
||||
}
|
||||
|
||||
public string CultureName
|
||||
{
|
||||
get {
|
||||
return culture;
|
||||
}
|
||||
}
|
||||
|
||||
public NeutralResourcesLanguageAttribute (string cultureName, UltimateResourceFallbackLocation location)
|
||||
{
|
||||
if(cultureName==null) {
|
||||
throw new ArgumentNullException("culture is null");
|
||||
}
|
||||
|
||||
culture = cultureName;
|
||||
loc = location;
|
||||
}
|
||||
|
||||
public UltimateResourceFallbackLocation Location {
|
||||
get {
|
||||
return loc;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,233 +0,0 @@
|
||||
//
|
||||
// System.Resources.ResourceSet.cs
|
||||
//
|
||||
// Authors:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
// Dick Porter (dick@ximian.com)
|
||||
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
|
||||
//
|
||||
// (C) 2001, 2002 Ximian, Inc. http://www.ximian.com
|
||||
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Globalization;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[Serializable]
|
||||
[ComVisible (true)]
|
||||
public class ResourceSet : IDisposable, IEnumerable
|
||||
{
|
||||
[NonSerialized]
|
||||
protected IResourceReader Reader;
|
||||
protected Hashtable Table;
|
||||
bool resources_read;
|
||||
[NonSerialized] Hashtable table_nocase;
|
||||
|
||||
// Constructors
|
||||
protected ResourceSet ()
|
||||
{
|
||||
Table = new Hashtable ();
|
||||
resources_read = true;
|
||||
}
|
||||
|
||||
public ResourceSet (IResourceReader reader)
|
||||
{
|
||||
if (reader == null)
|
||||
throw new ArgumentNullException ("reader");
|
||||
Table = new Hashtable ();
|
||||
Reader = reader;
|
||||
}
|
||||
|
||||
internal bool IsDisposed {
|
||||
get {
|
||||
return Table == null;
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermission (SecurityAction.LinkDemand, SerializationFormatter = true)]
|
||||
public ResourceSet (Stream stream)
|
||||
{
|
||||
Table = new Hashtable ();
|
||||
Reader = new ResourceReader (stream);
|
||||
}
|
||||
|
||||
internal ResourceSet (UnmanagedMemoryStream stream)
|
||||
{
|
||||
Table = new Hashtable ();
|
||||
Reader = new ResourceReader (stream);
|
||||
}
|
||||
|
||||
public ResourceSet (string fileName)
|
||||
{
|
||||
Table = new Hashtable ();
|
||||
Reader = new ResourceReader (fileName);
|
||||
}
|
||||
|
||||
public virtual void Close ()
|
||||
{
|
||||
Dispose ();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose (true);
|
||||
|
||||
// If we are explicitly disposed, we can avoid finalization.
|
||||
GC.SuppressFinalize (this);
|
||||
}
|
||||
|
||||
protected virtual void Dispose (bool disposing)
|
||||
{
|
||||
if (disposing) {
|
||||
if(Reader != null)
|
||||
Reader.Close();
|
||||
}
|
||||
|
||||
Reader = null;
|
||||
Table = null;
|
||||
table_nocase = null;
|
||||
}
|
||||
|
||||
public virtual Type GetDefaultReader ()
|
||||
{
|
||||
return (typeof (ResourceReader));
|
||||
}
|
||||
|
||||
public virtual Type GetDefaultWriter ()
|
||||
{
|
||||
return (typeof (ResourceWriter));
|
||||
}
|
||||
|
||||
[ComVisible (false)]
|
||||
public virtual IDictionaryEnumerator GetEnumerator ()
|
||||
{
|
||||
if (IsDisposed)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
ReadResources ();
|
||||
return Table.GetEnumerator();
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator ()
|
||||
{
|
||||
return this.GetEnumerator ();
|
||||
}
|
||||
|
||||
private object GetObjectInternal (string name, bool ignoreCase)
|
||||
{
|
||||
if (name == null)
|
||||
throw new ArgumentNullException ("name");
|
||||
if (IsDisposed)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
|
||||
ReadResources ();
|
||||
|
||||
if (!ignoreCase)
|
||||
return Table [name];
|
||||
|
||||
if (table_nocase == null) {
|
||||
lock (Table) {
|
||||
if (table_nocase == null) {
|
||||
Hashtable ht = new Hashtable (StringComparer.InvariantCultureIgnoreCase);
|
||||
foreach (DictionaryEntry de in Table) {
|
||||
ht.Add (de.Key, de.Value);
|
||||
}
|
||||
table_nocase = ht;
|
||||
}
|
||||
}
|
||||
}
|
||||
return table_nocase [name];
|
||||
}
|
||||
|
||||
public virtual object GetObject (string name)
|
||||
{
|
||||
return GetObjectInternal (name, false);
|
||||
}
|
||||
|
||||
public virtual object GetObject (string name, bool ignoreCase)
|
||||
{
|
||||
return GetObjectInternal (name, ignoreCase);
|
||||
}
|
||||
|
||||
private string GetStringInternal (string name, bool ignoreCase)
|
||||
{
|
||||
object value = GetObject (name, ignoreCase);
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
string s = (value as string);
|
||||
if (s == null)
|
||||
throw new InvalidOperationException (string.Format (
|
||||
"Resource '{0}' is not a String. Use " +
|
||||
"GetObject instead.", name));
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
public virtual string GetString (string name)
|
||||
{
|
||||
return GetStringInternal (name, false);
|
||||
}
|
||||
|
||||
public virtual string GetString (string name, bool ignoreCase)
|
||||
{
|
||||
return GetStringInternal (name, ignoreCase);
|
||||
}
|
||||
|
||||
protected virtual void ReadResources ()
|
||||
{
|
||||
if (resources_read)
|
||||
return;
|
||||
|
||||
if (IsDisposed)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
lock (Table) {
|
||||
if (resources_read)
|
||||
return;
|
||||
|
||||
IDictionaryEnumerator i = Reader.GetEnumerator();
|
||||
i.Reset ();
|
||||
while (i.MoveNext ())
|
||||
Table.Add (i.Key, i.Value);
|
||||
resources_read = true;
|
||||
}
|
||||
}
|
||||
|
||||
internal UnmanagedMemoryStream GetStream (string name, bool ignoreCase)
|
||||
{
|
||||
if (IsDisposed)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
|
||||
IDictionaryEnumerator i = Reader.GetEnumerator();
|
||||
i.Reset ();
|
||||
while (i.MoveNext ()){
|
||||
if (String.Compare (name, (string) i.Key, ignoreCase) == 0)
|
||||
return ((ResourceReader.ResourceEnumerator) i).ValueAsStream;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
||||
//
|
||||
// System.Resources.InternalResourceSet
|
||||
//
|
||||
// Authors:
|
||||
// Sebastien Pouliot <sebastien@ximian.com>
|
||||
//
|
||||
// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
|
||||
namespace System.Resources {
|
||||
|
||||
// ResourceSet.GetObject always returns the same object reference - but ResourceManager doesn't use it!
|
||||
// Instead another internal type, RuntimeResourceSet, is used to return a cloned object (fix for bug #366489)
|
||||
[Serializable]
|
||||
internal class RuntimeResourceSet : ResourceSet {
|
||||
|
||||
// Constructor for Activator.CreateInstance from Silverlight
|
||||
public RuntimeResourceSet (UnmanagedMemoryStream stream) : base (stream)
|
||||
{
|
||||
}
|
||||
|
||||
public RuntimeResourceSet (Stream stream) :
|
||||
base (stream)
|
||||
{
|
||||
}
|
||||
|
||||
public RuntimeResourceSet (string fileName) :
|
||||
base (fileName)
|
||||
{
|
||||
}
|
||||
|
||||
public override object GetObject (string name)
|
||||
{
|
||||
if (Reader == null)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
|
||||
return CloneDisposableObjectIfPossible (base.GetObject (name));
|
||||
}
|
||||
|
||||
public override object GetObject (string name, bool ignoreCase)
|
||||
{
|
||||
if (Reader == null)
|
||||
throw new ObjectDisposedException ("ResourceSet is closed.");
|
||||
|
||||
return CloneDisposableObjectIfPossible (base.GetObject (name, ignoreCase));
|
||||
}
|
||||
|
||||
// if possible return a clone of the object if it's (a) clonable and (b) disposable
|
||||
private object CloneDisposableObjectIfPossible (object value)
|
||||
{
|
||||
ICloneable clonable = (value as ICloneable);
|
||||
return (clonable != null && (value is IDisposable)) ? clonable.Clone () : value;
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,51 +0,0 @@
|
||||
//
|
||||
// System.Resources.SatelliteContractVersionAttribute.cs
|
||||
//
|
||||
// Author:
|
||||
// Duncan Mak (duncan@ximian.com)
|
||||
//
|
||||
// (C) 2001 Ximian, Inc. http://www.ximian.com
|
||||
//
|
||||
|
||||
//
|
||||
// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[AttributeUsage (AttributeTargets.Assembly)]
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
public sealed class SatelliteContractVersionAttribute : Attribute
|
||||
{
|
||||
private Version ver;
|
||||
|
||||
// Constructor
|
||||
public SatelliteContractVersionAttribute (string version)
|
||||
{
|
||||
ver = new Version(version);
|
||||
}
|
||||
public string Version
|
||||
{
|
||||
get { return ver.ToString(); }
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
//
|
||||
// System.Resources.ResourceWriter.cs
|
||||
//
|
||||
// Authors:
|
||||
// Miguel de Icaza <miguel@novell.com>
|
||||
//
|
||||
//
|
||||
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
namespace System.Resources
|
||||
{
|
||||
[System.Runtime.InteropServices.ComVisible (true)]
|
||||
[Serializable]
|
||||
public enum UltimateResourceFallbackLocation {
|
||||
MainAssembly = 0,
|
||||
Satellite = 1
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user