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


C# Windows.ApplicationModel.Resources.ResourceLoader.GetString方法代码示例

本文整理汇总了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();
            };
        }
开发者ID:YouthLin,项目名称:2048UWP,代码行数:34,代码来源:Menu.xaml.cs

示例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);
     }
 }
开发者ID:catrubens,项目名称:Henallux,代码行数:32,代码来源:SearchViewModel.cs

示例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();
                }
            }
        }
开发者ID:catrubens,项目名称:Henallux,代码行数:30,代码来源:MainViewModel.cs

示例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;
 }
开发者ID:CuiXiaoDao,项目名称:cnblogs-UAP,代码行数:34,代码来源:TimeCountDownConverter.cs

示例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());
        }
开发者ID:zhongleiyang,项目名称:win8SDK,代码行数:27,代码来源:OssHttpRequestMessage.cs

示例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");
 }
开发者ID:drasticactions,项目名称:Pureisuteshon-App,代码行数:7,代码来源:FriendLinkPage.xaml.cs

示例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();
 }
开发者ID:orangpelupa,项目名称:PlayStation-App,代码行数:7,代码来源:ResultChecker.cs

示例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");
 }
开发者ID:Nevichi,项目名称:BonappFinal,代码行数:8,代码来源:SearchRecipeViewModel.cs

示例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");
 }
开发者ID:Nevichi,项目名称:BonappFinal,代码行数:9,代码来源:SecondPageViewModel.cs

示例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;
 }
开发者ID:lorenzofar,项目名称:battery-status,代码行数:9,代码来源:MainPage.xaml.cs

示例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();
 }
开发者ID:orangpelupa,项目名称:PlayStation-App,代码行数:57,代码来源:MainPageViewModel.cs

示例12: MainPage

        public MainPage()
        {
            this.InitializeComponent();

            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            url = loader.GetString("url");
            authtoken = loader.GetString("authtoken");

            text.Text = "";
        }
开发者ID:jeffhollan,项目名称:HttpPostRepeater,代码行数:10,代码来源:MainPage.xaml.cs

示例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
        }
开发者ID:EBailey67,项目名称:samples,代码行数:11,代码来源:DeviceInfoPresenter.cs

示例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");
            }
        }
开发者ID:MicrosoftEdge,项目名称:WebOnPi,代码行数:12,代码来源:DeviceInfoPresenter.cs

示例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>();
            }
        }
开发者ID:marylin,项目名称:Sugges.me,代码行数:12,代码来源:DatabaseModel.cs


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