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


C# IMessenger.Send方法代码示例

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


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

示例1: GroupedMoviesViewModel

		public GroupedMoviesViewModel(
			IMessenger messenger,
			IMovieRepository movieRepository)
		{
			MovieRepository = movieRepository;

			if (MovieRepository != null)
			{
				MovieGroups = MovieRepository.LoadMovies()
					.GroupBy(m => m.Genre)
					.Select(g => new MovieGroupViewModel(messenger)
					{
						Title = g.Key.ToString(),
						Movies = g.ToList(),
						GroupImageUrl = g.First().ImageUrl
					});
			}

			MovieTappedCommand = new RelayCommand<Movie>((movie) =>
				{
					var movieGroup = MovieGroups.First(mg => mg.Movies.Contains(movie));
					messenger.Send<MovieSelectedMessage>(new MovieSelectedMessage { Movie = movie, MovieGroup = movieGroup });
				});

			MovieSelectedCommand = new RelayCommand(() =>
				{
					var movieGroup = MovieGroups.First(mg => mg.Movies.Contains(SelectedMovie));
					messenger.Send<MovieSelectedMessage>(new MovieSelectedMessage { Movie = SelectedMovie, MovieGroup = movieGroup });
				});
		}
开发者ID:brentedwards,项目名称:Movies.WinRT,代码行数:30,代码来源:GroupedMoviesViewModel.cs

示例2: AgileBoardViewModel

        public AgileBoardViewModel(IJiraApi jiraApi,
           JiraSessionViewModel jiraSession,
           IMessenger messenger,
           IssuesStatisticsCalculator statisticsCalculator,
           RawAgileBoard board)
        {
            Board = board;

            _messenger = messenger;
            _jiraApi = jiraApi;
            _jiraSession = jiraSession;
            _statisticsCalculator = statisticsCalculator;

            PickUpSprintCommand = new RelayCommand(OpenPickUpSprint, () => Board.Type == "scrum");
            OpenPivotAnalysisCommand = new RelayCommand(() => _messenger.Send(new OpenPivotAnalysisMessage(BoardContent.Issues)));
            OpenEpicsOverviewCommand = new RelayCommand(() => _messenger.Send(new OpenEpicsOverviewMessage(BoardContent.Issues, BoardContent.Epics)), () => Board.Type == "scrum");
            BrowseIssuesCommand = new RelayCommand(() => _messenger.Send(new OpenIssuesBrowserMessage(BoardContent.Issues)));
            OpenGraveyardCommand = new RelayCommand(() => _messenger.Send(new OpenBoardGraveyardMessage(BoardContent.Issues)));
            OpenSprintsVelocityCommand = new RelayCommand(() => _messenger.Send(new OpenSprintsVelocityMessage(BoardContent)), () => Board.Type == "scrum");

            RefreshDataCommand = new RelayCommand(() =>
            {
                _forceReload = true;
                DownloadElements();
            }, () => IsBusy == false);
            FetchChangesCommand = new RelayCommand(() =>
            {
                DownloadElements();
            }, () => IsBusy == false);

            DownloadElements();
        }
开发者ID:sceeter89,项目名称:jira-client,代码行数:32,代码来源:AgileBoardViewModel.cs

示例3: MovieGroupViewModel

		public MovieGroupViewModel(IMessenger messenger)
		{
			SelectCommand = new RelayCommand(() =>
				{
					messenger.Send<GroupSelectedMessage>(new GroupSelectedMessage { GroupName = Title });
				});

			MovieTappedCommand = new RelayCommand<Movie>((movie) =>
				{
					messenger.Send<MovieSelectedMessage>(new MovieSelectedMessage { Movie = movie, MovieGroup = this });
				});
		}
开发者ID:brentedwards,项目名称:Movies.WinRT,代码行数:12,代码来源:MovieGroupViewModel.cs

示例4: MainViewModel

        public MainViewModel(IMessenger bus)
        {
            _bus = bus;

             AddCommand = new RelayCommand(() => _bus.Send(new AddPasswordEntryMessage()));
             BrowseCommand = new RelayCommand(() => _bus.Send(new OpenDirectoriesBrowserMessage()));
             SearchCommand = new RelayCommand(() => _bus.Send(new SearchForEntryMessage()));
             SettingsCommand = new RelayCommand(() => _bus.Send(new ShowSettingsMessage()));
             LockCommand = new RelayCommand(Lock);
             HelpCommand = new RelayCommand(() => _bus.Send(new ShowHelpMessage()));
             RateCommand = new RelayCommand(Rate);
        }
开发者ID:sceeter89,项目名称:password-generator,代码行数:12,代码来源:MainViewModel.cs

示例5: ListViewModel

        public ListViewModel(
            IToDoService toDoService, 
            IMessenger messenger, 
            IDispatcher dispatcher,
            ISearchService searchService,
            ISharingService sharingService
            )
        {
            _toDoService = toDoService;
            _searchService = searchService;
            _dispatcher = dispatcher;
            _messenger = messenger;
            _sharingService = sharingService;

            Items = new ObservableCollection<ToDoItem>();
            SearchResult = new ObservableCollection<ToDoItem>();

            RegisterSubscriptions();
            SetupCommands();
            
            Items.CollectionChanged += (s, c) =>
            {
                var count = Items.Count;
                Count = count;
                messenger.Send(new ItemCountChanged { Count = count });
            };
            PopulateItems();
        }
开发者ID:dolittle,项目名称:Toodeloo,代码行数:28,代码来源:ListViewModel.cs

示例6: SprintDetailsViewModel

        public SprintDetailsViewModel(RawAgileSprint sprint,
         IList<JiraIssue> issues,
         IMessenger messenger,
         IssuesStatisticsCalculator statisticsCalculator)
        {
            Sprint = sprint;
            Issues = issues;

            _messenger = messenger;
            _statisticsCalculator = statisticsCalculator;

            ScrumCardsCommand = new RelayCommand(() => _messenger.Send(new OpenScrumCardsMessage(Issues)));
            BurnDownCommand = new RelayCommand(() => _messenger.Send(new OpenBurnDownMessage(Sprint, Issues)));
            EngagementCommand = new RelayCommand(() => _messenger.Send(new OpenEngagementChartMessage(Issues)));
            BrowseIssuesCommand = new RelayCommand(() => _messenger.Send(new OpenIssuesBrowserMessage(Issues)));

            GatherStatistics();
        }
开发者ID:sceeter89,项目名称:jira-client,代码行数:18,代码来源:SprintDetailsViewModel.cs

示例7: AgileBoardSelectViewModel

        public AgileBoardSelectViewModel(IMessenger messenger, AssistantSettings settings, IJiraApi jiraApi)
        {
            _messenger = messenger;
            _jiraApi = jiraApi;
            _settings = settings;

            Boards = new ObservableCollection<RawAgileBoard>();
            RecentBoards = new ObservableCollection<RawAgileBoard>();
            OpenBoardCommand = new RelayCommand<RawAgileBoard>(OpenBoard);
            OpenSettingsCommand = new RelayCommand(() => _messenger.Send(new OpenSettingsMessage()));
        }
开发者ID:sceeter89,项目名称:jira-client,代码行数:11,代码来源:AgileBoardSelectViewModel.cs

示例8: BoardGraveyardViewModel

      public BoardGraveyardViewModel(IList<JiraIssue> issues,
         IMessenger messenger,
         AssistantSettings appSettings,
         GraveyardSettings graveyardSettings)
      {
         Issues = issues;
         _messenger = messenger;
         _graveyardSettings = graveyardSettings;
         _graveyardSettings.PropertyChanged += (sender, args) => _reloadNeeded = true;
         _appSettings = appSettings;

         OpenDetailsCommand = new RelayCommand<JiraIssue>(issue => _messenger.Send(new OpenIssueDetailsMessage(issue)));
         OpenInBrowserCommand = new RelayCommand<JiraIssue>(issue => Process.Start(string.Format("{0}/browse/{1}", _appSettings.JiraUrl, issue.Key)));

         OldCreated = new ObservableCollection<JiraIssue>();
         ArchaicCreated = new ObservableCollection<JiraIssue>();
         OldUpdated = new ObservableCollection<JiraIssue>();
         InactiveAssignee = new ObservableCollection<JiraIssue>();
         MissingDescription = new ObservableCollection<JiraIssue>();
      }
开发者ID:sceeter89,项目名称:jira-client,代码行数:20,代码来源:BoardGraveyardViewModel.cs

示例9: DetailsViewModel

        public DetailsViewModel(IMessenger messenger)
        {
            _messenger = messenger;
             if (IsInDesignMode)
             {
            Entry = new PasswordEntry
            {
               Domain = "company.com",
               PasswordLength = 15,
               Tag = "Some tag",
               TagAsCurrentMonth = false,
               UseCapitalLetters = true,
               UseDigits = true,
               UseSpecialCharacters = false,
               Username = "username"
            };
             }

             GenerateCommand = new RelayCommand(Generate);
             EditCommand = new RelayCommand(() => _messenger.Send(new EditEntryMessage(Entry)));
             DeleteCommand = new RelayCommand(Delete);
        }
开发者ID:sceeter89,项目名称:password-generator,代码行数:22,代码来源:DetailsViewModel.cs

示例10: UserPasswordChange

        public static bool UserPasswordChange(string newPassword, string confirmPassword, IMessenger messenger)
        {
            if (!newPassword.Equals(confirmPassword))
            {
                throw new Csla.Rules.ValidationException("New password and confirmation password must be the same.");
            }

            var user = User.FetchUser(
                new UserCriteria
                    {
                        UserId = BusinessPrincipal.GetCurrentIdentity().UserId
                    });

            if (user != null)
            {
                var password = newPassword;

                user.SetPassword(password);

                user = user.Save();

                if (messenger == null)
                {
                    messenger = MessageHelper.InitializeMessageForUserPasswordChange(user.Email);
                }

                messenger.Message = messenger.Message.Replace(MessageParameter.Password, password);

                messenger.Send();
            }
            else
            {
                throw new ArgumentException("No such user exists.");
            }

            return true;
        }
开发者ID:WhiteIsland,项目名称:epiworx,代码行数:37,代码来源:UserPasswordService.cs

示例11: UserPasswordReset

        public static UserPassword UserPasswordReset(string name, out string password, IMessenger messenger)
        {
            var user = UserPassword.FetchUserPassword(
                new UserPasswordCriteria
                    {
                        Name = name
                    });

            if (user != null)
            {
                password = PasswordHelper.GetRandomPassword(10);

                user.SetPassword(password);

                user = user.Save();

                if (messenger == null)
                {
                    messenger = MessageHelper.InitializeMessageForUserPasswordReset(user.Email);
                }

                messenger.Message = messenger.Message.Replace(MessageParameter.Password, password);

                messenger.Send();
            }
            else
            {
                throw new ArgumentException("No such user exists.");
            }

            return user;
        }
开发者ID:WhiteIsland,项目名称:epiworx,代码行数:32,代码来源:UserPasswordService.cs

示例12: OptionsViewModel

        /// <summary>
        /// Initializes a new instance of the OptionsViewModel class.
        /// </summary>
        public OptionsViewModel(IMessenger msngr)
        {
            MessengerInstance = msngr;
            SaveOptions = new RelayCommand(
                () =>
                {
                    if (UserOptions != null && Options != null)
                    {
                        if (SelectedCP != null)
                        {
                            if (Options.CurrentConnection != SelectedCP)
                            {
                                Options.CurrentConnection = SelectedCP;
                                MessengerInstance.Send<ExecuteAction>(Action.DisconnectRepositories);
                                MessengerInstance.Send<NavigateToPage>(Page.Connections);
                            }

                        }
                        UserOptions.setOptions(Options);
                    }
                },
                () =>
                {
                    return Options.Error == null;
                });
        }
开发者ID:rollingthunder,项目名称:Diversity-Synchronization,代码行数:29,代码来源:OptionsViewModel.cs

示例13: MainViewModel

        public MainViewModel(IMessenger messenger)
        {
            _messenger = messenger;

            _messenger.Send(new LoginMessage());
        }
开发者ID:korchakmv,项目名称:warehouse,代码行数:6,代码来源:MainViewModel.cs


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