示例#1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>La liste des controls éditables</returns>
        public List <object> getEditableControls()
        {
            List <object> controls = new List <object>(0);

            controls.AddRange(TablePropertiesPanel.getEditableControls());
            controls.AddRange(TableCellParameterPanel.getEditableControls());
            controls.AddRange(AllocationPropertiesPanel.getEditableControls());
            if (this.SpreadSheet != null)
            {
                controls.Add(this.SpreadSheet);
            }
            return(controls);
        }
示例#2
0
 public virtual void SetReadOnly(bool readOnly)
 {
     this.IsReadOnly = readOnly;
     if (TablePropertiesPanel != null)
     {
         TablePropertiesPanel.SetReadOnly(readOnly);
     }
     if (TableCellParameterPanel != null)
     {
         TableCellParameterPanel.SetReadOnly(readOnly);
     }
     if (AllocationPropertiesPanel != null)
     {
         AllocationPropertiesPanel.SetReadOnly(readOnly);
     }
     if (SpreadSheet != null)
     {
         SpreadSheet.SetReadOnly(readOnly);
     }
 }
示例#3
0
        /// <summary>
        /// Customize for connected user
        /// </summary>
        /// <param name="rights"></param>
        /// <param name="readOnly"></param>
        public virtual void Customize(List <Kernel.Domain.Right> rights, bool readOnly = false)
        {
            bool edit           = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT, rights);
            bool editCell       = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT_CELL, rights);
            bool editAllocation = RightsUtil.HasRight(Kernel.Domain.RightType.EDIT_ALLOCATION, rights);

            if (TablePropertiesPanel != null)
            {
                TablePropertiesPanel.SetReadOnly(readOnly || !edit);
            }
            if (TableCellParameterPanel != null)
            {
                TableCellParameterPanel.SetReadOnly(readOnly || !editCell);
            }
            if (AllocationPropertiesPanel != null)
            {
                AllocationPropertiesPanel.SetReadOnly(readOnly || !editAllocation);
            }
            if (SpreadSheet != null)
            {
                SpreadSheet.SetReadOnly(readOnly || !edit);
            }
        }