本文整理汇总了C#中Windows.ApplicationModel.Resources.ResourceLoader.GetString方法的典型用法代码示例。如果您正苦于以下问题:C# Windows.ApplicationModel.Resources.ResourceLoader.GetString方法的具体用法?C# Windows.ApplicationModel.Resources.ResourceLoader.GetString怎么用?C# Windows.ApplicationModel.Resources.ResourceLoader.GetString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.ApplicationModel.Resources.ResourceLoader
的用法示例。
在下文中一共展示了Windows.ApplicationModel.Resources.ResourceLoader.GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnNavigatedTo
protected override void OnNavigatedTo(NavigationEventArgs e)
{
CoreWindow.GetForCurrentThread().PointerCursor = new CoreCursor(CoreCursorType.Arrow, 1);
if (e.NavigationMode == NavigationMode.New)
{
frame.Navigate(typeof(Setting));
List<MenuItem> mylist1 = new List<MenuItem>();
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
//str = loader.GetString("back");
//mylist1.Add(new MenuItem() { Icon = "Back", Title = str });
var str = loader.GetString("setting");
mylist1.Add(new MenuItem() { Icon = "Setting", Title = str });
str = loader.GetString("histroy");
mylist1.Add(new MenuItem() { Icon = "Favorite", Title = str });
str = loader.GetString("help");
mylist1.Add(new MenuItem() { Icon = "Help", Title = str });
list1.ItemsSource = mylist1;
mylist1 = new List<MenuItem>();
str = loader.GetString("about");
mylist1.Add(new MenuItem() { Icon = "Contact", Title = str });
str = loader.GetString("like");
mylist1.Add(new MenuItem() { Icon = "Like", Title = str });
//str = loader.GetString("back");
//mylist1.Add(new MenuItem() { Icon = "Back", Title = str });
list2.ItemsSource = mylist1;
}
base.OnNavigatedTo(e);
CoreWindow.GetForCurrentThread().PointerReleased += (sender, args) =>
{
args.Handled = true;
if (args.CurrentPoint.Properties.PointerUpdateKind == Windows.UI.Input.PointerUpdateKind.XButton1Released) if (Frame.CanGoBack) Frame.GoBack();
};
}
示例2: SearchBook
private async void SearchBook()
{
BookAccess bookAccess = new BookAccess();
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
try
{
if (CanExecute() == true)
{
var codeCategorie = SelectedCategory.CodeCategorie;
codeCategorie = codeCategorie.Replace(" ", "_");
BooksSearch = await bookAccess.GetBookSearch(WordSearch, codeCategorie);
if(BooksSearch.Count == 0)
{
string str = loader.GetString("NoResult");
ShowToast(str);
}
}
else
{
string str = loader.GetString("Search_Missing");
throw new EmptyFieldsException(str);
}
}
catch (EmptyFieldsException e)
{
ShowToast(e.ErrorMessage);
}
catch (NoNetworkException e)
{
ShowToast(e.ErrorMessage);
}
}
示例3: BookReseravation_Click
private async void BookReseravation_Click(Book book)
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
string strVR = loader.GetString("ValideReservation");
string yes = loader.GetString("Yes");
string no = loader.GetString("No");
var dialog = new Windows.UI.Popups.MessageDialog(book.Title+"\n" + strVR);
dialog.Commands.Add(new Windows.UI.Popups.UICommand(yes) { Id = 1 });
dialog.Commands.Add(new Windows.UI.Popups.UICommand(no) { Id = 0 });
var result = await dialog.ShowAsync();
if ((int)result.Id == 1)
{
var duplicate = false;
foreach (var b in bookReservation)
{
if (b.NumBook == book.NumBook)
duplicate = true;
}
if(duplicate == false)
bookReservation.Add(book);
else
{
var str = loader.GetString("Duplicate");
dialog = new Windows.UI.Popups.MessageDialog(str);
await dialog.ShowAsync();
}
}
}
示例4: Convert
public object Convert(object value, Type targetType, object parameter, string culture)
{
Windows.ApplicationModel.Resources.ResourceLoader loader = new Windows.ApplicationModel.Resources.ResourceLoader();
DateTime dateTimeToConvert = (DateTime)value;
string commentTimeString = "";
TimeSpan commentTimeLag = System.DateTime.Now - dateTimeToConvert;
if (dateTimeToConvert.Date == System.DateTime.Now.Date)
{
if (TimeSpan.FromHours(1) > commentTimeLag)
{
if (commentTimeLag.Minutes <= 1)
commentTimeString = string.Format("{0}" + loader.GetString("TimeConverter_Recent_1"), commentTimeLag.Minutes);
else
commentTimeString = string.Format("{0}" + loader.GetString("TimeConverter_Recent"), commentTimeLag.Minutes);
}
else
{
commentTimeString = string.Format(loader.GetString("TimeConverter_Today") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
}
}
else if (dateTimeToConvert.AddDays(1).Date == System.DateTime.Now.Date)
{
commentTimeString = string.Format(loader.GetString("TimeConverter_Yesterday") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
}
//else if (dateTimeToConvert.AddDays(2).Date == System.DateTime.Now.Date)
//{
// commentTimeString = string.Format(loader.GetString("TimeConverter_DayBeforeYesterday") + "{0}:{1:d2}", dateTimeToConvert.Hour, dateTimeToConvert.Minute);
//}
else
{
commentTimeString = dateTimeToConvert.ToString("yyyy-MM-dd");
}
return commentTimeString;
}
示例5: OssHttpRequestMessage
public OssHttpRequestMessage(Uri endpoint, string bucketName, string key, IDictionary<string, string> _parameters = null)
{
if (bucketName != NONEEDBUKETNAME)
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
if (string.IsNullOrEmpty(bucketName))
{
var text = loader.GetString("ExceptionIfArgumentStringIsNullOrEmpty");
throw new ArgumentException(text, "bucketName");
}
if (!string.IsNullOrEmpty(bucketName) && !OssUtils.IsBucketNameValid(bucketName))
{
var text = loader.GetString("BucketNameInvalid");
throw new ArgumentException(text, "bucketName");
}
}
else
{
bucketName = "";
}
Endpoint = endpoint;
ResourcePath = "/" + ((bucketName != null) ? bucketName : "") + ((key != null) ? ("/" + key) : "");
ResourcePathUrl = OssUtils.MakeResourcePath(bucketName, key);
parameters = _parameters;
RequestUri = new Uri(BuildRequestUri());
}
示例6: OnDataRequested
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs args)
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
args.Request.Data.SetText(
$"{loader.GetString("SendMeFriendRequest/Text")} {_link} {Environment.NewLine} {loader.GetString("SentFromPlayStationApp/Text")}");
args.Request.Data.Properties.Title = loader.GetString("InviteFriendsToPsn/Text");
}
示例7: SendMessageDialogAsync
public async static Task SendMessageDialogAsync(string message, bool isSuccess)
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var title = isSuccess ? loader.GetString("SuccessText/Text") : loader.GetString("ErrorText/Text");
var dialog = new MessageDialog((string.Concat(title, Environment.NewLine, Environment.NewLine, message)));
await dialog.ShowAsync();
}
示例8: SearchRecipeViewModel
public SearchRecipeViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var tradSearchDesc = loader.GetString("searchDesc");
var tradSearch = loader.GetString("searchInput");
var tradSearchTitle = loader.GetString("searchTitle");
}
示例9: SecondPageViewModel
public SecondPageViewModel(INavigationService navigationService)
{
_navigationService = navigationService;
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
var tradSearch = loader.GetString("searchTitle");
var tradHome = loader.GetString("homeTitle");
var tradFavoris = loader.GetString("favoritesTitle");
var tradTitle = loader.GetString("loginTitle");
}
示例10: CalculatePercentage
private void CalculatePercentage(Windows.Devices.Power.BatteryReport details)
{
var getPercentage = (details.RemainingCapacityInMilliwattHours.Value / (double)details.FullChargeCapacityInMilliwattHours.Value);
var status = details.Status;
string per = getPercentage.ToString("##%");
ProgressInPer.Value = getPercentage * 100;
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
BatteryStatus.Text = loader.GetString("status") + loader.GetString(status.ToString()) + " - " + loader.GetString("percentage") + per;
}
示例11: PopulateMenu
public void PopulateMenu()
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
MenuItems = new List<MenuItem>()
{
new MenuItem()
{
Icon = "/Assets/Icons/Home.png",
Name = loader.GetString("Home/Text"),
Command = new NavigateToWhatsNewPage()
},
//new MenuItem()
//{
// Icon = "/Assets/Icons/Event.png",
// Name = loader.GetString("Events/Text"),
// Command = new NavigateToEventsPageCommand()
//},
new MenuItem()
{
Icon = "/Assets/Icons/Friends.png",
Name = loader.GetString("Friends/Text"),
Command = new NavigateToFriendsPage()
},
new MenuItem()
{
Icon = "/Assets/Icons/Trophy.png",
Name = loader.GetString("Trophy/Text"),
Command = new NavigateToTrophiesPage()
},
new MenuItem()
{
Icon = "/Assets/Icons/Messenger.png",
Name = loader.GetString("Messenger/Text"),
Command = new NavigateToMessagesViewCommand()
},
new MenuItem()
{
Icon = "/Assets/Icons/Live.png",
Name = loader.GetString("LiveFromPlayStation/Text"),
Command = new NavigateToLiveFromPlaystationPage()
},
new MenuItem()
{
Icon = "/Assets/Icons/AddFriendLink.png",
Name = loader.GetString("InviteFriendsToPsn/Text"),
Command = new NavigateToFriendLinkPageCommand()
},
new MenuItem()
{
Icon = "/Assets/Icons/SignOut.png",
Name = loader.GetString("Signout/Text"),
Command = new NavigateToSelectAccountCommand()
}
};
SwipeableSplitView?.UpdateLayout();
SwipeableSplitView?.UpdateMenuList();
}
示例12: MainPage
public MainPage()
{
this.InitializeComponent();
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
url = loader.GetString("url");
authtoken = loader.GetString("authtoken");
text.Text = "";
}
示例13: GetBoardName
public static string GetBoardName()
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
#if MBM
return loader.GetString("MBMName");
#elif RPI
return loader.GetString("Rpi2Name");
#else
return loader.GetString("GenericBoardName");
#endif
}
示例14: GetBoardName
public static string GetBoardName()
{
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
switch (DeviceTypeInformation.Type)
{
case DeviceTypes.RPI2:
return loader.GetString("Rpi2Name");
default:
return loader.GetString("GenericBoardName");
}
}
示例15: InitializeAsync
public async Task InitializeAsync()
{
var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
connectionString = loader.GetString("DataBasePath");
if (!await DoesFileExistAsync(loader.GetString("DataBasePath")))
{
SQLite.SQLiteAsyncConnection context = new SQLite.SQLiteAsyncConnection(connectionString);
await context.CreateTableAsync<Sugges.UI.Logic.DataModel.Item>();
}
}