Example #1
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// CreateItem command
        /// </summary>
        //------------------------------------------------------------------------------------
        public override void CreateItem()
        {
            // Make sure we've got a selected item in the view, so we'll have a
            // default mentor item (if the user doesn't already have an item selected).
            if (ItemsView.CurrentItem == null)
            {
                ItemsView.MoveCurrentToFirst();
            }

            BacklogItem mentorBacklogItem = ItemsView.CurrentItem as BacklogItem;
            BacklogItem newItem           = HostItemStore.Instance.CreateStoreItem <BacklogItem>(ItemTypeID.BacklogItem);

            newItem.BeginSaveImmediate();
            newItem.ShipCycle    = Constants.OfficeCurrentShipCycle;
            newItem.BusinessRank = 9999;
            newItem.Title        = "New Backlog Item";

            // The mentor item is the item the user had selected when electing to create a new item.
            // We'll base the new item's basic properties on that of the mentor item.
            if (mentorBacklogItem != null)
            {
                newItem.ShipCycle        = mentorBacklogItem.ShipCycle;
                newItem.ParentPillarItem = mentorBacklogItem.ParentPillarItem;
                newItem.ParentTrainItem  = mentorBacklogItem.ParentTrainItem;
            }

            newItem.SaveImmediate();
            ItemsView.MoveCurrentTo(newItem);
        }
        private void MoveNext()
        {
            if (IsShuffle)
            {
                ItemsView.MoveCurrentToPosition(this.random.Next(0, ItemsView.Cast <Object>().Count()));
            }
            else
            {
                ItemsView.MoveCurrentToNext();

                if (ItemsView.IsCurrentAfterLast)
                {
                    ItemsView.MoveCurrentToFirst();
                }
            }
            ((IAudioListItemViewModel)ItemsView.CurrentItem).PlayCommand.Execute(null);
        }