示例#1
0
        private void MachineProfiles_ProfileRemoved(object sender, MachineProfiles.IProfile profile)
        {
            MachineProfileViewModel vm = profileToViewModels[profile];

            profileViewModels.Remove(vm);
            profileToViewModels.Remove(profile);
        }
示例#2
0
        private void addProfile(MachineProfiles.IProfile profile)
        {
            MachineProfileViewModel vm = new MachineProfileViewModel(profile);

            profileViewModels.Add(vm);
            profileToViewModels.Add(profile, vm);
        }
示例#3
0
        private void _activateCommand_Execute(object parameter)
        {
            MachineProfileViewModel vm = parameter as MachineProfileViewModel;

            if (vm == null)
            {
                return;
            }
            Active = vm;
        }
示例#4
0
        private void _deleteCommand_Execute(object parameter)
        {
            MachineProfileViewModel vm = parameter as MachineProfileViewModel;

            if (vm == null || vm.Model == AppCore.MachineProfiles.Active)
            {
                return;
            }
            AppCore.MachineProfiles.RemoveProfile(vm.Model);
        }
示例#5
0
        private void _duplicateCommand_Execute(object parameter)
        {
            MachineProfileViewModel vm = parameter as MachineProfileViewModel;

            if (vm == null)
            {
                return;
            }
            AppCore.MachineProfiles.CreateProfile(
                vm.Model.FriendlyName + " (Duplicate)",
                vm.Model.TableSize,
                vm.Model.Origin,
                vm.Model.MaxFeedRate);
        }