You've already forked linux-packaging-mono
Imported Upstream version 5.2.0.175
Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
parent
4bdbaf4a88
commit
966bba02bb
@@ -6,7 +6,8 @@ PROGRAM = resgen.exe
|
||||
|
||||
CLEAN_FILES = resgen.exe
|
||||
|
||||
LIB_REFS = System System.Xml System.Core
|
||||
LIB_REFS = System System.Xml System.Core System.Drawing
|
||||
LOCAL_MCS_FLAGS = -unsafe
|
||||
|
||||
INSTALL_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
|
||||
ifndef INSTALL_PROFILE
|
||||
|
||||
@@ -15,32 +15,12 @@ using System.IO;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Resources;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
|
||||
class ResGen {
|
||||
|
||||
static Assembly swf;
|
||||
static Type resxr;
|
||||
static Type resxw;
|
||||
static HashSet<string> symbols = new HashSet<string> ();
|
||||
|
||||
/*
|
||||
* We load the ResX format stuff on demand, since the classes are in
|
||||
* System.Windows.Forms (!!!) and we can't depend on that assembly in mono, yet.
|
||||
*/
|
||||
static void LoadResX () {
|
||||
if (swf != null)
|
||||
return;
|
||||
try {
|
||||
swf = Assembly.Load (Consts.AssemblySystem_Windows_Forms);
|
||||
resxr = swf.GetType ("System.Resources.ResXResourceReader");
|
||||
resxw = swf.GetType ("System.Resources.ResXResourceWriter");
|
||||
} catch (Exception e) {
|
||||
throw new Exception ("Cannot load support for ResX format: " + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
static void Usage () {
|
||||
|
||||
string Usage = @"Mono Resource Generator version " + Consts.MonoVersion +
|
||||
@@ -91,16 +71,8 @@ Options:
|
||||
case ".resources":
|
||||
return new ResourceReader (stream);
|
||||
case ".resx":
|
||||
LoadResX ();
|
||||
IResourceReader reader = (IResourceReader) Activator.CreateInstance (
|
||||
resxr, new object[] {stream});
|
||||
if (useSourcePath) { // only possible on 2.0 profile, or higher
|
||||
PropertyInfo p = reader.GetType ().GetProperty ("BasePath",
|
||||
BindingFlags.Public | BindingFlags.Instance);
|
||||
if (p != null && p.CanWrite) {
|
||||
p.SetValue (reader, Path.GetDirectoryName (name), null);
|
||||
}
|
||||
}
|
||||
var reader = new ResXResourceReader (stream);
|
||||
reader.BasePath = Path.GetDirectoryName (name);
|
||||
return reader;
|
||||
default:
|
||||
throw new Exception ("Unknown format in file " + name);
|
||||
@@ -118,8 +90,7 @@ Options:
|
||||
case ".resources":
|
||||
return new ResourceWriter (stream);
|
||||
case ".resx":
|
||||
LoadResX ();
|
||||
return (IResourceWriter)Activator.CreateInstance (resxw, new object[] {stream});
|
||||
return new ResXResourceWriter (stream);
|
||||
default:
|
||||
throw new Exception ("Unknown format in file " + name);
|
||||
}
|
||||
@@ -165,7 +136,7 @@ Options:
|
||||
inner = inner.InnerException;
|
||||
}
|
||||
|
||||
if (inner is TargetInvocationException && inner.InnerException != null)
|
||||
if (inner is System.Reflection.TargetInvocationException && inner.InnerException != null)
|
||||
inner = inner.InnerException;
|
||||
if (inner != null)
|
||||
Console.WriteLine ("Inner exception: {0}", inner.Message);
|
||||
|
||||
@@ -1,4 +1,23 @@
|
||||
Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
monoresgen.cs
|
||||
../../class/System.Windows.Forms/System.Resources/AssemblyNamesTypeResolutionService.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXDataNode.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXResourceSet.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ByteArrayFromResXHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXDataNodeHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXResourceWriter.cs
|
||||
../../class/System.Windows.Forms/System.Resources/FileRefHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXFileRef.cs
|
||||
../../class/System.Windows.Forms/System.Resources/SerializedFromResXHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/InMemoryHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXNullRef.cs
|
||||
../../class/System.Windows.Forms/System.Resources/TypeConverterFromResXHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/NullRefHandler.cs
|
||||
../../class/System.Windows.Forms/System.Resources/ResXResourceReader.cs
|
||||
../../class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapFormatter.cs
|
||||
../../class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapReader.cs
|
||||
../../class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
|
||||
../../class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapWriter.cs
|
||||
|
||||
Reference in New Issue
Block a user