Index: /trunk/eraser/Eraser/TaskPropertiesForm.cs
===================================================================
--- /trunk/eraser/Eraser/TaskPropertiesForm.cs	(revision 2441)
+++ /trunk/eraser/Eraser/TaskPropertiesForm.cs	(revision 2442)
@@ -207,6 +207,6 @@
 		{
 			ErasureTarget target = task.Targets[e.ItemIndex];
-			FileInfo info = new FileInfo(target.UIText);
-			e.Item = new ListViewItem(info.GetCompactPath(data.Columns[0].Width, data.Font));
+			e.Item = new ListViewItem(PathUtil.GetCompactPath(target.UIText,
+				data.Columns[0].Width, data.Font));
 			e.Item.ToolTipText = target.UIText;
 
Index: /trunk/eraser/Eraser.Util/ExtensionMethods/IO.cs
===================================================================
--- /trunk/eraser/Eraser.Util/ExtensionMethods/IO.cs	(revision 2441)
+++ /trunk/eraser/Eraser.Util/ExtensionMethods/IO.cs	(revision 2442)
@@ -198,31 +198,5 @@
 		public static string GetCompactPath(this FileSystemInfo info, int newWidth, Font drawFont)
 		{
-			using (Control ctrl = new Control())
-			{
-				//First check if the source string is too long.
-				Graphics g = ctrl.CreateGraphics();
-				string longPath = info.FullName;
-				int width = g.MeasureString(longPath, drawFont).ToSize().Width;
-				if (width <= newWidth)
-					return longPath;
-
-				//It is, shorten it.
-				int aveCharWidth = width / longPath.Length;
-				int charCount = newWidth / aveCharWidth;
-				StringBuilder builder = new StringBuilder();
-				builder.Append(longPath);
-				builder.EnsureCapacity(charCount);
-
-				while (g.MeasureString(builder.ToString(), drawFont).Width > newWidth)
-				{
-					if (!NativeMethods.PathCompactPathEx(builder, longPath,
-						(uint)charCount--, 0))
-					{
-						return string.Empty;
-					}
-				}
-
-				return builder.ToString();
-			}
+			return PathUtil.GetCompactPath(info.FullName, newWidth, drawFont);
 		}
 
Index: /trunk/eraser/Eraser.Util/ExtensionMethods/PathUtil.cs
===================================================================
--- /trunk/eraser/Eraser.Util/ExtensionMethods/PathUtil.cs	(revision 2441)
+++ /trunk/eraser/Eraser.Util/ExtensionMethods/PathUtil.cs	(revision 2442)
@@ -25,4 +25,6 @@
 using System.Text;
 using System.IO;
+using System.Drawing;
+using System.Windows.Forms;
 
 namespace Eraser.Util.ExtensionMethods
@@ -110,4 +112,54 @@
 			return true;
 		}
+
+		/// <summary>
+		/// Compacts the file path, fitting in the given width.
+		/// </summary>
+		/// <param name="longPath">The path to compact.</param>
+		/// <param name="newWidth">The target width of the text.</param>
+		/// <param name="drawFont">The font used for drawing the text.</param>
+		/// <returns>The compacted file path.</returns>
+		public static string GetCompactPath(string longPath, int newWidth, Font drawFont)
+		{
+			using (Control ctrl = new Control())
+			using (Graphics g = ctrl.CreateGraphics())
+			{
+				//First check if the source string is too long.
+				int width = g.MeasureString(longPath, drawFont).ToSize().Width;
+				if (width <= newWidth)
+					return longPath;
+
+				//It is, shorten it.
+				int aveCharWidth = width / longPath.Length;
+				int charCount = newWidth / aveCharWidth;
+				StringBuilder builder = new StringBuilder();
+				builder.Append(longPath);
+				builder.EnsureCapacity(charCount);
+
+				while (g.MeasureString(builder.ToString(), drawFont).Width > newWidth)
+				{
+					if (!NativeMethods.PathCompactPathEx(builder, longPath,
+						(uint)charCount--, 0))
+					{
+						return string.Empty;
+					}
+				}
+
+				return builder.ToString();
+			}
+		}
+
+		/// <summary>
+		/// Compacts the file path, fitting in the given width.
+		/// </summary>
+		/// <param name="longPath">The path to compact.</param>
+		/// <param name="newWidth">The target width of the text.</param>
+		/// <param name="control">The control on which this text is drawn. This is used
+		/// for font information.</param>
+		/// <returns>The compacted file path.</returns>
+		public static string GetCompactPath(string longPath, int newWidth, Control control)
+		{
+			return GetCompactPath(longPath, newWidth, control.Font);
+		}
 	}
 }
