Пример #1
0
 private void xQuit_Click(object sender, RoutedEventArgs e)
 {
     if (null != FinishInteraction)
     {
         FinishInteraction.Invoke();
     }
 }
        private void AcceptMakingRoiSubtractedRoi()
        {
            var subtractedRoiNames = new List <string>();

            foreach (var c in notification.ContouredStructureList)
            {
                if (c.IsSelected)
                {
                    subtractedRoiNames.Add(c.Name);
                }
            }

            notification.SubtractedRoiNames = subtractedRoiNames;

            if (string.IsNullOrEmpty(notification.StructureName))
            {
                if (notification.Margin == 0)
                {
                    notification.StructureName = $"z{notification.BaseStructureName}-{string.Join("-", notification.SubtractedRoiNames)}";
                }
                else
                {
                    notification.StructureName = $"z{notification.BaseStructureName}-{string.Join("-", notification.SubtractedRoiNames)}_{notification.Margin}";
                }
            }

            notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
Пример #3
0
        public EventEditorViewModel(IConfigService config)
        {
            ChannelOptions = config.Config.Channels;
            FinishCommand  = new DelegateCommand(() =>
            {
                if (notification is IConfirmation confirmation)
                {
                    confirmation.Confirmed = true;
                }
                notification.Content = CreateEvent();
                FinishInteraction?.Invoke();
            }, () => !HasErrors);
            CancelCommand = new DelegateCommand(() =>
            {
                if (notification is IConfirmation confirmation)
                {
                    confirmation.Confirmed = false;
                }
                FinishInteraction?.Invoke();
            });

            DeleteCommand = new DelegateCommand(() =>
            {
                if (notification is IConfirmation confirmation)
                {
                    confirmation.Confirmed = true;
                }
                notification.Content = null;
                FinishInteraction?.Invoke();
            }, () => CanDeleteEvent);

            Channel = ChannelOptions.FirstOrDefault()?.Name;

            Validate();
        }
Пример #4
0
        private void GetRandom()
        {
            var randomOption = new RandomSelectOption(Amount, RatingRange.IsEnabled, RatingRange.Low, RatingRange.Hi);

            Notification.Content = randomOption;
            FinishInteraction?.Invoke();
        }
 private void Accept()
 {
     if (_ps.ConfirmDistinct(FirstName, LastName))
     {
         _notification.FirstName = FirstName;
         _notification.LastName  = LastName;
         _notification.Confirmed = true;
         FinishInteraction?.Invoke();
     }
     else
     {
         if (ConfirmDuplicate())
         {
             _notification.FirstName = FirstName;
             _notification.LastName  = LastName;
             _notification.Confirmed = true;
             FinishInteraction?.Invoke();
         }
         else
         {
             FirstName = "";
             LastName  = "";
         }
     }
 }
        private void Initialize()
        {
            Title = CommonResourceManager.Instance.GetResourceString("Common_SiteSetup_Header");

            sites = new ObservableCollection <SiteSetupViewModel>();

            var allSites = EntityUtils.GetNetworkSites().SelectMany(x => x.Value);

            var settingsService = ServiceLocator.Current.GetInstance <ISettingsService>();

            settingsModel = settingsService.GetSettings();

            var siteModels = settingsModel.SiteSettings.SitesModelList.ToDictionary(x => x.PokerSite);

            var sitesToAdd = (from site in allSites
                              join validationResult in validationResults on site equals validationResult.PokerSite
                              where siteModels.ContainsKey(site)
                              select new SiteSetupViewModel(validationResult, siteModels[site])
            {
                Enabled = validationResult.IsDetected
            }).ToArray();

            sites.AddRange(sitesToAdd);

            ApplyCommand = ReactiveCommand.Create(() =>
            {
                settingsService.SaveSettings(settingsModel);
                FinishInteraction?.Invoke();
            });

            HelpCommand = ReactiveCommand.Create <SiteSetupViewModel>(x => OpenHelp(x));
        }
Пример #7
0
 private void CloseWin()
 {
     MessageBoxService.Confirm("请务必记录下助记词。是否确定关闭?", () =>
     {
         this._notification.Success = true;
         FinishInteraction?.Invoke();
     });
 }
Пример #8
0
        private void OKInteraction()
        {
            var notification = _notification as CameraCapturingNotification;

            notification.CapturingName = this.CapturingName.Value;
            _notification.Confirmed    = true;
            FinishInteraction?.Invoke();
        }
Пример #9
0
        private void Cancel(object sender, RoutedEventArgs e)
        {
            if (Notification is IConfirmation confirmation)
            {
                confirmation.Confirmed = false;
            }

            FinishInteraction?.Invoke();
        }
 private void CancelInteraction()
 {
     notification.StructureName      = null;
     notification.StructureType      = null;
     notification.Margin             = 0;
     notification.BaseStructureNames = null;
     notification.Confirmed          = false;
     FinishInteraction?.Invoke();
 }
 public virtual void Cancel()
 {
     ConfirmInteraction?.Invoke();
     if (m_Confirmation != null)
     {
         m_Confirmation.Confirmed = false;
     }
     FinishInteraction?.Invoke();
     OnClose?.Invoke();
 }
        private void OnCloseExecute()
        {
            if (Employee != null && Employee.Id > 0)
            {
                _employeeRepository.ReloadEmployee(Employee.Id);
            }

            _notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
Пример #13
0
        private void AcceptMakingWallRoi()
        {
            if (string.IsNullOrEmpty(notification.StructureName))
            {
                notification.StructureName = $"z{notification.BaseStructureName}_Wall";
            }

            notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
 public override void Confirm()
 {
     ConfirmInteraction?.Invoke();
     if (m_Confirmation != null)
     {
         m_Confirmation.Confirmed = true;
     }
     FinishInteraction?.Invoke();
     OnClose?.Invoke();
 }
        private void Cancel()
        {
            if (!licenseService.IsRegistered)
            {
                InitializeGreeting();
                return;
            }

            Callback?.Invoke();
            FinishInteraction?.Invoke();
        }
Пример #16
0
        private void OKInteraction()
        {
            ThreeDBuildingNotification notification = _notification as ThreeDBuildingNotification;

            notification.ThreeDDataFolderPath = ThreeDDataFolderPath.Value;
            notification.IsCutPetTable        = IsCutPetTable.Value;
            notification.IsSkipAlreadyBuilt   = IsSkipAlreadyBuilt.Value;

            _notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
Пример #17
0
        private void OnCloseExecute( )
        {
            if (Company != null && Company.Id > 0)
            {
                _companyRepository.ReloadCompany(Company.Id);
            }
            EmployeesOnAddedState.Clear();

            _notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
Пример #18
0
        private void Cancel()
        {
            if (!licenseService.IsRegistered)
            {
#if !DEBUG
                System.Windows.Application.Current.Shutdown();
#endif
                System.Windows.Application.Current.Shutdown();
            }

            FinishInteraction?.Invoke();
        }
Пример #19
0
        public AddEditNoteViewModel()
        {
            var canSave = this.WhenAny(x => x.Name, x => !string.IsNullOrWhiteSpace(x.Value));

            SaveCommand = ReactiveCommand.Create(() =>
            {
                OnSaveAction?.Invoke();
                FinishInteraction?.Invoke();
            }, canSave);

            CancelCommand = ReactiveCommand.Create(() => FinishInteraction?.Invoke());
        }
Пример #20
0
        private void Initialize()
        {
            Title = CommonResourceManager.Instance.GetResourceString("Common_SiteSetup_Header");

            sites = new ObservableCollection <SiteSetupViewModel>();

            var allSites = EntityUtils.GetNetworkSites().SelectMany(x => x.Value);

            var settingsService = ServiceLocator.Current.GetInstance <ISettingsService>();

            settingsModel = settingsService.GetSettings();

            var siteModels = settingsModel.SiteSettings.SitesModelList.ToDictionary(x => x.PokerSite);

            var sitesToAdd = (from site in allSites
                              join validationResult in validationResults on site equals validationResult.PokerSite
                              where siteModels.ContainsKey(site)
                              select new SiteSetupViewModel(validationResult, siteModels[site])
            {
                Enabled = validationResult.IsDetected
            }).ToArray();

            sites.AddRange(sitesToAdd);

            ApplyCommand = ReactiveCommand.Create(() =>
            {
                validationResults.ForEach(p =>
                {
                    if (siteModels.ContainsKey(p.PokerSite))
                    {
                        var siteModel = siteModels[p.PokerSite];

                        if (!siteModel.Configured)
                        {
                            if (siteModel.HandHistoryLocationList.Count == 0)
                            {
                                siteModel.HandHistoryLocationList = new ObservableCollection <string>(p.HandHistoryLocations);
                            }

                            siteModel.IsAutoCenter     = p.IsAutoCenter;
                            siteModel.FastPokerEnabled = p.FastPokerEnabled;

                            siteModel.Configured = true;
                        }
                    }
                });

                settingsService.SaveSettings(settingsModel);
                FinishInteraction?.Invoke();
            });
        }
Пример #21
0
        public YesNoConfirmationViewModel()
        {
            YesCommand = ReactiveCommand.Create(() =>
            {
                OnYesAction?.Invoke();
                FinishInteraction?.Invoke();
            });

            NoCommand = ReactiveCommand.Create(() =>
            {
                OnNoAction?.Invoke();
                FinishInteraction?.Invoke();
            });
        }
Пример #22
0
        /// <summary>
        /// Sends random song options or closes the view
        /// </summary>
        /// <param name="selectRandom"></param>
        private void OnRequestNavigate(object selectRandom)
        {
            var sr = Convert.ToBoolean(selectRandom);

            if (sr)
            {
                GetRandom();
            }
            else
            {
                Notification.Content = null;
                FinishInteraction?.Invoke();
            }
        }
        private void ConfirmCreate()
        {
            if (string.IsNullOrWhiteSpace((Notification as SupplierContactCreateUpdateNotif).NewContact.Name))
            {
                //MessageBox.Show("联系人为空");
                NotificationRequest.Raise(new Notification {
                    Content = "联系人姓名为空", Title = "错误提示"
                });
                return;
            }

            //_notification.NewContact = NewContact;
            _notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
        public SetFilterValueViewModel()
        {
            filtersDictionary = FiltersHelper.GetFiltersObjects().ToDictionary(x => x.Filter, x => x.Description);

            SaveCommand = ReactiveCommand.Create(() =>
            {
                OnSaveAction?.Invoke();
                FinishInteraction?.Invoke();
            });

            CancelCommand = ReactiveCommand.Create(() =>
            {
                OnCancelAction?.Invoke();
                FinishInteraction?.Invoke();
            });
        }
Пример #25
0
        void LoginInteraction(object obj)
        {
            // Since PasswordBox can not be bound, it gets it from an object
            string password = (obj as PasswordBox)?.Password;


            DataConnection conn = new DataConnection();

            conn.UserName = "******";


            _container.RegisterInstance <IDataConnection>(conn);


            _notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
Пример #26
0
        private void AcceptMakingRingRoi()
        {
            if (string.IsNullOrEmpty(notification.StructureName))
            {
                if (notification.InnerMargin == 0)
                {
                    notification.StructureName = $"zRing{notification.BaseStructureName}_{notification.OuterMargin}";
                }
                else
                {
                    notification.StructureName = $"zRing{notification.BaseStructureName}_{notification.OuterMargin}_{notification.InnerMargin}";
                }
            }

            notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }
 public PopupScanTrafficOrderViewModel()
 {
     TrafficOrderCommand = new DelegateCommand(() =>
     {
         if (string.IsNullOrEmpty(TrafficOrder))
         {//空字符串不处理
             return;
         }
         if (!DbHelper.CheckIsTrafficOrderExistInAwms(TrafficOrder))
         {
             string err = string.Format("发车明细表中不存在发货单号:{0}", TrafficOrder);
             MessageBox.Show(err, "无效发货单号", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         if (DbHelper.CheckIsTorderExistInTorderTable(TrafficOrder))
         {
             string err = string.Format("现有发货单中已存在发货单号:{0}", TrafficOrder);
             MessageBox.Show(err, "禁止重复添加", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         var torderNotification = ((INotificationTraffic)Notification);
         if (torderNotification.Items.Contains(TrafficOrder))
         {
             MessageBox.Show("已存在相同的发货单", "禁止重复添加", MessageBoxButton.OK, MessageBoxImage.Error);
             return;
         }
         torderNotification.Items.Add(TrafficOrder);
         TrafficOrder = "";
     });
     TrafficOrderStart = new DelegateCommand(() =>
     {
         _TrafficeNotification.Confirmed = true;
         if (null != FinishInteraction)
         {
             FinishInteraction.Invoke();
         }
     });
     Cancel = new DelegateCommand(() =>
     {
         _TrafficeNotification.Confirmed = false;
         if (null != FinishInteraction)
         {
             FinishInteraction.Invoke();
         }
     });
 }
Пример #28
0
        private void InitializeCommands()
        {
            AbortAssistantCommand = new DelegateCommand(() => { DialogResult = false; });

            NextCommand = new DelegateCommand(() =>
            {
                var importDialogMainRegion = RegionManager.Regions.FirstOrDefault(r => r.Name == RegionNames.ImportAssistantMain);
                if (importDialogMainRegion != null)
                {
                    var firstActiveView = importDialogMainRegion.ActiveViews.FirstOrDefault();
                    string viewType     = null;
                    if (firstActiveView is IImportStartView)
                    {
                        viewType = typeof(FileSelectionView).FullName;
                    }
                    else if (firstActiveView is FileSelectionView)
                    {
                        viewType = typeof(DataSelectionView).FullName;
                    }


                    if (string.IsNullOrEmpty(viewType) == false)
                    {
                        RegionManager?.RequestNavigate(RegionNames.ImportAssistantMain, viewType);
                    }
                }
            });

            PreviousCommand = new DelegateCommand(() =>
            {
                var importDialogMainRegion = RegionManager.Regions.FirstOrDefault(r => r.Name == RegionNames.ImportAssistantMain);
                if (importDialogMainRegion != null)
                {
                    var firstActiveView = importDialogMainRegion.ActiveViews.FirstOrDefault();
                }
            });

            FinishCommand = new DelegateCommand(() =>
            {
                DialogResult = true;
                FinishInteraction?.Invoke();
            });
        }
Пример #29
0
        private async void CommandInteractionUpdate_Execute()
        {
            var result = _notification.Mode == SingleUserViewModeEnum.Create ?
                         await CreateUser() :
                         await UpdateUser();

            if (string.IsNullOrEmpty(result))
            {
                _notification.Confirmed = false;
                FinishInteraction?.Invoke();
            }
            else if (result == "UpdateSuccess")
            {
                _notification.Confirmed = true;
                FinishInteraction?.Invoke();
            }
            else
            {
                MessageBoxShowOK(result);
            }
        }
Пример #30
0
        private void AcceptMakingOverlappedRoi()
        {
            var baseStructureNames = new List <string>();

            foreach (var c in notification.ContouredStructureList)
            {
                if (c.IsSelected)
                {
                    baseStructureNames.Add(c.Name);
                }
            }
            notification.BaseStructureNames = baseStructureNames;

            if (string.IsNullOrEmpty(notification.StructureName))
            {
                notification.StructureName = $"zOL_{string.Join("_",notification.BaseStructureNames)}_{notification.Margin}";
            }

            notification.Confirmed = true;
            FinishInteraction?.Invoke();
        }