Browse Source

Fixed drag'n'drop of components from the side bar to the form designer.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@352 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
aad4c32ffc
  1. 4
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/HelpService.cs
  2. 22
      src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/ToolboxService.cs
  3. 4
      src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs
  4. 5
      src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs
  5. 4
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCommand.cs

4
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/HelpService.cs

@ -30,9 +30,6 @@ namespace ICSharpCode.FormDesigner.Services
/// </remarks> /// </remarks>
public class HelpService : IHelpService public class HelpService : IHelpService
{ {
Hashtable LocalContexts = new Hashtable();
ArrayList ContextAttributes = new ArrayList();
string f1Keyword = null; string f1Keyword = null;
string generalKeyword = null; string generalKeyword = null;
@ -71,7 +68,6 @@ namespace ICSharpCode.FormDesigner.Services
public void RemoveLocalContext(IHelpService localContext) public void RemoveLocalContext(IHelpService localContext)
{ {
LocalContexts.Remove(LocalContexts);
} }
public void ShowHelpFromKeyword(string helpKeyword) public void ShowHelpFromKeyword(string helpKeyword)

22
src/AddIns/DisplayBindings/FormDesigner/Project/Src/FormDesigner/Services/ToolboxService.cs

@ -250,13 +250,7 @@ namespace ICSharpCode.FormDesigner.Services
public ToolboxItem DeserializeToolboxItem(object serializedObject) public ToolboxItem DeserializeToolboxItem(object serializedObject)
{ {
LoggingService.DebugFormatted("DeserializeToolboxItem {0}", serializedObject); return DeserializeToolboxItem(serializedObject, null);
if (serializedObject is System.Windows.Forms.IDataObject) {
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
return (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem));
}
}
return null;
} }
public ToolboxItem DeserializeToolboxItem(object serializedObject, IDesignerHost host) public ToolboxItem DeserializeToolboxItem(object serializedObject, IDesignerHost host)
@ -266,19 +260,21 @@ namespace ICSharpCode.FormDesigner.Services
if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) { if (((System.Windows.Forms.IDataObject)serializedObject).GetDataPresent(typeof(ToolboxItem))) {
ToolboxItem item = (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem)); ToolboxItem item = (ToolboxItem) ((System.Windows.Forms.IDataObject)serializedObject).GetData(typeof(ToolboxItem));
ArrayList list;
if (host != null) { if (host != null) {
ArrayList list = (ArrayList)toolboxByHost[host]; list = (ArrayList)toolboxByHost[host];
if (list != null && list.Contains(item)) {
return item;
}
list = (ArrayList)toolboxByHost[ALL_HOSTS];
if (list != null && list.Contains(item)) { if (list != null && list.Contains(item)) {
LoggingService.Warn(item.TypeName);
return item; return item;
} }
} }
list = (ArrayList)toolboxByHost[ALL_HOSTS];
if (list != null && list.Contains(item)) {
return item;
}
} }
} }
LoggingService.InfoFormatted("DeserializeToolboxItem {0} host {1} return null", serializedObject, host); LoggingService.WarnFormatted("DeserializeToolboxItem {0} host {1} return null", serializedObject, host);
return null; return null;
} }

4
src/Main/Base/Project/Src/Gui/Components/SideBar/AxSideBar.cs

@ -1079,11 +1079,11 @@ namespace ICSharpCode.SharpDevelop.Gui
public string[] GetFormats() public string[] GetFormats()
{ {
return null; return new string[0];
} }
public string[] GetFormats(bool autoConvert) public string[] GetFormats(bool autoConvert)
{ {
return null; return new string[0];
} }
public void SetData(object data) public void SetData(object data)

5
src/Main/Core/Project/Src/AddInTree/AddIn/AddIn.cs

@ -32,8 +32,9 @@ namespace ICSharpCode.Core
return o; return o;
} }
} }
LoggingService.Error("Cannot create object: " + className); if (hasShownErrorMessage) {
if (!hasShownErrorMessage) { LoggingService.Error("Cannot create object: " + className);
} else {
hasShownErrorMessage = true; hasShownErrorMessage = true;
MessageService.ShowError("Cannot create object: " + className + "\nFuture missing objects will not cause an error message."); MessageService.ShowError("Cannot create object: " + className + "\nFuture missing objects will not cause an error message.");
} }

4
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/Gui/MenuCommand.cs

@ -53,7 +53,9 @@ namespace ICSharpCode.Core
} else { } else {
menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]); menuCommand = (ICommand)codon.AddIn.CreateObject(codon.Properties["class"]);
} }
menuCommand.Owner = caller; if (menuCommand != null) {
menuCommand.Owner = caller;
}
} catch (Exception e) { } catch (Exception e) {
MessageService.ShowError(e, "Can't create menu command : " + codon.Id); MessageService.ShowError(e, "Can't create menu command : " + codon.Id);
} }

Loading…
Cancel
Save