Author: mkrueger
Date: 2007-07-05 07:07:03 -0400 (Thu, 05 Jul 2007)
New Revision: 81379
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/DefaultProperties.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/IProperties.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/PropertyEventArgs.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.mdp
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/ServiceManager.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/SystemAssemblyService.cs
Log:
* MonoDevelop.Core.Execution/ProcessService.cs,
MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs,
MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs,
MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs,
MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs,
MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs,
MonoDevelop.Core.Properties/DefaultProperties.cs,
MonoDevelop.Core.Properties/PropertyEventArgs.cs,
MonoDevelop.Core.Properties/IProperties.cs,
MonoDevelop.Core.Properties/CharacterEncodings.cs,
MonoDevelop.Core.mdp, MonoDevelop.Core/ServiceManager.cs,
MonoDevelop.Core/StringParserService.cs,
MonoDevelop.Core/SystemAssemblyService.cs: Refactored a bit.
Brought source code to .NET2 standards.
Modified: trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog 2007-07-05
11:04:18 UTC (rev 81378)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core/ChangeLog 2007-07-05
11:07:03 UTC (rev 81379)
@@ -1,3 +1,20 @@
+2007-07-05 Mike Krüger <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Core.Execution/ProcessService.cs,
+ MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs,
+ MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs,
+ MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs,
+ MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs,
+ MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs,
+ MonoDevelop.Core.Properties/DefaultProperties.cs,
+ MonoDevelop.Core.Properties/PropertyEventArgs.cs,
+ MonoDevelop.Core.Properties/IProperties.cs,
+ MonoDevelop.Core.Properties/CharacterEncodings.cs,
+ MonoDevelop.Core.mdp, MonoDevelop.Core/ServiceManager.cs,
+ MonoDevelop.Core/StringParserService.cs,
+ MonoDevelop.Core/SystemAssemblyService.cs: Refactored a bit.
+ Brought source code to .NET2 standards.
+
2007-07-04 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Core.ProgressMonitoring/ConsoleProgressStatus.cs: Track
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/ServiceManager.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/ServiceManager.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/ServiceManager.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -6,7 +6,7 @@
// </file>
using System;
-using System.Collections;
+using System.Collections.Generic;
using Mono.Addins;
using MonoDevelop.Core.Properties;
@@ -18,11 +18,11 @@
/// </summary>
public class ServiceManager
{
- ArrayList serviceList = new ArrayList();
- Hashtable servicesHashtable = new Hashtable();
- Hashtable initializedServices = new Hashtable ();
+ List<IService> serviceList = new
List<IService> ();
+ Dictionary<Type, IService> servicesHashtable = new
Dictionary<Type, IService> ();
+ List<IService> initializedServices = new
List<IService> ();
- static ServiceManager defaultServiceManager = new
ServiceManager();
+ static ServiceManager defaultServiceManager = new
ServiceManager ();
protected ServiceManager ()
{
@@ -51,8 +51,8 @@
static ServiceManager()
{
// add 'core' services
- AddService(new PropertyService());
- AddService(new StringParserService());
+ AddService (new PropertyService());
+ AddService (new StringParserService());
}
/// <remarks>
@@ -60,9 +60,8 @@
/// </remarks>
public static void UnloadAllServices()
{
- foreach (IService service in
defaultServiceManager.serviceList) {
+ foreach (IService service in
defaultServiceManager.serviceList)
service.UnloadService();
- }
}
public static void AddService(IService service)
@@ -72,9 +71,8 @@
public static void AddServices(IService[] services)
{
- foreach (IService service in services) {
+ foreach (IService service in services)
AddService(service);
- }
}
// HACK: MONO BUGFIX
@@ -103,10 +101,8 @@
/// </remarks>
IService FetchService(Type serviceType)
{
- IService s = (IService)servicesHashtable[serviceType];
- if (s != null) {
- return s;
- }
+ if (servicesHashtable.ContainsKey (serviceType))
+ return servicesHashtable[serviceType];
foreach (IService service in serviceList) {
if (IsInstanceOfType(serviceType, service)) {
@@ -114,7 +110,7 @@
if (!initializedServices.Contains
(service)) {
Runtime.LoggingService.Info
(GettextCatalog.GetString ("Initializing service: ") + serviceType);
service.InitializeService();
- initializedServices [service] =
service;
+ initializedServices.Add
(service);
}
return service;
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/StringParserService.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -6,8 +6,7 @@
// </file>
using System;
-using System.Collections;
-using System.Collections.Specialized;
+using System.Collections.Generic;
using System.Text;
using System.Globalization;
@@ -23,10 +22,10 @@
/// </summary>
public class StringParserService : AbstractService
{
- PropertyDictionary properties = new
PropertyDictionary();
- Hashtable stringTagProviders = new Hashtable();
+ Dictionary<string, string> properties = new Dictionary<string,
string> ();
+ Dictionary<string, IStringTagProvider> stringTagProviders = new
Dictionary<string, IStringTagProvider> ();
- public PropertyDictionary Properties {
+ public Dictionary<string, string> Properties {
get {
return properties;
}
@@ -34,7 +33,7 @@
public StringParserService()
{
- IDictionary variables =
Environment.GetEnvironmentVariables();
+ System.Collections.IDictionary variables =
Environment.GetEnvironmentVariables();
foreach (string name in variables.Keys) {
properties.Add("env:" + name,
(string)variables[name]);
}
@@ -184,7 +183,7 @@
return sb.ToString ();
}
}
-
+ /*
public class PropertyDictionary : DictionaryBase
{
/// <summary>
@@ -234,5 +233,5 @@
{
readOnlyProperties.Clear();
}
- }
+ }*/
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/SystemAssemblyService.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/SystemAssemblyService.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core/SystemAssemblyService.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -13,9 +13,9 @@
{
public class SystemAssemblyService : AbstractService
{
- Hashtable assemblyPathToPackage = new Hashtable ();
+ Dictionary<string, SystemPackage> assemblyPathToPackage = new
Dictionary<string, SystemPackage> ();
Dictionary<string, string> assemblyFullNameToPath = new
Dictionary<string, string> ();
- Hashtable packagesHash = new Hashtable ();
+ Dictionary<string, SystemPackage> packagesHash = new
Dictionary<string, SystemPackage> ();
List<SystemPackage> packages = new List<SystemPackage> ();
object initLock = new object ();
@@ -83,8 +83,8 @@
if (clrVersion == ClrVersion.Default)
clrVersion = currentVersion;
- ArrayList list = new ArrayList ();
- foreach (DictionaryEntry e in assemblyPathToPackage) {
+ List<string> list = new List<string> ();
+ foreach (KeyValuePair<string, SystemPackage> e in
assemblyPathToPackage) {
SystemPackage pkg = (SystemPackage) e.Value;
if (pkg.TargetVersion != ClrVersion.Default &&
pkg.TargetVersion != clrVersion)
continue;
@@ -102,12 +102,12 @@
if (!assemblyFullNameToPath.TryGetValue (fullname, out
path))
return null;
- return (SystemPackage) assemblyPathToPackage[path];
+ return assemblyPathToPackage.ContainsKey (path) ?
assemblyPathToPackage [path] : null;
}
public SystemPackage GetPackage (string name)
{
- return (SystemPackage) packagesHash [name];
+ return packagesHash.ContainsKey (name) ? packagesHash
[name] : null;
}
public SystemPackage GetPackage (string name, string version)
@@ -120,7 +120,7 @@
public SystemPackage GetPackageFromPath (string path)
{
- return (SystemPackage) assemblyPathToPackage [path];
+ return assemblyPathToPackage.ContainsKey (path) ?
assemblyPathToPackage [path] : null;
}
string NormalizeAsmName (string name)
@@ -128,8 +128,7 @@
int i = name.IndexOf (", PublicKeyToken=null");
if (i != -1)
return name.Substring (0, i).Trim ();
- else
- return name;
+ return name;
}
// Returns the installed version of the given assembly name
@@ -204,8 +203,7 @@
string gf = GetGacFile (gacDir, aname);
if (File.Exists (gf))
return gf;
- else
- return null;
+ return null;
}
string GetGacFile (string gacDir, string aname)
@@ -330,7 +328,7 @@
}
search_dirs += Path.PathSeparator + libpath;
if (search_dirs != null && search_dirs.Length > 0) {
- ArrayList scanDirs = new ArrayList ();
+ List<string> scanDirs = new List<string> ();
foreach (string potentialDir in
search_dirs.Split (Path.PathSeparator)) {
try {
string absPotentialDir =
Path.GetFullPath (potentialDir);
@@ -366,7 +364,7 @@
void RegisterSystemAssemblies (string prefix, string version,
ClrVersion ver)
{
SystemPackage package = new SystemPackage ();
- ArrayList list = new ArrayList ();
+ List<string> list = new List<string> ();
string dir = Path.Combine (prefix, version);
if(!Directory.Exists(dir)) {
@@ -378,7 +376,7 @@
list.Add (assembly);
}
- package.Initialize ("mono", version, "The Mono
runtime", (string[]) list.ToArray (typeof(string)), ver, null, false);
+ package.Initialize ("mono", version, "The Mono
runtime", list.ToArray (), ver, null, false);
packages.Add (package);
}
@@ -386,10 +384,10 @@
{
// Don't register the package twice
string pname = Path.GetFileNameWithoutExtension
(pcfile);
- if (packagesHash.Contains (pname))
+ if (packagesHash.ContainsKey (pname))
return;
- ArrayList fullassemblies = null;
+ List<string> fullassemblies = null;
string version = "";
string desc = "";
@@ -423,7 +421,7 @@
AddAssembly (assembly, package);
}
- package.Initialize (pname, version, desc, (string[])
fullassemblies.ToArray (typeof(string)), ClrVersion.Default, null, false);
+ package.Initialize (pname, version, desc,
fullassemblies.ToArray (), ClrVersion.Default, null, false);
packages.Add (package);
packagesHash [pname] = package;
}
@@ -441,11 +439,11 @@
}
}
- private ArrayList GetAssembliesWithLibInfo (string line, string
file)
+ private List<string> GetAssembliesWithLibInfo (string line,
string file)
{
- ArrayList references = new ArrayList ();
- ArrayList libdirs = new ArrayList ();
- ArrayList retval = new ArrayList ();
+ List<string> references = new List<string> ();
+ List<string> libdirs = new List<string> ();
+ List<string> retval = new List<string> ();
foreach (string piece in line.Split (' ')) {
if (piece.ToLower ().Trim ().StartsWith ("/r:")
|| piece.ToLower ().Trim ().StartsWith ("-r:")) {
references.Add (ProcessPiece
(piece.Substring (3).Trim (), file));
@@ -465,9 +463,9 @@
return retval;
}
- private ArrayList GetAssembliesWithoutLibInfo (string line,
string file)
+ private List<string> GetAssembliesWithoutLibInfo (string line,
string file)
{
- ArrayList references = new ArrayList ();
+ List<string> references = new List<string> ();
foreach (string reference in line.Split (' ')) {
if (reference.ToLower ().Trim ().StartsWith
("/r:") || reference.ToLower ().Trim ().StartsWith ("-r:")) {
string final_ref = reference.Substring
(3).Trim ();
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessService.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -1,7 +1,7 @@
// created on 12/17/2004 at 22:07
using System;
using System.IO;
-using System.Collections;
+using System.Collections.Generic;
using System.Threading;
using System.Diagnostics;
using Mono.Remoting.Channels.Unix;
@@ -18,7 +18,7 @@
public class ProcessService : AbstractService
{
ProcessHostController externalProcess;
- ArrayList executionHandlers;
+ List<ExtensionNode> executionHandlers;
string remotingChannel = "unix";
string unixRemotingFile;
@@ -151,7 +151,7 @@
public IExecutionHandler GetDefaultExecutionHandler (string
platformId)
{
if (executionHandlers == null) {
- executionHandlers = new ArrayList ();
+ executionHandlers = new List<ExtensionNode> ();
AddinManager.AddExtensionNodeHandler
("/SharpDevelop/Workbench/ExecutionHandlers", OnExtensionChange);
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedOperationMonitor.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -28,13 +28,13 @@
using System;
-using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.Core.ProgressMonitoring
{
public class AggregatedOperationMonitor: IDisposable
{
- ArrayList list = new ArrayList ();
+ List<IAsyncOperation> list = new List<IAsyncOperation> ();
IProgressMonitor monitor;
public AggregatedOperationMonitor (IProgressMonitor monitor,
params IAsyncOperation[] operations)
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/AggregatedProgressMonitor.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -28,7 +28,7 @@
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.IO;
namespace MonoDevelop.Core.ProgressMonitoring
@@ -51,7 +51,7 @@
public class AggregatedProgressMonitor: IProgressMonitor,
IAsyncOperation
{
IProgressMonitor masterMonitor;
- ArrayList monitors = new ArrayList ();
+ List<MonitorInfo> monitors = new List<MonitorInfo> ();
LogTextWriter logger;
class MonitorInfo {
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/LogTextWriter.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -30,7 +30,7 @@
using System;
using System.IO;
using System.Text;
-using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.Core.ProgressMonitoring
{
@@ -38,11 +38,11 @@
public class LogTextWriter: TextWriter
{
- ArrayList chainedWriters;
+ List<TextWriter> chainedWriters;
public void ChainWriter (TextWriter writer)
{
- if (chainedWriters == null) chainedWriters = new
ArrayList ();
+ if (chainedWriters == null) chainedWriters = new
List<TextWriter> ();
chainedWriters.Add (writer);
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/NullProgressMonitor.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -28,7 +28,7 @@
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.Threading;
using System.IO;
@@ -38,9 +38,9 @@
{
bool done, canceled, error;
ManualResetEvent waitEvent;
- ArrayList errors;
- ArrayList warnings;
- ArrayList messages;
+ List<ProgressError> errors;
+ List<string> warnings;
+ List<string> messages;
public object SyncRoot {
get { return this; }
@@ -49,27 +49,24 @@
public string[] Messages {
get {
if (messages != null)
- return (string[]) messages.ToArray
(typeof(string));
- else
- return new string [0];
+ return messages.ToArray ();
+ return new string [0];
}
}
public string[] Warnings {
get {
if (warnings != null)
- return (string[]) warnings.ToArray
(typeof(string));
- else
- return new string [0];
+ return warnings.ToArray ();
+ return new string [0];
}
}
public ProgressError[] Errors {
get {
if (errors != null)
- return (ProgressError[]) errors.ToArray
(typeof(ProgressError));
- else
- return new ProgressError [0];
+ return errors.ToArray ();
+ return new ProgressError [0];
}
}
@@ -96,21 +93,21 @@
public virtual void ReportSuccess (string message)
{
if (messages == null)
- messages = new ArrayList ();
+ messages = new List<string> ();
messages.Add (message);
}
public virtual void ReportWarning (string message)
{
if (warnings == null)
- warnings = new ArrayList ();
+ warnings = new List<string> ();
warnings.Add (message);
}
public virtual void ReportError (string message, Exception ex)
{
if (errors == null)
- errors = new ArrayList ();
+ errors = new List<ProgressError> ();
if (message == null && ex != null)
message = ex.Message;
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ProgressTracker.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -28,7 +28,7 @@
using System;
-using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.Core.ProgressMonitoring
{
@@ -36,7 +36,7 @@
{
bool done;
- ArrayList tasks = new ArrayList ();
+ List<Task> tasks = new List<Task> ();
class Task
{
public string Name;
@@ -97,7 +97,7 @@
}
Task LastTask {
- get { return (Task)tasks [tasks.Count-1]; }
+ get { return tasks [tasks.Count - 1]; }
}
public string CurrentTask {
@@ -127,7 +127,7 @@
double work = 0;
for (int n = tasks.Count - 1; n >= 0; n--) {
- Task t = (Task) tasks [n];
+ Task t = tasks [n];
work = t.GetWorkPercent (work) *
(double)t.StepSize;
}
return work;
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/CharacterEncodings.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -6,7 +6,7 @@
// </file>
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.Text;
namespace MonoDevelop.Core.Properties {
@@ -118,9 +118,9 @@
65001 // Unicode (UTF-8)
};
- static ArrayList _encodings;
- static ArrayList _names;
- static Hashtable _cp2index;
+ static List<EncodingWrapper> _encodings;
+ static List<string> _names;
+ static Dictionary<int, int> _cp2index;
class EncodingWrapper: IComparable {
@@ -180,8 +180,8 @@
}
}
- static IList GetSupportedEncodings() {
- ArrayList list = new ArrayList();
+ static List<EncodingWrapper> GetSupportedEncodings() {
+ List<EncodingWrapper> list = new
List<EncodingWrapper>();
foreach (int cp in _wellKnownCodePages) {
try {
list.Add(new EncodingWrapper(cp));
@@ -199,7 +199,7 @@
}
static CharacterEncodings() {
- _encodings = new ArrayList();
+ _encodings = new List<EncodingWrapper> ();
// try {
// // create system default encoding
// _encodings.Add(new EncodingWrapper(0));
@@ -207,8 +207,8 @@
// catch {}
_encodings.AddRange(GetSupportedEncodings());
- _names = new ArrayList();
- _cp2index = new Hashtable();
+ _names = new List<string> ();
+ _cp2index = new Dictionary<int, int> ();
int i = 0;
foreach (EncodingWrapper ew in _encodings) {
_names.Add(ew.Name);
@@ -217,7 +217,7 @@
}
}
- public static IList Names {
+ public static List<string> Names {
get {
return _names;
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/DefaultProperties.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/DefaultProperties.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/DefaultProperties.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -6,7 +6,7 @@
// </file>
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Diagnostics;
using System.Xml;
@@ -21,7 +21,7 @@
/// </summary>
public class DefaultProperties : IProperties
{
- Hashtable properties = new Hashtable();
+ Dictionary<string, object> properties = new Dictionary<string,
object> ();
/// <summary>
/// Gets a property out of the collection.
@@ -35,7 +35,7 @@
/// <param name="defaultvalue">
/// The default value of the property.
/// </param>
- public object GetProperty(string key, object defaultvalue)
+ public object GetProperty (string key, object defaultvalue)
{
if (!properties.ContainsKey(key)) {
if (defaultvalue != null) {
@@ -44,7 +44,7 @@
return defaultvalue;
}
- object obj = properties[key];
+ object obj = properties [key];
// stored an XmlElement in properties node ->
// set a FromXmlElement of the defaultvalue type at
this propertyposition.
@@ -63,7 +63,7 @@
/// <param name="key">
/// The name of the property.
/// </param>
- public object GetProperty(string key)
+ public object GetProperty (string key)
{
return GetProperty(key, (object)null);
}
@@ -201,8 +201,8 @@
/// </param>
public void SetProperty(string key, object val)
{
- object oldValue = properties[key];
- if (!val.Equals(oldValue)) {
+ object oldValue = GetProperty (key, val);
+ if (!val.Equals (oldValue)) {
if (val is DateTime)
val = ((DateTime)val).ToString ("s",
CultureInfo.InvariantCulture);
properties[key] = val;
@@ -255,7 +255,7 @@
{
XmlElement propertiesnode =
doc.CreateElement("Properties");
- foreach (DictionaryEntry entry in properties) {
+ foreach (KeyValuePair<string, object> entry in
properties) {
if (entry.Value != null) {
if (entry.Value is XmlElement) { //
write unchanged XmlElement back
propertiesnode.AppendChild(doc.ImportNode((XmlElement)entry.Value, true));
@@ -294,7 +294,7 @@
public IProperties Clone()
{
DefaultProperties df = new DefaultProperties();
- df.properties = (Hashtable)properties.Clone();
+ df.properties = new Dictionary<string, object>
(properties);
return df;
}
@@ -305,6 +305,6 @@
}
}
- public event PropertyEventHandler PropertyChanged;
+ public event EventHandler<PropertyEventArgs> PropertyChanged;
}
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/IProperties.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/IProperties.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/IProperties.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -164,6 +164,6 @@
/// The property changed event handler, it is called
/// when a property has changed.
/// </summary>
- event PropertyEventHandler PropertyChanged;
+ event EventHandler<PropertyEventArgs> PropertyChanged;
}
}
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/PropertyEventArgs.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/PropertyEventArgs.cs
2007-07-05 11:04:18 UTC (rev 81378)
+++
trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.Properties/PropertyEventArgs.cs
2007-07-05 11:07:03 UTC (rev 81379)
@@ -9,8 +9,6 @@
namespace MonoDevelop.Core.Properties
{
- public delegate void PropertyEventHandler(object sender,
PropertyEventArgs e);
-
public class PropertyEventArgs : EventArgs
{
IProperties properties;
Modified: trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.mdp
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.mdp
2007-07-05 11:04:18 UTC (rev 81378)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core/MonoDevelop.Core.mdp
2007-07-05 11:07:03 UTC (rev 81379)
@@ -1,13 +1,13 @@
<Project name="MonoDevelop.Core" fileversion="2.0" language="C#"
clr-version="Net_2_0" ctype="DotNetProject">
<Configurations active="Debug">
<Configuration name="Debug" ctype="DotNetProjectConfiguration">
- <Output directory="../../../build/bin/" assembly="MonoDevelop.Core" />
+ <Output directory="../../../build/bin/" signAssembly="False"
assembly="MonoDevelop.Core" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet"
clr-version="Net_2_0" />
<CodeGeneration compiler="Csc" warninglevel="4" optimize="False"
unsafecodeallowed="False" generateoverflowchecks="True" mainclass=""
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
- <Output directory="../../../build/bin/" assembly="MonoDevelop.Core" />
+ <Output directory="../../../build/bin/" signAssembly="False"
assembly="MonoDevelop.Core" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet"
clr-version="Net_2_0" />
<CodeGeneration compiler="Csc" warninglevel="4" optimize="True"
unsafecodeallowed="False" generateoverflowchecks="True" mainclass=""
generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
@@ -111,6 +111,7 @@
<AsmRefVar Sync="True" Name="REFS" Prefix="-r:" />
<ProjectRefVar Sync="True" Name="REFS" Prefix="-r:" />
</MonoDevelop.Autotools.MakefileInfo>
+ <MonoDevelop.Gettext.TranslationInfo />
<DeploymentInformation strategy="File">
<excludeFiles />
</DeploymentInformation>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches