Browse Source

Fixed possible StackOverflowException in pad creation.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@939 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
cd7eeedc53
  1. 14
      src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs
  2. 11
      src/Main/Core/Project/Src/Services/ResourceService/ResourceService.cs

14
src/Main/Base/Project/Src/Internal/Doozers/PadDescriptor.cs

@ -16,7 +16,8 @@ namespace ICSharpCode.Core
public class PadDescriptor : IDisposable public class PadDescriptor : IDisposable
{ {
Codon codon; Codon codon;
IPadContent padContent = null; IPadContent padContent;
bool padContentCreated;
/// <summary> /// <summary>
/// Returns the title of the pad. /// Returns the title of the pad.
@ -64,17 +65,13 @@ namespace ICSharpCode.Core
public bool HasFocus { public bool HasFocus {
get { get {
if (padContent == null) { return (padContent != null) ? padContent.Control.ContainsFocus : false;
return false;
} }
return padContent.Control.ContainsFocus;
} }
}
public IPadContent PadContent { public IPadContent PadContent {
get { get {
if (padContent == null) CreatePad(); CreatePad();
return padContent; return padContent;
} }
} }
@ -96,7 +93,8 @@ namespace ICSharpCode.Core
public void CreatePad() public void CreatePad()
{ {
if (padContent == null) { if (!padContentCreated) {
padContentCreated = true;
padContent = (IPadContent)codon.AddIn.CreateObject(Class); padContent = (IPadContent)codon.AddIn.CreateObject(Class);
} }
} }

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

@ -43,7 +43,16 @@ namespace ICSharpCode.Core
ResourceService.resourceDirectory = resourceDirectory; ResourceService.resourceDirectory = resourceDirectory;
PropertyService.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChange); PropertyService.PropertyChanged += new PropertyChangedEventHandler(OnPropertyChange);
LoadLanguageResources(PropertyService.Get(uiLanguageProperty, Thread.CurrentThread.CurrentUICulture.Name)); LoadLanguageResources(ResourceService.Language);
}
public static string Language {
get {
return PropertyService.Get(uiLanguageProperty, Thread.CurrentThread.CurrentUICulture.Name);
}
set {
PropertyService.Set(uiLanguageProperty, value);
}
} }
/// <summary>English strings (list of resource managers)</summary> /// <summary>English strings (list of resource managers)</summary>

Loading…
Cancel
Save