Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez Gual <lluis@xamarin.com>2015-04-15 21:25:21 +0300
committerLluis Sanchez Gual <lluis@xamarin.com>2015-04-15 22:01:36 +0300
commitc01e9a973783cda83d6f6aa702842c6438050bc4 (patch)
treef0168bc741c06b980e61ef9dd7100756cae73bb4 /main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
parent4d8e96a1003ead9b3ce76b1c71602795d031eedb (diff)
Fix unsupported project loading
Properly load unsupported projects as UnknownProject, and support saving simple changes such as adding/removing files.
Diffstat (limited to 'main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs18
1 files changed, 3 insertions, 15 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
index b413e0bc69..7757b02041 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Extensions/SolutionItemTypeNode.cs
@@ -109,21 +109,9 @@ namespace MonoDevelop.Projects.Extensions
if (factory == null)
factory = (SolutionItemFactory)Activator.CreateInstance (ItemType);
item = await factory.CreateItem (fileName, Guid);
- } else {
- try {
- // Some subclasses (such as ProjectTypeNode) need to assign some data to
- // the object before it is initialized. However, by default initialization
- // is automatically made by the constructor, so to support this scenario
- // the initialization has to be delayed. This is done by setting the
- // MonoDevelop.DelayItemInitialization logical context property.
- // When this property is set, the object is not initialized, and it has
- // to be manually initialized by calling EnsureInitialized.
- CallContext.LogicalSetData ("MonoDevelop.DelayItemInitialization", true);
- item = (SolutionItem)Activator.CreateInstance (ItemType, true);
- } finally {
- CallContext.LogicalSetData ("MonoDevelop.DelayItemInitialization", false);
- }
- }
+ } else
+ item = MSBuildProjectService.CreateUninitializedInstance (ItemType);
+
item.TypeGuid = Guid;
return item;
}