Browse Source

Fixed SD2-484: Designer verbs not displayed in forms designer

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1046 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
9a42a2c0f8
  1. 1
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs
  2. 6
      src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs
  3. 2
      src/AddIns/Misc/NAntAddIn/Project/Src/Commands/AbstractRunNAntCommand.cs
  4. 34
      src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

1
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs

@ -170,6 +170,7 @@ namespace ICSharpCode.FormsDesigner
ICSharpCode.FormsDesigner.Services.EventBindingService eventBindingService = new ICSharpCode.FormsDesigner.Services.EventBindingService(designSurface); ICSharpCode.FormsDesigner.Services.EventBindingService eventBindingService = new ICSharpCode.FormsDesigner.Services.EventBindingService(designSurface);
serviceContainer.AddService(typeof(System.ComponentModel.Design.IEventBindingService), eventBindingService); serviceContainer.AddService(typeof(System.ComponentModel.Design.IEventBindingService), eventBindingService);
serviceContainer.AddService(typeof(IDesignerHost), Host); // required for SD2-484
designerResourceService.Host = Host; designerResourceService.Host = Host;
DesignerLoader designerLoader = loaderProvider.CreateLoader(generator); DesignerLoader designerLoader = loaderProvider.CreateLoader(generator);

6
src/AddIns/DisplayBindings/XmlEditor/Project/Src/XmlView.cs

@ -401,7 +401,7 @@ namespace ICSharpCode.XmlEditor
public void ParseInformationUpdated(ParseInformation parseInfo) public void ParseInformationUpdated(ParseInformation parseInfo)
{ {
WorkbenchSingleton.SafeThreadAsyncCall(this, "UpdateFolding"); WorkbenchSingleton.SafeThreadAsyncCall((MethodInvoker)UpdateFolding);
} }
#endregion #endregion
@ -512,8 +512,8 @@ namespace ICSharpCode.XmlEditor
/// </summary> /// </summary>
void RefreshMargin() void RefreshMargin()
{ {
RefreshDelegate refreshDelegate = new RefreshDelegate(xmlEditor.ActiveTextAreaControl.TextArea.Refresh); WorkbenchSingleton.SafeThreadAsyncCall((RefreshDelegate)xmlEditor.ActiveTextAreaControl.TextArea.Refresh,
xmlEditor.ActiveTextAreaControl.TextArea.Invoke(refreshDelegate, new object[] { xmlEditor.ActiveTextAreaControl.TextArea.FoldMargin}); xmlEditor.ActiveTextAreaControl.TextArea.FoldMargin);
} }
/// <summary> /// <summary>

2
src/AddIns/Misc/NAntAddIn/Project/Src/Commands/AbstractRunNAntCommand.cs

@ -285,7 +285,7 @@ namespace ICSharpCode.NAntAddIn.Commands
// Update task list. // Update task list.
TaskCollection tasks = NAntOutputParser.Parse(outputText); TaskCollection tasks = NAntOutputParser.Parse(outputText);
foreach (Task task in tasks) { foreach (Task task in tasks) {
WorkbenchSingleton.SafeThreadCall(typeof(TaskService), "Add", new object[] {task}); WorkbenchSingleton.SafeThreadAsyncCall(typeof(TaskService), "Add", new object[] {task});
} }
// Bring task list to front. // Bring task list to front.

34
src/Main/Base/Project/Src/Gui/WorkbenchSingleton.cs

@ -97,7 +97,7 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Description of STAThreadCaller. /// Description of STAThreadCaller.
/// </summary> /// </summary>
public class STAThreadCaller private class STAThreadCaller
{ {
delegate object PerformCallDelegate(object target, string methodName, object[] arguments); delegate object PerformCallDelegate(object target, string methodName, object[] arguments);
@ -114,6 +114,11 @@ namespace ICSharpCode.SharpDevelop.Gui
performCallDelegate = new PerformCallDelegate(DoPerformCall); performCallDelegate = new PerformCallDelegate(DoPerformCall);
} }
public object Call(Delegate method, object[] arguments)
{
return ctl.Invoke(method, arguments);
}
public object Call(object target, string methodName, object[] arguments) public object Call(object target, string methodName, object[] arguments)
{ {
if (target == null) { if (target == null) {
@ -127,6 +132,11 @@ namespace ICSharpCode.SharpDevelop.Gui
return ctl.Invoke(performCallDelegate, new object[] {target, methodName, arguments}); return ctl.Invoke(performCallDelegate, new object[] {target, methodName, arguments});
} }
public void BeginCall(Delegate method, object[] arguments)
{
ctl.BeginInvoke(method, arguments);
}
public void BeginCall(object target, string methodName, object[] arguments) public void BeginCall(object target, string methodName, object[] arguments)
{ {
if (target == null) { if (target == null) {
@ -180,14 +190,24 @@ namespace ICSharpCode.SharpDevelop.Gui
/// <summary> /// <summary>
/// Makes a call GUI threadsafe. WARNING: This method waits for the result of the /// Makes a call GUI threadsafe. WARNING: This method waits for the result of the
/// operation, which can result in a dead-lock when the main thread waits for this /// operation, which can result in a dead-lock when the main thread waits for a lock
/// thread to exit! /// held by this thread!
/// </summary> /// </summary>
public static object SafeThreadCall(object target, string methodName, params object[] arguments) public static object SafeThreadCall(object target, string methodName, params object[] arguments)
{ {
return caller.Call(target, methodName, arguments); return caller.Call(target, methodName, arguments);
} }
/// <summary>
/// Makes a call GUI threadsafe. WARNING: This method waits for the result of the
/// operation, which can result in a dead-lock when the main thread waits for a lock
/// held by this thread!
/// </summary>
public static object SafeThreadCall(Delegate method, params object[] arguments)
{
return caller.Call(method, arguments);
}
/// <summary> /// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value. /// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary> /// </summary>
@ -195,6 +215,14 @@ namespace ICSharpCode.SharpDevelop.Gui
{ {
caller.BeginCall(target, methodName, arguments); caller.BeginCall(target, methodName, arguments);
} }
/// <summary>
/// Makes a call GUI threadsafe without waiting for the returned value.
/// </summary>
public static void SafeThreadAsyncCall(Delegate method, params object[] arguments)
{
caller.BeginCall(method, arguments);
}
#endregion #endregion
static void OnWorkbenchCreated() static void OnWorkbenchCreated()

Loading…
Cancel
Save