Преглед на файлове

Fix to editable enclosed entities

Kenric Nugteren преди 7 месеца
родител
ревизия
30e6d6a099
променени са 3 файла, в които са добавени 7 реда и са изтрити 6 реда
  1. 2 1
      InABox.Core/Classes/Script.cs
  2. 0 3
      InABox.Core/InABox.Core.csproj
  3. 5 2
      InABox.Core/Objects/Editors/Utils/EditorTypeUtils.cs

+ 2 - 1
InABox.Core/Classes/Script.cs

@@ -1,4 +1,5 @@
-using System.Linq;
+using System;
+using System.Linq;
 
 namespace InABox.Core
 {

+ 0 - 3
InABox.Core/InABox.Core.csproj

@@ -40,8 +40,5 @@
     <ItemGroup>
         <ProjectReference Include="..\inabox.logging.shared\InABox.Logging.Shared.csproj" />
     </ItemGroup>
-    <ItemGroup>
-      <Folder Include="Classes\" />
-    </ItemGroup>
 
 </Project>

+ 5 - 2
InABox.Core/Objects/Editors/Utils/EditorTypeUtils.cs

@@ -54,8 +54,11 @@ namespace InABox.Core
         {
             var attribute = prop.GetCustomAttributes<BaseEditor>(true).FirstOrDefault();
             var editor = attribute ?? GetEditor(prop.PropertyType);
-            if (editor != null && !prop.CanWrite)
-                editor.Editable = Editable.Hidden;
+            if (editor != null && !prop.CanWrite && !prop.PropertyType.HasInterface<ISubObject>())
+            {
+                editor = editor.CloneEditor();
+                editor.Editable = editor.Editable.Combine(Editable.Disabled);
+            }
             return editor;
         }