当前位置: 首页>>代码示例>>C#>>正文


C# CaptionCommand.Execute方法代码示例

本文整理汇总了C#中CaptionCommand.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# CaptionCommand.Execute方法的具体用法?C# CaptionCommand.Execute怎么用?C# CaptionCommand.Execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CaptionCommand的用法示例。


在下文中一共展示了CaptionCommand.Execute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TicketListViewModel

        public TicketListViewModel()
        {
            _timer = new Timer(OnTimer, null, Timeout.Infinite, 1000);
            _selectedTicketItems = new ObservableCollection<TicketItemViewModel>();

            PrintJobCommand = new CaptionCommand<PrintJob>(Resources.Print, OnPrintJobExecute, CanExecutePrintJob);

            AddMenuItemCommand = new DelegateCommand<ScreenMenuItemData>(OnAddMenuItemCommandExecute);
            CloseTicketCommand = new CaptionCommand<string>(Resources.CloseTicket_r, OnCloseTicketExecute, CanCloseTicket);
            OpenTicketCommand = new DelegateCommand<int?>(OnOpenTicketExecute);
            MakePaymentCommand = new CaptionCommand<string>(Resources.GetPayment, OnMakePaymentExecute, CanMakePayment);
            MakeCashPaymentCommand = new CaptionCommand<string>(Resources.CashPayment_r, OnMakeCashPaymentExecute, CanMakeFastPayment);
            MakeCreditCardPaymentCommand = new CaptionCommand<string>(Resources.CreditCard_r, OnMakeCreditCardPaymentExecute, CanMakeFastPayment);
            MakeTicketPaymentCommand = new CaptionCommand<string>(Resources.Voucher_r, OnMakeTicketPaymentExecute, CanMakeFastPayment);
            SelectTableCommand = new CaptionCommand<string>(Resources.SelectTable, OnSelectTableExecute, CanSelectTable);
            SelectCustomerCommand = new CaptionCommand<string>(Resources.SelectCustomer, OnSelectCustomerExecute, CanSelectCustomer);
            ShowAllOpenTickets = new CaptionCommand<string>(Resources.AllTickets_r, OnShowAllOpenTickets);
            NewTicketCommand = new CaptionCommand<string>(Resources.Ticket, OnCreateNewTicket,CanCreateNewTicket);
            FilterOpenTicketsCommand = new DelegateCommand<TicketTagFilterViewModel>(OnFilterOpenTicketsExecute);

            IncQuantityCommand = new CaptionCommand<string>("+", OnIncQuantityCommand, CanIncQuantity);
            DecQuantityCommand = new CaptionCommand<string>("-", OnDecQuantityCommand, CanDecQuantity);
            IncSelectionQuantityCommand = new CaptionCommand<string>("(+)", OnIncSelectionQuantityCommand, CanIncSelectionQuantity);
            DecSelectionQuantityCommand = new CaptionCommand<string>("(-)", OnDecSelectionQuantityCommand, CanDecSelectionQuantity);
            ShowVoidReasonsCommand = new CaptionCommand<string>(Resources.Void, OnShowVoidReasonsExecuted, CanVoidSelectedItems);
            ShowGiftReasonsCommand = new CaptionCommand<string>(Resources.Gift, OnShowGiftReasonsExecuted, CanGiftSelectedItems);
            ShowTicketTagsCommand = new CaptionCommand<TicketTagGroup>(Resources.Tag, OnShowTicketsTagExecute, CanExecuteShowTicketTags);
            CancelItemCommand = new CaptionCommand<string>(Resources.Cancel, OnCancelItemCommand, CanCancelSelectedItems);
            MoveTicketItemsCommand = new CaptionCommand<string>(Resources.MoveTicketLine, OnMoveTicketItems, CanMoveTicketItems);
            ShowExtraPropertyEditorCommand = new CaptionCommand<string>(Resources.ExtraModifier, OnShowExtraProperty, CanShowExtraProperty);
            EditTicketNoteCommand = new CaptionCommand<string>(Resources.TicketNote, OnEditTicketNote, CanEditTicketNote);
            RemoveTicketLockCommand = new CaptionCommand<string>(Resources.ReleaseLock, OnRemoveTicketLock, CanRemoveTicketLock);
            ChangePriceCommand = new CaptionCommand<string>(Resources.ChangePrice, OnChangePrice, CanChangePrice);

            EventServiceFactory.EventService.GetEvent<GenericEvent<LocationData>>().Subscribe(
                x =>
                {
                    if (x.Topic == EventTopicNames.LocationSelectedForTicket)
                    {
                        if (SelectedTicket != null)
                        {
                            var oldLocationName = SelectedTicket.Location;
                            var ticketsMerged = x.Value.TicketId > 0 && x.Value.TicketId != SelectedTicket.Id;
                        //    TicketViewModel.AssignTableToSelectedTicket(x.Value.LocationId);

                            CloseTicket();

                            if (!AppServices.CurrentTerminal.AutoLogout)
                                EventServiceFactory.EventService.PublishEvent(EventTopicNames.ActivateTicketView);

                            if (!string.IsNullOrEmpty(oldLocationName) || ticketsMerged)
                                if (ticketsMerged && !string.IsNullOrEmpty(oldLocationName))
                                    InteractionService.UserIntraction.GiveFeedback(string.Format(Resources.TablesMerged_f, oldLocationName, x.Value.Caption));
                                else if (ticketsMerged)
                                    InteractionService.UserIntraction.GiveFeedback(string.Format(Resources.TicketMergedToTable_f, x.Value.Caption));
                                else if (oldLocationName != x.Value.LocationName)
                                    InteractionService.UserIntraction.GiveFeedback(string.Format(Resources.TicketMovedToTable_f, oldLocationName, x.Value.Caption));
                        }
                        else
                        {
                            if (x.Value.TicketId == 0)
                            {
                                TicketViewModel.CreateNewTicket();
                      //          TicketViewModel.AssignTableToSelectedTicket(x.Value.LocationId);
                            }
                            else
                            {
                                AppServices.MainDataContext.OpenTicket(x.Value.TicketId);

                            }
                            EventServiceFactory.EventService.PublishEvent(EventTopicNames.DisplayTicketView);
                        }
                    }

                }
                );

            EventServiceFactory.EventService.GetEvent<GenericEvent<WorkPeriod>>().Subscribe(
                x =>
                {
                    if (x.Topic == EventTopicNames.WorkPeriodStatusChanged)
                    {
                        RaisePropertyChanged("CanChangeDepartment");
                    }
                });

            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketItemViewModel>>().Subscribe(
                x =>
                {
                    if (SelectedTicket != null && x.Topic == EventTopicNames.SelectedItemsChanged)
                    {
                        LastSelectedTicketItem = x.Value.Selected ? x.Value : null;
                        foreach (var item in SelectedTicket.SelectedItems)
                        { item.IsLastSelected = item == LastSelectedTicketItem; }

                        SelectedTicket.PublishEvent(EventTopicNames.SelectedItemsChanged);
                    }
                });

            EventServiceFactory.EventService.GetEvent<GenericEvent<TicketTagData>>().Subscribe(
//.........这里部分代码省略.........
开发者ID:basio,项目名称:veropos,代码行数:101,代码来源:TicketListViewModel.cs


注:本文中的CaptionCommand.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。