Browse Source

Fixed exception when trying to delete a MarshalByValueComponent (like DataSet) using the keyboard.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@966 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
dee27d74c7
  1. 4
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ResolveVisitor.cs
  2. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs
  3. 4
      src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/MenuCommandService.cs
  4. 4
      src/Main/Base/Project/Src/Dom/IUsing.cs
  5. 2
      src/Main/Base/Project/Src/Dom/Implementations/DefaultComment.cs
  6. 36
      src/Main/Base/Project/Src/Dom/Implementations/DefaultUsing.cs
  7. 2
      src/Main/Base/Project/Src/Dom/Tag.cs

4
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/CodeCompletion/ResolveVisitor.cs

@ -583,6 +583,10 @@ namespace Grunwald.BooBinding.CodeCompletion
public override void OnArrayLiteralExpression(ArrayLiteralExpression node) public override void OnArrayLiteralExpression(ArrayLiteralExpression node)
{ {
if (node.Type != null) {
MakeResult(ConvertType(node.Type));
return;
}
IReturnType elementType = null; IReturnType elementType = null;
foreach (Expression expr in node.Items) { foreach (Expression expr in node.Items) {
ClearResult(); ClearResult();

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/FormKeyHandler.cs

@ -121,7 +121,7 @@ namespace ICSharpCode.FormsDesigner
ISelectionService selectionService = (ISelectionService)formDesigner.Host.GetService(typeof(ISelectionService)); ISelectionService selectionService = (ISelectionService)formDesigner.Host.GetService(typeof(ISelectionService));
ICollection components = selectionService.GetSelectedComponents(); ICollection components = selectionService.GetSelectedComponents();
if (components.Count == 1) { if (components.Count == 1) {
foreach (Component component in components) { foreach (IComponent component in components) {
if (HandleMenuCommand(formDesigner, component, keyPressed)) if (HandleMenuCommand(formDesigner, component, keyPressed))
return false; return false;
} }
@ -138,7 +138,7 @@ namespace ICSharpCode.FormsDesigner
return false; return false;
} }
bool HandleMenuCommand(FormsDesignerViewContent formDesigner, Component activeComponent, Keys keyPressed) bool HandleMenuCommand(FormsDesignerViewContent formDesigner, IComponent activeComponent, Keys keyPressed)
{ {
Assembly asm = typeof(WindowsFormsDesignerOptionService).Assembly; Assembly asm = typeof(WindowsFormsDesignerOptionService).Assembly;
// Microsoft made ToolStripKeyboardHandlingService internal, so we need Reflection // Microsoft made ToolStripKeyboardHandlingService internal, so we need Reflection

4
src/AddIns/DisplayBindings/FormsDesigner/Project/Src/Services/MenuCommandService.cs

@ -135,9 +135,9 @@ namespace ICSharpCode.FormsDesigner.Services
ISelectionService selectionService = (ISelectionService)designSurface.GetService(typeof(ISelectionService)); ISelectionService selectionService = (ISelectionService)designSurface.GetService(typeof(ISelectionService));
IDesignerHost host = (IDesignerHost)serviceContainer.GetService(typeof(IDesignerHost)); IDesignerHost host = (IDesignerHost)serviceContainer.GetService(typeof(IDesignerHost));
if (host != null && selectionService != null && selectionService.SelectionCount == 1) { if (host != null && selectionService != null && selectionService.SelectionCount == 1) {
IComponent selectedComponent = selectionService.PrimarySelection as Component; IComponent selectedComponent = selectionService.PrimarySelection as IComponent;
if (selectedComponent != null) { if (selectedComponent != null) {
IDesigner designer = host.GetDesigner((IComponent)selectedComponent); IDesigner designer = host.GetDesigner(selectedComponent);
if (designer != null) { if (designer != null) {
designerVerbCollection.AddRange(designer.Verbs); designerVerbCollection.AddRange(designer.Verbs);
} }

4
src/Main/Base/Project/Src/Dom/IUsing.cs

@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Dom
get; get;
} }
IReturnType SearchType(string partitialTypeName, int typeParameterCount); IReturnType SearchType(string partialTypeName, int typeParameterCount);
string SearchNamespace(string partitialNamespaceName); string SearchNamespace(string partialNamespaceName);
} }
} }

2
src/Main/Base/Project/Src/Dom/Implementations/DefaultComment.cs

@ -11,7 +11,7 @@ using System.Collections.Generic;
namespace ICSharpCode.SharpDevelop.Dom { namespace ICSharpCode.SharpDevelop.Dom {
[Serializable] [Serializable]
public class DefaultComment : System.MarshalByRefObject, IComment public class DefaultComment : IComment
{ {
bool isBlockComment; bool isBlockComment;
string commentTag; string commentTag;

36
src/Main/Base/Project/Src/Dom/Implementations/DefaultUsing.cs

@ -13,7 +13,7 @@ using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Dom namespace ICSharpCode.SharpDevelop.Dom
{ {
[Serializable] [Serializable]
public class DefaultUsing : MarshalByRefObject, IUsing public class DefaultUsing : IUsing
{ {
DomRegion region; DomRegion region;
IProjectContent projectContent; IProjectContent projectContent;
@ -61,7 +61,7 @@ namespace ICSharpCode.SharpDevelop.Dom
aliases.Add(alias, type); aliases.Add(alias, type);
} }
public string SearchNamespace(string partitialNamespaceName) public string SearchNamespace(string partialNamespaceName)
{ {
if (HasAliases) { if (HasAliases) {
foreach (KeyValuePair<string, IReturnType> entry in aliases) { foreach (KeyValuePair<string, IReturnType> entry in aliases) {
@ -69,14 +69,14 @@ namespace ICSharpCode.SharpDevelop.Dom
continue; continue;
string aliasString = entry.Key; string aliasString = entry.Key;
string nsName; string nsName;
if (projectContent.Language.NameComparer.Equals(partitialNamespaceName, aliasString)) { if (projectContent.Language.NameComparer.Equals(partialNamespaceName, aliasString)) {
nsName = entry.Value.FullyQualifiedName; nsName = entry.Value.FullyQualifiedName;
if (projectContent.NamespaceExists(nsName)) if (projectContent.NamespaceExists(nsName))
return nsName; return nsName;
} }
if (partitialNamespaceName.Length > aliasString.Length) { if (partialNamespaceName.Length > aliasString.Length) {
if (projectContent.Language.NameComparer.Equals(partitialNamespaceName.Substring(0, aliasString.Length + 1), aliasString + ".")) { if (projectContent.Language.NameComparer.Equals(partialNamespaceName.Substring(0, aliasString.Length + 1), aliasString + ".")) {
nsName = String.Concat(entry.Value.FullyQualifiedName, partitialNamespaceName.Remove(0, aliasString.Length)); nsName = String.Concat(entry.Value.FullyQualifiedName, partialNamespaceName.Remove(0, aliasString.Length));
if (projectContent.NamespaceExists(nsName)) { if (projectContent.NamespaceExists(nsName)) {
return nsName; return nsName;
} }
@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.Dom
} }
if (projectContent.Language.ImportNamespaces) { if (projectContent.Language.ImportNamespaces) {
foreach (string str in usings) { foreach (string str in usings) {
string possibleNamespace = String.Concat(str, ".", partitialNamespaceName); string possibleNamespace = String.Concat(str, ".", partialNamespaceName);
if (projectContent.NamespaceExists(possibleNamespace)) if (projectContent.NamespaceExists(possibleNamespace))
return possibleNamespace; return possibleNamespace;
} }
@ -94,19 +94,19 @@ namespace ICSharpCode.SharpDevelop.Dom
return null; return null;
} }
public IReturnType SearchType(string partitialTypeName, int typeParameterCount) public IReturnType SearchType(string partialTypeName, int typeParameterCount)
{ {
if (HasAliases) { if (HasAliases) {
foreach (KeyValuePair<string, IReturnType> entry in aliases) { foreach (KeyValuePair<string, IReturnType> entry in aliases) {
string aliasString = entry.Key; string aliasString = entry.Key;
if (projectContent.Language.NameComparer.Equals(partitialTypeName, aliasString)) { if (projectContent.Language.NameComparer.Equals(partialTypeName, aliasString)) {
if (entry.Value.IsDefaultReturnType && entry.Value.GetUnderlyingClass() == null) if (entry.Value.IsDefaultReturnType && entry.Value.GetUnderlyingClass() == null)
continue; // type not found, maybe entry was a namespace continue; // type not found, maybe entry was a namespace
return entry.Value; return entry.Value;
} }
if (partitialTypeName.Length > aliasString.Length) { if (partialTypeName.Length > aliasString.Length) {
if (projectContent.Language.NameComparer.Equals(partitialTypeName.Substring(0, aliasString.Length + 1), aliasString + ".")) { if (projectContent.Language.NameComparer.Equals(partialTypeName.Substring(0, aliasString.Length + 1), aliasString + ".")) {
string className = entry.Value.FullyQualifiedName + partitialTypeName.Remove(0, aliasString.Length); string className = entry.Value.FullyQualifiedName + partialTypeName.Remove(0, aliasString.Length);
IClass c = projectContent.GetClass(className, typeParameterCount); IClass c = projectContent.GetClass(className, typeParameterCount);
if (c != null) { if (c != null) {
return c.DefaultReturnType; return c.DefaultReturnType;
@ -117,25 +117,25 @@ namespace ICSharpCode.SharpDevelop.Dom
} }
if (projectContent.Language.ImportNamespaces) { if (projectContent.Language.ImportNamespaces) {
foreach (string str in usings) { foreach (string str in usings) {
IClass c = projectContent.GetClass(str + "." + partitialTypeName, typeParameterCount); IClass c = projectContent.GetClass(str + "." + partialTypeName, typeParameterCount);
if (c != null) { if (c != null) {
return c.DefaultReturnType; return c.DefaultReturnType;
} }
} }
} else { } else {
int pos = partitialTypeName.IndexOf('.'); int pos = partialTypeName.IndexOf('.');
string className, subClassName; string className, subClassName;
if (pos < 0) { if (pos < 0) {
className = partitialTypeName; className = partialTypeName;
subClassName = null; subClassName = null;
} else { } else {
className = partitialTypeName.Substring(0, pos); className = partialTypeName.Substring(0, pos);
subClassName = partitialTypeName.Substring(pos + 1); subClassName = partialTypeName.Substring(pos + 1);
} }
foreach (string str in usings) { foreach (string str in usings) {
IClass c = projectContent.GetClass(str + "." + className, typeParameterCount); IClass c = projectContent.GetClass(str + "." + className, typeParameterCount);
if (c != null) { if (c != null) {
c = projectContent.GetClass(str + "." + partitialTypeName, typeParameterCount); c = projectContent.GetClass(str + "." + partialTypeName, typeParameterCount);
if (c != null) { if (c != null) {
return c.DefaultReturnType; return c.DefaultReturnType;
} }

2
src/Main/Base/Project/Src/Dom/Tag.cs

@ -10,7 +10,7 @@ using System;
namespace ICSharpCode.SharpDevelop.Dom namespace ICSharpCode.SharpDevelop.Dom
{ {
[Serializable] [Serializable]
public class Tag : MarshalByRefObject //Comment public class Tag //Comment
{ {
string key; string key;

Loading…
Cancel
Save