//
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
DateFormat, CultureInfo.InvariantCulture);
DateTime timeWritten = File.GetLastWriteTime (file);
int stringNums = int.Parse (tr.ReadLine ().Substring (20));
- ArrayList replacementTemp = new ArrayList ();
+ var replacementTemp = new List<string> ();
StringBuilder sb = new StringBuilder ();
while (replacementTemp.Count < stringNums) {
char c = (char) tr.Read ();
sb.Append (c);
}
}
- string [] replacementStrings = new string [replacementTemp.Count];
- replacementTemp.CopyTo (replacementStrings, 0);
+ string [] replacementStrings = replacementTemp.ToArray ();
string message = FormatMessage (source, instanceID, replacementStrings);
int eventID = EventLog.GetEventID (instanceID);
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security.Permissions;
-using System.Collections;
+using System.Collections.Generic;
using System.Security;
using System.Threading;
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern static int[] GetProcesses_internal();
- public static Process[] GetProcesses()
+ public static Process[] GetProcesses ()
{
int [] pids = GetProcesses_internal ();
if (pids == null)
return new Process [0];
- ArrayList proclist = new ArrayList (pids.Length);
+ var proclist = new List<Process> (pids.Length);
for (int i = 0; i < pids.Length; i++) {
try {
proclist.Add (GetProcessById (pids [i]));
}
}
- return ((Process []) proclist.ToArray (typeof (Process)));
+ return proclist.ToArray ();
}
[MonoTODO ("There is no support for retrieving process information from a remote machine")]
if (pids == null)
return new Process [0];
- ArrayList proclist = new ArrayList (pids.Length);
+ var proclist = new List<Process> (pids.Length);
for (int i = 0; i < pids.Length; i++) {
try {
Process p = GetProcessById (pids [i]);
}
}
- return ((Process []) proclist.ToArray (typeof (Process)));
+ return proclist.ToArray ();
}
[MonoTODO]
//
using System;
-using System.Collections;
+using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
string [] sources = (string []) logKey.GetValue ("Sources");
if (sources != null) {
- ArrayList temp = new ArrayList ();
+ var temp = new List<string> ();
for (int i = 0; i < sources.Length; i++)
if (sources [i] != source)
temp.Add (sources [i]);
- string [] newSources = new string [temp.Count];
- temp.CopyTo (newSources, 0);
+ string [] newSources = temp.ToArray ();
logKey.SetValue ("Sources", newSources);
}
}
using System;
using System.Collections;
+using System.Collections.Generic;
using System.IO;
using System.Threading;
return;
/* Removed files */
- ArrayList removed = null;
+ List<string> removed = null;
foreach (string filename in data.Files.Keys) {
FileData fd = (FileData) data.Files [filename];
if (fd.NotExists) {
if (removed == null)
- removed = new ArrayList ();
+ removed = new List<string> ();
removed.Add (filename);
DispatchEvents (data.FSW, FileAction.Removed, filename);
} catch {
/* Deleted */
if (removed == null)
- removed = new ArrayList ();
+ removed = new List<string> ();
removed.Add (filename);
DispatchEvents (data.FSW, FileAction.Removed, filename);