Beispiel #1
0
        private void OnSelectedFieldChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            btnMoveUp.Enabled   = false;
            btnMoveDown.Enabled = false;

            if (!e.IsSelected)
            {
                return;
            }
            if (CurrentField == null)
            {
                return;
            }
            _btnDeleteField.Enabled = CurrentField.UserCanDeleteOrModify;
            //(WS-364): this is too blunt. They should be able to edit the display name
            //    _fieldPropertyGrid.Enabled = CurrentField.UserCanDeleteOrModify;

            //    _fieldPropertyGrid.SelectedObject = CurrentField;
            _fieldSetupControl.CurrentField = CurrentField;

            btnMoveUp.Enabled = CurrentField.UserCanRelocate &&
                                !ViewTemplate.IsFieldFirstInClass(CurrentField);
            btnMoveDown.Enabled = CurrentField.UserCanRelocate &&
                                  !ViewTemplate.IsFieldLastInClass(CurrentField);
        }