• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Resources.ResourceLoader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: AddReservation

        public async Task AddReservation(string email,List<Book> list)
        {
            List<String> listNumBook = new List<string>();

            foreach(var book in list)
            {
                listNumBook.Add(book.NumBook);
            }

            var listeJSONBook = Newtonsoft.Json.JsonConvert.SerializeObject(listNumBook);
            var linkForPost = Newtonsoft.Json.JsonConvert.SerializeObject("");

            HttpContent content = new StringContent(linkForPost, Encoding.UTF8, "application/json");
            HttpResponseMessage reponse = await client.PostAsync(addReservation + email + "&content=" + listeJSONBook, content);

            if (reponse.StatusCode == System.Net.HttpStatusCode.BadGateway)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                string str = loader.GetString("noNetwork");
                throw new NoNetworkException(str);
            }
            else
            {
                if (reponse.StatusCode == System.Net.HttpStatusCode.NotFound)
                {
                    var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                    string str = loader.GetString("errorAddReseration");
                    throw new ErrorData(str);
                }
            }
        }
开发者ID:catrubens,项目名称:Henallux,代码行数:31,代码来源:ReservationAccess.cs


示例2: SetNameField

		private async Task SetNameField(Boolean login)
		{
			// If login == false, just update the name field. 
			await App.updateUserName(this.UserNameTextBlock, login);

			// Test to see if the user can sign out.
			Boolean userCanSignOut = true;

			var LCAuth = new LiveAuthClient();
			LiveLoginResult LCLoginResult = await LCAuth.InitializeAsync();

			if (LCLoginResult.Status == LiveConnectSessionStatus.Connected)
			{
				userCanSignOut = LCAuth.CanLogout;
			}

			var loader = new Windows.ApplicationModel.Resources.ResourceLoader();

			if (String.IsNullOrEmpty(UserNameTextBlock.Text) 
				|| UserNameTextBlock.Text.Equals(loader.GetString("MicrosoftAccount/Text")))
			{
				// Show sign-in button.
				SignInButton.Visibility = Visibility.Visible;
				SignOutButton.Visibility = Visibility.Collapsed;
			}
			else
			{
				// Show sign-out button if they can sign out.
				SignOutButton.Visibility = userCanSignOut ? Visibility.Visible : Visibility.Collapsed;
				SignInButton.Visibility = Visibility.Collapsed;
			}
		}
开发者ID:vapps,项目名称:Modern_LiveBoard,代码行数:32,代码来源:AccountSettingsFlyout.xaml.cs


示例3: ListRecipesViewModel

 public ListRecipesViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     Recipes = new ObservableCollection<Recipe>();
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     var tradSearch = loader.GetString("searchDesc");
 }
开发者ID:Nevichi,项目名称:BonappFinal,代码行数:7,代码来源:ListRecipesViewModel.cs


示例4: 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


示例5: init

        /// <summary>
        /// Initializes the widget, specifying the page name and extracting it from the source.
        /// </summary>
        private void init()
        {
            if (this.Source.Contains("http://"))
            {
                this.Source = this.Source.Substring(Source.IndexOf("//") + 2);
            }
            if (this.Source.Contains("facebook.com"))
            {
                this.Source = this.Source.Substring(Source.IndexOf("/") + 1);
            }

            if (this.sel == Selection.Likes)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                this.Title = String.Format(loader.GetString("FBWidgetLikes"), Source);
            }
            else if (this.sel == Selection.TalkingAbout)
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                this.Title = String.Format(loader.GetString("FBWidgetPeopleTalkingAbout"), Source);
            }
            this.Background = "#385998";
            this.Foreground = "white";
            this.WidgetForeground = "#33ffffff";
            this.WidgetName = "facebook";
        }
开发者ID:rlbisbe,项目名称:metrics,代码行数:29,代码来源:FacebookWidget.cs


示例6: CicloStationsManager

 public CicloStationsManager(IHttpCommunicator httpCommunicator, ITokenManager tokenManager)
 {
     _httpCommunicator = httpCommunicator;
     _tokenManager = tokenManager;
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     fileName = loader.GetString("CicloStationFile");
 }
开发者ID:Satur01,项目名称:MapaEcobici,代码行数:7,代码来源:CicloStationsManager.cs


示例7: TutorialHelloBlinkyPage

        public TutorialHelloBlinkyPage()
        {
            this.InitializeComponent();

            if (DeviceTypeInformation.Type == DeviceTypes.DB410)
            {
                LED_PIN = 115; // on-board LED on the DB410c
            }

            var rootFrame = Window.Current.Content as Frame;
            rootFrame.Navigated += RootFrame_Navigated;
            Unloaded += MainPage_Unloaded;

            this.NavigationCacheMode = NavigationCacheMode.Enabled;

            this.DataContext = LanguageManager.GetInstance();

            this.Loaded += (sender, e) =>
            {
                UpdateDateTime();

                timer = new DispatcherTimer();
                timer.Tick += timer_Tick;
                timer.Interval = TimeSpan.FromSeconds(30);
                timer.Start();

                blinkyTimer = new DispatcherTimer();
                blinkyTimer.Interval = TimeSpan.FromMilliseconds(500);
                blinkyTimer.Tick += Timer_Tick;

                loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                BlinkyStartStop.Content = loader.GetString("BlinkyStart");
            };
        }
开发者ID:MicrosoftEdge,项目名称:WebOnPi,代码行数:34,代码来源:TutorialHelloBlinkyPage.xaml.cs


示例8: 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


示例9: GetResourceString

    private static string GetResourceString([CallerMemberName] string resourceName = null)
    {
#pragma warning disable
      var loader = new Windows.ApplicationModel.Resources.ResourceLoader("Csla/Resources");
#pragma warning enable
      return loader.GetString(resourceName);
    }
开发者ID:JohnMilazzo,项目名称:csla,代码行数:7,代码来源:Resources.Designer.cs


示例10: 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


示例11: GetCategories

        public async Task<ObservableCollection<Categorie>> GetCategories()
        {
            client.BaseAddress = new Uri(allCategorie);
            client.DefaultRequestHeaders.Accept.Clear();
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            HttpResponseMessage response = await client.GetAsync("");

            if (response.IsSuccessStatusCode)
            {
                string json = await response.Content.ReadAsStringAsync();
                var categoriesResponse = JsonConvert.DeserializeObject<Categorie[]>(json);
                ObservableCollection<Categorie> listCategories = new ObservableCollection<Categorie>();

                foreach (var c in categoriesResponse)
                {
                    Categorie categorie = new Categorie();
                    categorie.CodeCategorie = c.CodeCategorie;
                    categorie.LibelleCategorie = c.LibelleCategorie;
                    listCategories.Add(categorie);
                }
                return listCategories;
            }
            else
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                string str = loader.GetString("noNetwork");
                throw new NoNetworkException(str);
            }
        }
开发者ID:catrubens,项目名称:Henallux,代码行数:30,代码来源:CategorieAccess.cs


示例12: 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


示例13: VerifiyLoginAsync

        public async Task<bool> VerifiyLoginAsync(string email, string password)
        {
            if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable())
            {
                HttpClient client = new HttpClient();
                HttpResponseMessage response = await client.GetAsync("http://keyregisterweb.azurewebsites.net/api/people/searchPersonByEmail/?email=" + email);

                string json = await response.Content.ReadAsStringAsync();
                var userFromDB = Newtonsoft.Json.JsonConvert.DeserializeObject<Person>(json);

                string cryptedPassword = MyCrypt(password);

                if (cryptedPassword.Equals(userFromDB.Password))
                {
                    return true;
                }

                return false;
            }
            else
            {
                var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
                string str = loader.GetString("noNetwork");
                throw new NoNetworkException(str);
            }
        }
开发者ID:cedricreper,项目名称:Mobile_Application,代码行数:26,代码来源:LoginService.cs


示例14: UserViewModel

        public UserViewModel()
        {
            var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
            model = new DatabaseModel();

            this.Identifier = new Guid(loader.GetString("GuidNull"));
        }
开发者ID:soreygarcia,项目名称:Sugges.me,代码行数:7,代码来源:UserViewModel.cs


示例15:

        /// <summary>
        /// 프로퍼티로 호출
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public string this[string id]
        {
            get
            {
                string str = string.Empty;
                if (Windows.ApplicationModel.DesignMode.DesignModeEnabled == false)
                {
                    if (_rl == null)
                    {
                        _rl = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView(ResourceName);
                    }

                    str = _rl.GetString(id);
                    if (string.IsNullOrEmpty(str) == true)
                    {
                        str = string.Empty;
                    }
                }
                else
                {   
                    //디자인 타임에서는 키값을 반환
                    str = id;
                }
                return str;
            }
        }
开发者ID:vapps,项目名称:CrossPlatform,代码行数:31,代码来源:DynamicResource.cs


示例16: 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


示例17: 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


示例18: Convert

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var list = (IList<Filter>)value;
            var text = string.Empty;
            var separator = parameter != null ? parameter.ToString() : " ";

            if (list != null && list.Count > 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    text += list[i].ToString();

                    if (i < list.Count - 1)
                    {
                        text += separator;
                    }
                }
            }
            else
            {
                text = new Windows.ApplicationModel.Resources.ResourceLoader().GetString("PhotoPageZeroFiltersText");
            }

            return text;
        }
开发者ID:roachhd,项目名称:filter-explorer,代码行数:25,代码来源:FilterListStringConverter.cs


示例19: 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


示例20: EmptyWidget

 public EmptyWidget()
 {
     this.WidgetName = "EmptyWidget";
     this.Foreground = "white";
     var loader = new Windows.ApplicationModel.Resources.ResourceLoader();
     this.Title = loader.GetString("EmptyWidgetTitle");
 }
开发者ID:rlbisbe,项目名称:metrics,代码行数:7,代码来源:EmptyWidget.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Windows.Kinect类代码示例发布时间:2022-05-24
下一篇:
C# Windows类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap