namespace InABox.Core
{
    public enum Editable
    {
        Enabled,
        Disabled,
        Hidden,
        /// <summary>
        /// Disabled when using a DynamicGrid with DirectEdit option set, but enabled in editor
        /// </summary>
        DisabledOnDirectEdit
    }

    public static class EditableUtils
    {
        public static bool IsEditable(this Editable editable)
        {
            return editable == Editable.Enabled || editable == Editable.DisabledOnDirectEdit;
        }
        public static bool IsDirectEditable(this Editable editable)
        {
            return editable == Editable.Enabled;
        }

        public static bool ColumnVisible(this Editable editable)
        {
            return editable != Editable.Hidden;
        }

        public static bool EditorVisible(this Editable editable)
        {
            return editable != Editable.Hidden;
        }
    }
}