コード例 #1
0
 public void DeleteSelectedValue()
 {
     if (SelectedAttributeChoice != null)
     {
         _iKeyManager.Delete(SelectedAttributeChoice);
         AttributeChoices.Remove(SelectedAttributeChoice);
         AssignPositions();
     }
 }
コード例 #2
0
 public void Save()
 {
     _attribute.description = Text;
     if (_attribute.id == 0)
     {
         _attribute.key_id = _key.id;
         _iKeyManager.Insert(_attribute, AttributeChoices.ToList());
     }
     else
     {
         _iKeyManager.Update(_attribute, AttributeChoices.ToList());
     }
 }
コード例 #3
0
        public void Add(Library.DBObject.AttributeChoice attributeValue)
        {
            int index = SelectedAttributeChoice != null ? SelectedAttributeChoice.position : 0;

            if (index < AttributeChoices.Count)
            {
                ++index;
            }
            _iKeyManager.Insert(attributeValue);
            AttributeChoices.Insert(index, attributeValue);
            AssignPositions();
            SelectedAttributeChoice = AttributeChoices[index];
        }
コード例 #4
0
        public void MoveSelectedAttributeDown()
        {
            if (!CanMoveValueDown)
            {
                return;
            }

            int index = AttributeChoices.IndexOf(SelectedAttributeChoice);

            AttributeChoices[index].position     = (short)(index + 1);
            AttributeChoices[index + 1].position = (short)index;
            _iKeyManager.Update(AttributeChoices[index]);
            _iKeyManager.Update(AttributeChoices[index + 1]);
            AttributeChoices        = new ObservableCollection <Library.DBObject.AttributeChoice>(AttributeChoices.OrderBy(n => n.position));
            SelectedAttributeChoice = AttributeChoices[index + 1];
        }
コード例 #5
0
        public void Refresh()
        {
            int index = (SelectedAttributeChoice != null) ? SelectedAttributeChoice.position : -1;

            AttributeChoices = new ObservableCollection <Library.DBObject.AttributeChoice>(AttributeChoices.OrderBy(n => n.position));
            if (index != -1)
            {
                SelectedAttributeChoice = AttributeChoices[index];
            }
        }