Permalink
Browse files

2008-07-24 Ivan N. Zlatev <contact@i-nz.net>

	* DesignTime/CodeProvider.cs: Make the search for a code behind file 
	case insensitive. 


svn path=/trunk/mwf-designer/; revision=108680
  • Loading branch information...
1 parent f935b7e commit 4c50dfe504fb61204f9dc2eb6477077469c0a76d @ivanz ivanz committed Jul 24, 2008
Showing with 17 additions and 3 deletions.
  1. +5 −0 ChangeLog
  2. +12 −3 src/DesignTime/CodeProvider.cs
View
5 ChangeLog
@@ -1,3 +1,8 @@
+2008-07-24 Ivan N. Zlatev <contact@i-nz.net>
+
+ * DesignTime/CodeProvider.cs: Make the search for a code behind file
+ case insensitive.
+
2008-07-23 Ivan N. Zlatev <contact@i-nz.net>
* UI/NewFileDialog.cs: Validate text entries.
View
15 src/DesignTime/CodeProvider.cs
@@ -36,6 +36,7 @@
using System.Reflection;
using Microsoft.CSharp;
using Microsoft.VisualBasic;
+using System.Globalization;
using ICSharpCode.NRefactory;
using ICSharpCode.NRefactory.Ast;
@@ -91,9 +92,17 @@ public CodeProvider (string fileName, ITypeResolutionService resolutionSvc)
internal static string GetCodeBehindFileName (string file)
{
- return Path.Combine (Path.GetDirectoryName (file),
- Path.GetFileNameWithoutExtension (file) + ".Designer" +
- Path.GetExtension (file));
+ string codeBehindFileName = Path.Combine (Path.GetDirectoryName (file),
+ (Path.GetFileNameWithoutExtension (file) +
+ ".Designer" + Path.GetExtension (file)));
+
+ foreach (string f in Directory.GetFiles (Path.GetDirectoryName (file))) {
+ Console.WriteLine (f);
+ if (String.Compare (f, codeBehindFileName, true, CultureInfo.InvariantCulture) == 0)
+ return f;
+ }
+
+ return null;
}
public static bool IsValid (string file)

0 comments on commit 4c50dfe

Please sign in to comment.