Ejemplo n.º 1
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="copyThis"></param>
        public Project(Project copyThis)
            : this()
        {
            if (copyThis == null)
            {
                return;
            }

            SourceFile = new FileReference(copyThis.SourceFile);

            TargetFiles.Clear();
            foreach (var item in copyThis.TargetFiles)
            {
                _TargetFiles.Add(item.Path, new FileReference(item));
            }
        }
Ejemplo n.º 2
0
        public EasyModeViewModel(IRegionManager regionManager)
        {
            runner         = Service.Provider.GetService <Runner>();
            _regionManager = regionManager;

            BackButtonCommand = new DelegateCommand(() =>
            {
                _regionManager.RequestNavigate(nameof(Region.MainRegion), nameof(Home));
            });
            UpButtonCommand = new DelegateCommand(() =>
            {
                if (SelectedIndex > 0)
                {
                    var selectedIndex = SelectedIndex;
                    var targetFile    = TargetFiles[selectedIndex];
                    TargetFiles.RemoveAt(selectedIndex);
                    TargetFiles.Insert(selectedIndex - 1, targetFile);
                }
            });
            DownButtonCommand = new DelegateCommand(() =>
            {
                if (0 <= SelectedIndex && SelectedIndex < TargetFiles.Count() - 1)
                {
                    var selectedIndex = SelectedIndex;
                    var targetFile    = TargetFiles[selectedIndex];
                    TargetFiles.RemoveAt(selectedIndex);
                    TargetFiles.Insert(selectedIndex + 1, targetFile);
                }
            });
            DeleteButtonCommand = new DelegateCommand(() =>
            {
                if (SelectedIndex >= 0 && TargetFiles.Count() > 0)
                {
                    TargetFiles.RemoveAt(SelectedIndex);
                }
            });
            ClearButtonCommand = new DelegateCommand(() => TargetFiles.Clear());
        }