Example #1
0
 public KneeBoardPositionChangeArgs(KneeBoardPosition position, string propertyName,
                                    object oldValue, object newValue)
 {
     _position = position;
     _property = propertyName;
     _oldValue = oldValue;
     _newValue = newValue;
 }
Example #2
0
        private void Add_Position_Click(object sender, RoutedEventArgs e)
        {
            KneeBoard page = Control as KneeBoard;

            if (page != null)
            {
                KneeBoardPosition position = new KneeBoardPosition(page, page.Positions.Count + 1, "{Helios}/Images/KneeBoards/default_kneeboard_image.png");
                page.Positions.Add(position);
                ConfigManager.UndoManager.AddUndoItem(new KneeBoardAddPositionUndoEvent(page, position));
            }
        }
Example #3
0
        private void DeletePosition_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            KneeBoard page = Control as KneeBoard;

            if (page != null && page.Positions.Contains((KneeBoardPosition)PositionList.SelectedItem))
            {
                KneeBoardPosition removedPosition = (KneeBoardPosition)PositionList.SelectedItem;
                int index = page.Positions.IndexOf(removedPosition);
                page.Positions.Remove(removedPosition);
                ConfigManager.UndoManager.AddUndoItem(new KneeBoardDeletePositionUndoEvent(page, removedPosition, index));
            }
        }
Example #4
0
        private void Delete_Position_Click(object sender, RoutedEventArgs e)
        {
            KneeBoard        page          = Control as KneeBoard;
            FrameworkElement senderControl = sender as FrameworkElement;

            if (senderControl != null && page != null)
            {
                KneeBoardPosition position = senderControl.Tag as KneeBoardPosition;
                if (position != null && page.Positions.Contains(position))
                {
                    page.Positions.Remove(position);
                }
            }
        }
Example #5
0
        private void UpdateValueHelp()
        {
            StringBuilder sb = new StringBuilder("");

            sb.Append(" (");
            for (int i = 0; i < Positions.Count; i++)
            {
                if (i > 0)
                {
                    sb.Append(",");
                }
                KneeBoardPosition position = Positions[i];
                sb.Append(i + 1);
                if (position.Name != null && position.Name.Length > 0)
                {
                    sb.Append("=");
                    sb.Append(position.Name);
                }
            }
            sb.Append(")");
            _positionValue.ValueDescription = sb.ToString();
        }