本文整理汇总了C#中Windows.ApplicationModel.Resources.ResourceLoader.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# ResourceLoader.GetString方法的具体用法?C# ResourceLoader.GetString怎么用?C# ResourceLoader.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.ApplicationModel.Resources.ResourceLoader
的用法示例。
在下文中一共展示了ResourceLoader.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: notificationReceived
private static void notificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
{
string receiver = args.RawNotification.Content;
if (CommonData.session!=null && receiver == CommonData.session.Username)
{
if (CommonData.activeConversationPage != null)
{
CommonData.activeConversationPage.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
CommonData.activeConversationPage.refreshMessages(null, null);
});
}
}
else
{
foreach (string[] credential in DataStorage.GetNotifierCredentials())
{
if (receiver == credential[0])
{
ToastTemplateType toastTemplate = ToastTemplateType.ToastText02;
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate);
var toastTextElements = toastXml.GetElementsByTagName("text");
ResourceLoader resourceGetter = new ResourceLoader();
string appName = resourceGetter.GetString("ApplicationTitle");
string notificationText = resourceGetter.GetString("NotifierNewMessageText") + credential[0];
toastTextElements[0].AppendChild(toastXml.CreateTextNode(appName));
toastTextElements[1].AppendChild(toastXml.CreateTextNode(notificationText));
ToastNotification toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);
}
}
}
}
示例2: LoadProcessedData
public async Task LoadProcessedData()
{
ResourceLoader resourceLoader = new ResourceLoader();
await ProcessData.LoadSettings();
MembersHubViewModel OfficeMembers = new MembersHubViewModel();
OfficeMembers.HubName = resourceLoader.GetString(OFFICE_RESOURCE_KEY);
List<OfficeMember> OfficeMembersModelsList = ProcessData.GetOfficeMembers();
foreach (OfficeMember officeMemberModel in OfficeMembersModelsList)
{
MemberItemViewModel officeMemberItem = new MemberItemViewModel();
officeMemberItem.ModelToItem(officeMemberModel);
OfficeMembers.Add(officeMemberItem);
}
this.Hubs.Add(OfficeMembers);
MembersHubViewModel Members = new MembersHubViewModel();
Members.HubName = resourceLoader.GetString(MEMBERS_RESOURCE_KEY);
List<Member> MembersModelsList = ProcessData.GetMembers();
foreach (Member MemberModel in MembersModelsList)
{
MemberItemViewModel MemberItem = new MemberItemViewModel();
MemberItem.ModelToItem(MemberModel);
Members.Add(MemberItem);
}
this.Hubs.Add(Members);
}
示例3: settingsPane_CommandsRequested
///////////////////////////////////////////////////////////////////////////////////
// Update with URLs to About, Support and Privacy Policy Web Pages
///////////////////////////////////////////////////////////////////////////////////
void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var rl = new ResourceLoader();
var aboutCmd = new SettingsCommand("About", rl.GetString("SETTINGS_PANEL_CMD_ABOUT"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(aboutCmd);
var supportCmd = new SettingsCommand("Support", rl.GetString("SETTINGS_PANEL_CMD_SUPPORT"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(supportCmd);
var policyCmd = new SettingsCommand("PrivacyPolicy", rl.GetString("SETTINGS_PANEL_CMD_PRIVACY_POLICY"), async (x) =>
{
await Launcher.LaunchUriAsync(new Uri(""));
});
args.Request.ApplicationCommands.Add(policyCmd);
}
示例4: settingsPane_CommandsRequested
private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var ConfigHandler = new UICommandInvokedHandler(onConfigCommand);
var loader = new ResourceLoader();
var configurationCommand = new SettingsCommand(loader.GetString("Settings"), loader.GetString("Settings"), ConfigHandler);
args.Request.ApplicationCommands.Add(configurationCommand);
}
示例5: MusicLibraryViewModel
public MusicLibraryViewModel()
{
var resourceLoader = new ResourceLoader();
_goBackCommand = new StopVideoCommand();
Panels.Add(new Panel(resourceLoader.GetString("Artist").ToUpper(), 0, 1));
Panels.Add(new Panel(resourceLoader.GetString("Tracks").ToUpper(), 1, 0.4));
Panels.Add(new Panel(resourceLoader.GetString("FavoriteAlbums").ToUpper(), 2, 0.4));
}
示例6: VMRules
public VMRules(INavigationService navigationService)
{
_navigationService = navigationService;
loader = new Windows.ApplicationModel.Resources.ResourceLoader();
string str = loader.GetString("belote/content");
ListeJeux.Add(new JeuInfo() { NameGame = str, NumGame = 1 });
str = loader.GetString("dameDePique/content");
ListeJeux.Add(new JeuInfo() { NameGame = str, NumGame = 2 });
}
示例7: Convert
public object Convert(object value, Type targetType, object parameter, string language)
{
var res = new ResourceLoader("Resources");
if (value == null)
return res.GetString("Follow");
bool val = (bool)value;
if (val)
return res.GetString("Unfollow");
return res.GetString("Follow");
}
示例8: InitializeAsync
public async Task InitializeAsync()
{
var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
connectionString = loader.GetString("ActualDataBasePath");
if (!await DoesFileExistAsync(loader.GetString("ActualDataBasePath")))
{
SQLite.SQLiteAsyncConnection context = new SQLite.SQLiteAsyncConnection(connectionString);
await context.CreateTableAsync<Generic.UI.Logic.DataModel.Item>();
}
}
示例9: Context_FetchDataFailed
private async void Context_FetchDataFailed(object sender, ViewModels.Events.FetchDataFailedEventArgs e)
{
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, new Windows.UI.Core.DispatchedHandler(async () =>
{
var loader = new ResourceLoader();
var d = new MessageDialog(e.Message);
d.Title = loader.GetString("Error");
d.Commands.Add(new UICommand(loader.GetString("Setting"), new UICommandInvokedHandler(NavigateToSettings)));
d.Commands.Add(new UICommand(loader.GetString("Quit"), new UICommandInvokedHandler(QuitAll)));
await d.ShowAsync();
}));
}
示例10: settingsPane_CommandsRequested
private void settingsPane_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
var ConfigHandler = new UICommandInvokedHandler(onConfigCommand);
var LogoutHandler = new UICommandInvokedHandler(onLogoutCommand);
var loader = new ResourceLoader();
var configurationCommand = new SettingsCommand(loader.GetString("Settings"), loader.GetString("Settings"), ConfigHandler);
args.Request.ApplicationCommands.Add(configurationCommand);
if (!string.IsNullOrEmpty(ConnectedService.LoggedInUser))
{
var logoutCommand = new SettingsCommand(loader.GetString("Logout"), loader.GetString("Logout"), onLogoutCommand);
args.Request.ApplicationCommands.Add(logoutCommand);
}
}
示例11: LoginButton_Click
private async void LoginButton_Click(object sender, RoutedEventArgs e)
{
ResourceLoader resourceLoader = new ResourceLoader();
EmailError.Visibility = Visibility.Collapsed;
PasswordError.Visibility = Visibility.Collapsed;
ErrorBorder.Visibility = Visibility.Collapsed;
string errorText = "";
var email = Email.Text;
var password = Password.Password;
if (string.IsNullOrWhiteSpace(email))
{
errorText += resourceLoader.GetString("ErrorEmailIsRequired");
EmailError.Visibility = Visibility.Visible;
}
if (string.IsNullOrWhiteSpace(password))
{
if (errorText.Length != 0)
errorText += "\n";
errorText += resourceLoader.GetString("ErrorPasswordIsRequired");
PasswordError.Visibility = Visibility.Visible;
}
if (errorText.Length != 0)
{
ErrorText.Text = errorText;
ErrorBorder.Visibility = Visibility.Visible;
return;
}
SetEnableState(false);
var success = await ParticleCloud.SharedCloud.LoginAsync(email, password);
if (success)
{
TinkerData.Login();
Frame.Navigate(typeof(DevicesPage));
}
else
{
ErrorText.Text = resourceLoader.GetString("AuthCredentialsError");
ErrorBorder.Visibility = Visibility.Visible;
}
SetEnableState(true);
}
示例12: ShowMailForm
public static async void ShowMailForm(ResourceLoader resourceLoader)
{
var appVersion = Package.Current.Id.Version.Major + "." + Package.Current.Id.Version.Minor;
var mail = new EmailMessage();
mail.Subject = string.Format(resourceLoader.GetString("SupportMailSubject"), resourceLoader.GetString("AppName"));
mail.Body = string.Format(resourceLoader.GetString("SupportMailBody"), resourceLoader.GetString("AppName"), appVersion);
mail.To.Add(new EmailRecipient()
{
Address = "[email protected]"
});
await EmailManager.ShowComposeNewEmailAsync(mail);
}
示例13: MainViewModel
public MainViewModel(IDictionaryDataService dataService)
{
_dataService = dataService;
ResourceLoader resourceLoader = new ResourceLoader();
MatchTypes = new ObservableCollection<MatchTypeItem>
{
new MatchTypeItem {Key = "FullMatch", Value = resourceLoader.GetString("ComboBoxItemFullMatch") },
new MatchTypeItem {Key = "PartialMatch", Value = resourceLoader.GetString("ComboBoxItemPartialMatch") }
};
MatchType = MatchTypes[0];
Words = new ObservableCollection<Word>();
}
示例14: LoadNavigation
public void LoadNavigation()
{
Nodes = new ObservableCollection<NavigationNode>();
var resourceLoader = new ResourceLoader();
AddNode(Nodes, "Home", "\ue10f", string.Empty, "HomePage", true, @"dotNet Spain Conference");
AddNode(Nodes, "Favoritos", "\ue113", string.Empty, "FavoritesPage", true);
AddNode(Nodes, "Agenda", "\ue163", string.Empty, "AgendaListPage", true);
AddNode(Nodes, "Ponentes", "\ue125", string.Empty, "PonentesListPage", true);
AddNode(Nodes, "Fotos", "\ue114", string.Empty, "FotosListPage", true);
AddNode(Nodes, "Twitter", "\ue134", string.Empty, "TwitterListPage", true);
AddNode(Nodes, "Videos Channel 9", "\ue116", string.Empty, "VideosChannel9ListPage", true);
AddNode(Nodes, "Mapa", "\ue707", string.Empty, "MapListPage", true);
AddNode(Nodes, "FAQ", "\ue160", string.Empty, "FAQListPage", true);
AddNode(Nodes, resourceLoader.GetString("NavigationPaneAbout"), "\ue11b", string.Empty, "AboutPage");
AddNode(Nodes, resourceLoader.GetString("NavigationPanePrivacy"), "\ue1f7", string.Empty, string.Empty, true, string.Empty, "https://www.desarrollaconmicrosoft.com/Dotnetspain2016");
}
示例15: LoadNavigation
public void LoadNavigation()
{
Nodes = new ObservableCollection<NavigationNode>();
var resourceLoader = new ResourceLoader();
AddNode(Nodes, "Home", "\ue10f", string.Empty, "HomePage", true, @"Windows 10 News");
AddNode(Nodes, "What's going on", "\ue12a", string.Empty, "WhatsGoingOnListPage", true);
AddNode(Nodes, "Recent news", "\ue12a", string.Empty, "RecentNewsListPage", true);
AddNode(Nodes, "Apps", "\ue12a", string.Empty, "AppsListPage", true);
AddNode(Nodes, "Business", "\ue12a", string.Empty, "BusinessListPage", true);
AddNode(Nodes, "Insider program", "\ue12a", string.Empty, "InsiderProgramListPage", true);
AddNode(Nodes, "Devs", "\ue12a", string.Empty, "DevsListPage", true);
AddNode(Nodes, "What are people talking about", "\ue134", string.Empty, "WhatArePeopleTalkingAboutListPage", true);
AddNode(Nodes, "Do more", "\ue12d", string.Empty, "DoMoreListPage", true);
AddNode(Nodes, resourceLoader.GetString("NavigationPaneAbout"), "\ue11b", string.Empty, "AboutPage");
AddNode(Nodes, resourceLoader.GetString("NavigationPanePrivacy"), "\ue1f7", string.Empty, string.Empty, true, string.Empty, "http://appstudio.windows.com/home/appprivacyterms");
}