本文整理汇总了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>();
}
示例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"));
}
示例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();
}
}
示例4: ReceivedId
private void ReceivedId(GenericMessage<string> msg)
{
if (Album != null && msg.Content == Album.Id) return;
Album = null;
Tracks = null;
LoadData(msg.Content);
}
示例5: ReceivedId
private void ReceivedId(GenericMessage<LastAlbum> msg)
{
if (Album != null && msg.Content.Name == Album.Name) return;
Album = null;
Tracks = null;
LoadData(msg.Content);
}
示例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);
}
}
示例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);
}
示例8: HandleMainNavigationMessage
private void HandleMainNavigationMessage(GenericMessage<string> message)
{
switch (message.Content)
{
case MainNavigation.MAIN_MENU:
MainContent.Content = null;
MainMenu.Visibility = Visibility.Visible;
break;
}
}
示例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");
}
示例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");
}
示例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);
});
}
}
示例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>();
}
示例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;
}
}
示例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");
}
示例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);
}