소스 검색

Fixed small bug in SecurityAttribute and made it so that the Editable flag is an Editable, rather than a boolean

Kenric Nugteren 1 년 전
부모
커밋
ee4fd7ff9e
2개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 5
      InABox.Core/Editors/Utils/SecurityAttribute.cs
  2. 10 2
      inabox.wpf/DynamicGrid/DynamicEditorGrid.xaml.cs

+ 1 - 5
InABox.Core/Editors/Utils/SecurityAttribute.cs

@@ -14,11 +14,7 @@ namespace InABox.Core
         /// </summary>
         public bool Visible { get; set; } = false;
 
-        /// <summary>
-        /// If the user does not have the security token, this property will be <see cref="Editable.Editable"/> if <see langword="true"/>
-        /// or <see cref="Editable.Hidden"/> if <see langword="false"/>. The default is <see langword="false"/>.
-        /// </summary>
-        public bool Editable { get; set; } = false;
+        public Editable Editable { get; set; } = Editable.Hidden;
 
         private SecurityAttribute() { }
 

+ 10 - 2
inabox.wpf/DynamicGrid/DynamicEditorGrid.xaml.cs

@@ -601,11 +601,19 @@ namespace InABox.DynamicGrid
                             {
                                 editor.Visible = Visible.Hidden;
                             }
-                            if (!security.Editable)
+                            if(security.Editable == Editable.Hidden)
                             {
                                 editor.Editable = Editable.Hidden;
                             }
-                            break;
+                            else if(security.Editable == Editable.Disabled && editor.Editable == Editable.Enabled)
+                            {
+                                editor.Editable = Editable.Disabled;
+                            }
+                            if (editor.Visible == Visible.Hidden && editor.Editable == Editable.Hidden)
+                            {
+                                editor.Editable = Editable.Hidden;
+                                break;
+                            }
                         }
                     }
                 }