Ver código fonte

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

Kenric Nugteren 1 ano atrás
pai
commit
ee4fd7ff9e

+ 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;
+                            }
                         }
                     }
                 }