コード例 #1
0
        private bool IsComponentDirty(object component)
        {
            IBusinessObject bo     = GetBusinessObject(component);
            var             boProp = GetBOProp(bo);
            string          message;

            return(!this.IsReadOnly && bo.IsEditable(out message) & boProp.IsDirty);
        }
コード例 #2
0
        private void UpdateControlEnabledState()
        {
            IBusinessObject selectedBusinessObject        = CurrentBusinessObject ?? _newBO;
            bool            selectedBusinessObjectNotNull = (selectedBusinessObject != null);

            if (selectedBusinessObjectNotNull)
            {
                string message;
                bool   isEditable = selectedBusinessObject.IsEditable(out message);
                this.IBOEditorControl.Enabled = isEditable;
                _saveButton.Enabled           = isEditable;
                _cancelButton.Enabled         = selectedBusinessObject.Status.IsDirty;
                _deleteButton.Enabled         = !selectedBusinessObject.Status.IsNew;
            }
            else
            {
                _iboEditorControl.Enabled = false;
                _deleteButton.Enabled     = false;
                _cancelButton.Enabled     = false;
            }
            //_iboEditorControl.Enabled = selectedBusinessObjectNotNull;
        }