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


C# GenericMessage类代码示例

本文整理汇总了C#中GenericMessage的典型用法代码示例。如果您正苦于以下问题:C# GenericMessage类的具体用法?C# GenericMessage怎么用?C# GenericMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: VariablesAction

        private void VariablesAction()
        {
            var message = new GenericMessage<BrickCategory>(BrickCategory.Variables);
            Messenger.Default.Send(message, ViewModelMessagingToken.ScriptBrickCategoryListener);

            ServiceLocator.NavigationService.NavigateTo<AddNewScriptBrickViewModel>();
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:7,代码来源:ScriptBrickCategoryViewModel.cs

示例2: CommandSelectParameterRelease

 private void CommandSelectParameterRelease(Y_NORM_PARAMETERS param)
 {
     var message = new GenericMessage<MessageArgsParameterCallback>(this, _cellViewModel,
                                                                          new MessageArgsParameterCallback { Parameter = param });
     Messenger.Default.Send(message);
     Messenger.Default.Send(new NotificationMessage("CloseEditParameter"));
 }
开发者ID:AntonLapshin,项目名称:hcprojects,代码行数:7,代码来源:ParametersViewModel.cs

示例3: Initialize

        public static async Task Initialize()
        {
            if (_context != null)
                return;

            //_app.InitializeInterfaces();
            //((ViewModelLocator)ServiceLocator.ViewModelLocator).RegisterViewModels();
            ServiceLocator.ViewModelLocator.RaiseAppPropertiesChanged();

            InitializeSaveHandler();

            if (ViewModelBase.IsInDesignModeStatic)
            {
                var context = new CatrobatContextDesign();

                var messageContext = new GenericMessage<CatrobatContextBase>(context);
                Messenger.Default.Send(messageContext, ViewModelMessagingToken.ContextListener);

                var messageCurrentSprite = new GenericMessage<Sprite>(context.CurrentProject.Sprites[0]);
                Messenger.Default.Send(messageCurrentSprite, ViewModelMessagingToken.CurrentSpriteChangedListener);
            }
            else
            {
                await LoadContext();
            }
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:26,代码来源:App.cs

示例4: ReceivedId

        private void ReceivedId(GenericMessage<string> msg)
        {
            if (Album != null && msg.Content == Album.Id) return;

            Album = null;
            Tracks = null;
            LoadData(msg.Content);
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:8,代码来源:SpotifyAlbumViewModel.cs

示例5: ReceivedId

        private void ReceivedId(GenericMessage<LastAlbum> msg)
        {
            if (Album != null && msg.Content.Name == Album.Name) return;

            Album = null;
            Tracks = null;
            LoadData(msg.Content);
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:8,代码来源:AlbumViewModel.cs

示例6: MessageParameterHandler

 private void MessageParameterHandler(GenericMessage<MessageArgsParameter> message)
 {
     _cellViewModel = message.Sender as CellViewModel;
     Parameters = GenericRepository.GetAllList<Y_NORM_PARAMETERS>();
     foreach (var param in message.Content.Parameters)
     {
         Parameters.Remove(param);
     }
 }
开发者ID:AntonLapshin,项目名称:hcprojects,代码行数:9,代码来源:ParametersViewModel.cs

示例7: GenericMessage

        /// <summary>
        /// Returns a generic message view.
        /// </summary>
        /// <param name="message"></param>
        /// <param name="url"></param>
        /// <returns></returns>
        public ActionResult GenericMessage(string message, string url)
        {
            var gm = new GenericMessage()
            {
                Message = message,
                URL = url
            };

            return View("GenericMessage", gm);
        }
开发者ID:friedr1c3,项目名称:simple-faq,代码行数:16,代码来源:BaseController.cs

示例8: HandleMainNavigationMessage

 private void HandleMainNavigationMessage(GenericMessage<string> message)
 {
     switch (message.Content)
     {
         case MainNavigation.MAIN_MENU:
             MainContent.Content = null;
             MainMenu.Visibility = Visibility.Visible;
             break;
     }
 }
开发者ID:amertlich,项目名称:CS5700,代码行数:10,代码来源:MainWindow.xaml.cs

示例9: NavigatedTo

        public override void NavigatedTo(NavigationMode mode, object parameter)
        {
            base.NavigatedTo(mode, parameter);
            var album = parameter as string;

            if (album == null) return;

            var msg = new GenericMessage<string>(album);
            Messenger.Default.Send(msg, "spotify-album-detail");
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:10,代码来源:SpotifyAlbumPage.xaml.cs

示例10: NavigatedTo

        public override void NavigatedTo(NavigationMode mode, object parameter)
        {
            base.NavigatedTo(mode, parameter);

            var album = parameter as LastAlbum;

            if (album == null || mode == NavigationMode.Back) return;

            var msg = new GenericMessage<LastAlbum>(album);
            Messenger.Default.Send(msg, "album-detail");
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:11,代码来源:AlbumPage.xaml.cs

示例11: InitializeInterfaces

        public void InitializeInterfaces()
        {
            if(ViewModelBase.IsInDesignModeStatic)
                ServiceLocator.Register(new DispatcherServiceWindowsShared(null));

            ServiceLocator.Register<NavigationServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<SystemInformationServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<CultureServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ImageResizeServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<PlayerLauncherServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ResourceLoaderWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<StorageFactoryWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ImageSourceConversionServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<SoundRecorderServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<PictureServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<NotificationServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ColorConversionServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ShareServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<PortableUIElementsConvertionServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<SoundServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ActionTemplateServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<SensorServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<WebCommunicationServiceWindowsShared>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ZipService>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ProgramImportService>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ContextService>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ProgramExportService>(TypeCreationMode.Lazy);
            ServiceLocator.Register<ProgramValidationService>(TypeCreationMode.Lazy);
            ServiceLocator.Register<TraceService>(TypeCreationMode.Lazy);

            ServiceLocator.ViewModelLocator = new ViewModelLocator();
            ServiceLocator.ViewModelLocator.RegisterViewModels();

            ServiceLocator.ThemeChooser = new ThemeChooser();
            ServiceLocator.LocalizedStrings = new LocalizedStrings();

            Application.Current.Resources["Locator"] = ServiceLocator.ViewModelLocator;
            Application.Current.Resources["ThemeChooser"] = ServiceLocator.ThemeChooser;
            Application.Current.Resources["LocalizedStrings"] = ServiceLocator.LocalizedStrings;

            if (!ViewModelBase.IsInDesignModeStatic)
                InitPresenters();

            if (ViewModelBase.IsInDesignModeStatic)
            {
                Task.Run(async () =>
                {
                    var defaultProject = await new ProgramGeneratorWhackAMole().GenerateProgram("WhackAMole", false);
                    var projectChangedMessage = new GenericMessage<Core.Models.Program>(defaultProject);
                    Messenger.Default.Send(projectChangedMessage, ViewModelMessagingToken.CurrentProgramChangedListener);
                });
            }
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:53,代码来源:AppWindowsShared.cs

示例12: LaunchPlayer

        public async Task LaunchPlayer(string programName, bool isLaunchedFromTile)
        {
            var messageProjectName = new GenericMessage<string>(programName);
            Messenger.Default.Send(messageProjectName, 
                                   ViewModelMessagingToken.PlayerProgramNameListener);

            var messageIsStartFromTile = new GenericMessage<bool>(isLaunchedFromTile);
            Messenger.Default.Send(messageIsStartFromTile, 
                                   ViewModelMessagingToken.PlayerIsStartFromTileListener);

            Window.Current.Content = pageFrame;
            ServiceLocator.NavigationService.NavigateTo<PlayerViewModel>();
        }
开发者ID:Catrobat,项目名称:CatrobatForWindows,代码行数:13,代码来源:PlayerLauncherServiceWindowsShared.cs

示例13: HandleLightboxNavigationMessage

 private void HandleLightboxNavigationMessage(GenericMessage<string> message)
 {
     switch (message.Content)
     {
         case LightboxNavigation.SELECT_RACE:
             LightboxContent.Content = new SelectRaceView();
             LightboxContent.Visibility = Visibility.Visible;
             break;
         case LightboxNavigation.CLOSE_Lightbox:
             LightboxContent.Visibility = Visibility.Collapsed;
             break;
     }
 }
开发者ID:amertlich,项目名称:CS5700,代码行数:13,代码来源:MainWindow.xaml.cs

示例14: NavigatedTo

        public override void NavigatedTo(NavigationMode mode, object parameter)
        {
            base.NavigatedTo(mode, parameter);
            var name = parameter as string;

            if (name == null || mode == NavigationMode.Back)
            {
                return;
            }

            var msg = new GenericMessage<string>(name);
            Messenger.Default.Send(msg, "artist-detail-name");
        }
开发者ID:jayharry28,项目名称:Audiotica,代码行数:13,代码来源:ArtistPage.xaml.cs

示例15: StreamingFriends

 private async void StreamingFriends(GenericMessage<TwitterIdCollection> o)
 {
   List<long> userstoadd = new List<long>();
   if (o.Content == null || o.Content.Count <= 0)
     return;
   foreach (KeyValuePair<string, CacheUser> keyValuePair in Enumerable.ToArray<KeyValuePair<string, CacheUser>>((IEnumerable<KeyValuePair<string, CacheUser>>) this.CachedUsers))
   {
     KeyValuePair<string, CacheUser> cacheuser = keyValuePair;
     if (Enumerable.Count<long>(Enumerable.Where<long>((IEnumerable<long>) o.Content, (Func<long, int, bool>) ((y, z) => (Decimal) y == cacheuser.Value.TwitterID))) == 0)
       this.CachedUsers.Remove(cacheuser.Key);
   }
   foreach (long num in (Collection<long>) o.Content)
   {
     Decimal userid = (Decimal) num;
     if (Enumerable.Count<KeyValuePair<string, CacheUser>>(Enumerable.Where<KeyValuePair<string, CacheUser>>((IEnumerable<KeyValuePair<string, CacheUser>>) this.CachedUsers, (Func<KeyValuePair<string, CacheUser>, int, bool>) ((x, r) => x.Value.TwitterID == userid))) == 0)
       userstoadd.Add((long) userid);
   }
   if (userstoadd.Count > 0)
     await this.LoadUsersfromTwitter(userstoadd);
 }
开发者ID:unbearab1e,项目名称:FlattyTweet,代码行数:20,代码来源:CacheData.cs


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