|
|
|
@ -300,6 +300,7 @@ namespace ICSharpCode.Core
@@ -300,6 +300,7 @@ namespace ICSharpCode.Core
|
|
|
|
|
CompoundClass compound = GetClassInternal(fullyQualifiedName, addClass.TypeParameters.Count, language) as CompoundClass; |
|
|
|
|
if (compound != null) { |
|
|
|
|
// possibly replace existing class (look for CU with same filename)
|
|
|
|
|
lock (compound) { |
|
|
|
|
for (int i = 0; i < compound.Parts.Count; i++) { |
|
|
|
|
if (compound.Parts[i].CompilationUnit.FileName == addClass.CompilationUnit.FileName) { |
|
|
|
|
compound.Parts[i] = addClass; |
|
|
|
@ -310,6 +311,7 @@ namespace ICSharpCode.Core
@@ -310,6 +311,7 @@ namespace ICSharpCode.Core
|
|
|
|
|
} |
|
|
|
|
compound.Parts.Add(addClass); |
|
|
|
|
compound.UpdateInformationFromParts(); |
|
|
|
|
} |
|
|
|
|
LoggingService.Debug("Added new part!"); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
@ -460,6 +462,7 @@ namespace ICSharpCode.Core
@@ -460,6 +462,7 @@ namespace ICSharpCode.Core
|
|
|
|
|
// Use "as" cast to fix SD2-680: the stored class might be a part not marked as partial
|
|
|
|
|
CompoundClass compound = GetClassInternal(fullyQualifiedName, @class.TypeParameters.Count, language) as CompoundClass; |
|
|
|
|
if (compound == null) return; |
|
|
|
|
lock (compound) { |
|
|
|
|
compound.Parts.Remove(@class); |
|
|
|
|
if (compound.Parts.Count > 0) { |
|
|
|
|
compound.UpdateInformationFromParts(); |
|
|
|
@ -468,6 +471,7 @@ namespace ICSharpCode.Core
@@ -468,6 +471,7 @@ namespace ICSharpCode.Core
|
|
|
|
|
@class = compound; // all parts removed, remove compound class
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IClass classInDictionary; |
|
|
|
|
if (!GetClasses(language).TryGetValue(fullyQualifiedName, out classInDictionary)) { |
|
|
|
|