示例#1
0
        /// <summary>
        /// Executes the create example command.
        /// </summary>
        private void ExecuteCreateExampleCommand()
        {
            var newExampleRow = new PrimitiveRow <string>
            {
                Index = this.Example.Count + 1,
                Value = string.Format("Example{0}", this.Example.Count + 1)
            };

            this.Example.Add(newExampleRow);

            // select in grid
            this.SelectedExample = newExampleRow;
        }
示例#2
0
        /// <summary>
        /// Executes the create note command.
        /// </summary>
        private void ExecuteCreateNoteCommand()
        {
            var newNoteRow = new PrimitiveRow <string>
            {
                Index = this.Note.Count + 1,
                Value = string.Format("Note{0}", this.Note.Count + 1)
            };

            this.Note.Add(newNoteRow);

            // select in grid
            this.SelectedNote = newNoteRow;
        }
示例#3
0
        public void VerifyThatPropertiesAreSetForPrimitiveRowOfTypeObject()
        {
            var stringPrimitiveRow = new PrimitiveRow <object>();

            var index = 1;
            var value = new object();

            stringPrimitiveRow.Index = index;
            stringPrimitiveRow.Value = value;

            Assert.AreEqual(index, stringPrimitiveRow.Index);
            Assert.AreEqual(value, stringPrimitiveRow.Value);
        }
示例#4
0
        /// <summary>
        /// Execute the "Move Down" Command which puts a selected item one level down
        /// </summary>
        /// <param name="orderedList">
        /// The list of ordered rows
        /// </param>
        /// <param name="selectedItem">
        /// the row to move
        /// </param>
        protected void ExecuteMoveDownCommand(ReactiveList <PrimitiveRow <string> > orderedList, PrimitiveRow <string> selectedItem)
        {
            var selectedIndex = orderedList.IndexOf(selectedItem);

            if (selectedIndex == orderedList.Count - 1)
            {
                return;
            }

            orderedList.Move(selectedIndex, selectedIndex + 1);
        }
示例#5
0
        /// <summary>
        /// Execute the "Move Up" Command which puts a selected item one level up
        /// </summary>
        /// <param name="orderedList">
        /// The list of ordered rows
        /// </param>
        /// <param name="selectedItem">
        /// the row to move
        /// </param>
        private void ExecuteMoveUpCommand(ReactiveList <PrimitiveRow <string> > orderedList, PrimitiveRow <string> selectedItem)
        {
            var selectedIndex = orderedList.IndexOf(selectedItem);

            if (selectedIndex == 0)
            {
                return;
            }

            orderedList.Move(selectedIndex, selectedIndex - 1);
        }