Esempio n. 1
0
        private void RemoveFile(object sender, ValueEventArg <int> arg)
        {
            var index = arg.Value;

            if (index < 0 || index >= _model.Files.Count)
            {
                return;
            }

            _model.Files.RemoveAt(index);
            _view.SetFiles(_model.Files);
        }
Esempio n. 2
0
        private void FileUp(object sender, ValueEventArg <int> arg)
        {
            var index = arg.Value;

            if (index < 1 || index >= _model.Files.Count)
            {
                return;
            }

            var item = _model.Files[index];

            _model.Files[index]     = _model.Files[index - 1];
            _model.Files[index - 1] = item;

            _view.SetFiles(_model.Files);
            _view.Select(index - 1);
        }