Beispiel #1
0
        public JsonResult DeleteTask(Int32[] idList)
        {
            DeleteTaskJsonModel deleteTaskJsonModel = new DeleteTaskJsonModel
            {
                StatusJson = false
            };

            if (idList != null && idList.Count() != 0)
            {
                deleteTaskJsonModel.StatusJson = _todoService.DeleteTask(idList);
            }

            return Json(deleteTaskJsonModel);
        }
        public SongLevel(BinaryReader br, int version)
        {
            Difficulty = br.ReadInt32();
            AnchorCount = br.ReadInt32();
            Anchors = new Anchor[AnchorCount];
            for (int i = 0; i < AnchorCount; ++i)
            {
                Anchors[i] = new Anchor(br);
            }

            SlideCount = br.ReadInt32();
            Slides = new Slide[SlideCount];
            for (int i = 0; i < SlideCount; ++i)
            {
                Slides[i] = new Slide(br);
            }

            HandShapeCount = br.ReadInt32();
            HandShapes = new HandShape[HandShapeCount];
            for (int i = 0; i < HandShapeCount; ++i)
            {
                HandShapes[i] = new HandShape(br);
            }

            NoteCount = br.ReadInt32();
            Notes = new Note[NoteCount];
            for (int i = 0; i < NoteCount; ++i)
            {
                Notes[i] = new Note(br, version);
            }

            PhraseCount = br.ReadInt32();
            AverageNotesPerPhrase = new float[PhraseCount];
            for (int i = 0; i < PhraseCount; ++i)
            {
                AverageNotesPerPhrase[i] = br.ReadSingle();
            }

            PhraseIterationCount = br.ReadInt32();
            NotesPerIteration1 = new Int32[PhraseIterationCount];
            for (int i = 0; i < NotesPerIteration1.Count(); ++i)
            {
                NotesPerIteration1[i] = br.ReadInt32();
            }

            PhraseIterationCount = br.ReadInt32();
            NotesPerIteration2 = new Int32[PhraseIterationCount];
            for (int i = 0; i < NotesPerIteration2.Count(); ++i)
            {
                NotesPerIteration2[i] = br.ReadInt32();
            }
        }
Beispiel #3
0
        public Boolean DeleteTask(Int32[] taskId)
        {
            if (taskId != null && taskId.Count() != 0)
            {
                IQueryable<Task> tasks = _taskRepository.GetList().Where(x => taskId.Any(a => a == x.TaskId));

                foreach (Task task in tasks)
                {
                    _taskRepository.Remove(task);
                }

                _taskRepository.Save();

                return true;
            }

            return false;
        }
Beispiel #4
0
 public void CountReturnsZeroWhenSourceIsEmptyAndPredicateIsUsed()
 {
     var source = new Int32[0];
     Assert.That(source.Count(i => i == 0), Is.EqualTo(0));
 }
Beispiel #5
0
 public void CountReturnsZeroWhenSourceIsEmpty()
 {
     var source = new Int32[0];
     Assert.That(source.Count(), Is.EqualTo(0));
 }