Browse Source

Ported some fixes for unit test mode from Fidalgo rev. 2014.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@256 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
d62435fb23
  1. 1
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/AbstractCompletionDataProvider.cs
  2. 8
      src/Main/Core/Project/Src/AddInTree/AddInTree.cs
  3. 18
      src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs
  4. 1
      src/Main/Core/Project/Src/Services/MessageService/InputBox.cs
  5. 2
      src/Main/Core/Project/Src/Services/PropertyService/PropertyService.cs
  6. 25
      src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs

1
src/Main/Base/Project/Src/TextEditor/Gui/Editor/CompletionWindow/AbstractCompletionDataProvider.cs

@ -87,7 +87,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -87,7 +87,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
if (list == null) {
return;
}
System.Diagnostics.Debugger.Break();
completionData.Capacity += list.Count;
CodeCompletionData suggestedData = null;
foreach (object o in list) {

8
src/Main/Core/Project/Src/AddInTree/AddInTree.cs

@ -28,13 +28,7 @@ namespace ICSharpCode.Core @@ -28,13 +28,7 @@ namespace ICSharpCode.Core
static AddInTree()
{
try {
// might fail in unit test mode
Assembly entryAssembly = Assembly.GetEntryAssembly();
defaultCoreDirectory = FileUtility.Combine(Path.GetDirectoryName(entryAssembly.Location), "..", "AddIns");
} catch (Exception) {
defaultCoreDirectory = "";
}
defaultCoreDirectory = FileUtility.Combine(FileUtility.SharpDevelopRootPath, "AddIns");
erbauer.Add("Class", new ClassErbauer());
erbauer.Add("FileFilter", new FileFilterErbauer());

18
src/Main/Core/Project/Src/Services/FileUtility/FileUtility.cs

@ -74,7 +74,7 @@ namespace ICSharpCode.Core @@ -74,7 +74,7 @@ namespace ICSharpCode.Core
}
}
public static string[] GetAvaiableRuntimeVersions()
public static string[] GetAvailableRuntimeVersions()
{
string installRoot = NETFrameworkInstallRoot;
string[] files = Directory.GetDirectories(installRoot);
@ -95,19 +95,11 @@ namespace ICSharpCode.Core @@ -95,19 +95,11 @@ namespace ICSharpCode.Core
return String.Empty;
}
if (paths.Length == 1) {
return paths[0];
string result = paths[0];
for (int i = 1; i < paths.Length; i++) {
result = Path.Combine(result, paths[i]);
}
string[] newPaths = new string[paths.Length - 1];
newPaths[0] = Path.Combine(paths[0], paths[1]);
Array.Copy(paths, 2,
newPaths, 1,
paths.Length - 2);
return Combine(newPaths);
return result;
}

1
src/Main/Core/Project/Src/Services/MessageService/InputBox.cs

@ -109,7 +109,6 @@ namespace ICSharpCode.Core @@ -109,7 +109,6 @@ namespace ICSharpCode.Core
// InputBox
//
this.AcceptButton = this.acceptButton;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(338, 144);
this.Controls.Add(this.textBox);

2
src/Main/Core/Project/Src/Services/PropertyService/PropertyService.cs

@ -19,7 +19,7 @@ namespace ICSharpCode.Core @@ -19,7 +19,7 @@ namespace ICSharpCode.Core
const string propertyXmlRootNodeName = "SharpDevelopProperties";
static string configDirectory = FileUtility.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ".ICSharpCode", "Corsavy") + Path.DirectorySeparatorChar;
static string dataDirectory = FileUtility.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "..", "data");
static string dataDirectory = FileUtility.Combine(FileUtility.SharpDevelopRootPath, "data");
static Properties properties = new Properties();

25
src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs

@ -24,18 +24,18 @@ namespace ICSharpCode.Core @@ -24,18 +24,18 @@ namespace ICSharpCode.Core
/// This Class contains two ResourceManagers, which handle string and image resources
/// for the application. It do handle localization strings on this level.
/// </summary>
public sealed class ResourceService
public static class ResourceService
{
readonly static string uiLanguageProperty = "CoreProperties.UILanguage";
readonly static string stringResources = "StringResources";
readonly static string imageResources = "BitmapResources";
static string resourceDirctory;
static string resourceDirectory;
static ResourceService()
{
resourceDirctory = FileUtility.Combine(PropertyService.DataDirectory, "resources");
resourceDirectory = FileUtility.Combine(PropertyService.DataDirectory, "resources");
LoadLanguageResources();
}
@ -111,25 +111,16 @@ namespace ICSharpCode.Core @@ -111,25 +111,16 @@ namespace ICSharpCode.Core
static void InitializeService()
{
RegisterAssembly(Assembly.GetEntryAssembly());
Assembly assembly = Assembly.GetEntryAssembly();
if (assembly != null) {
RegisterAssembly(assembly);
}
PropertyService.PropertyChanged += new PropertyChangedEventHandler(ChangeProperty);
LoadLanguageResources();
}
// core service : Can't use Initialize, because all other stuff needs this service before initialize is called.
ResourceService()
{
// if (System.Configuration.ConfigurationSettings.AppSettings["UserStrings"] != null) {
// userStrings = Load(resourceDirctory + Path.DirectorySeparatorChar + System.Configuration.ConfigurationSettings.AppSettings["UserStrings"]);
// }
// if (System.Configuration.ConfigurationSettings.AppSettings["UserIcons"] != null) {
// userIcons = Load(resourceDirctory + Path.DirectorySeparatorChar + System.Configuration.ConfigurationSettings.AppSettings["UserIcons"]);
// }
InitializeService();
}
/// <summary>
/// The LoadFont routines provide a safe way to load fonts.
/// </summary>
@ -210,7 +201,7 @@ namespace ICSharpCode.Core @@ -210,7 +201,7 @@ namespace ICSharpCode.Core
static Hashtable Load(string name, string language)
{
return Load(resourceDirctory + Path.DirectorySeparatorChar + name + "." + language + ".resources");
return Load(resourceDirectory + Path.DirectorySeparatorChar + name + "." + language + ".resources");
}

Loading…
Cancel
Save