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

C# Resources.ResourceLoader类代码示例

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

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



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

示例1: SimBalanceViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="SimBalanceViewModel" /> class.
        /// </summary>
        /// <param name="simBalance">The sim balance.</param>
        /// <param name="topUpHistory">The top up history.</param>
        /// <param name="usageHistory">The usage history.</param>
        /// <param name="authorizationService">The authorization service.</param>
        /// <param name="navigationService">The navigation service.</param>
        /// <param name="resourceLoader">The resource loader.</param>
        /// <exception cref="System.ArgumentNullException"></exception>
        public SimBalanceViewModel(ISimBalance simBalance, ITopUpHistory topUpHistory, IUsageHistory usageHistory, IAuthorizationService authorizationService, INavigationService navigationService, ResourceLoader resourceLoader)
            : base(authorizationService, resourceLoader, navigationService)
        {
            if (simBalance == null)
            {
                throw new ArgumentNullException("simBalance");
            }
            if (topUpHistory == null)
            {
                throw new ArgumentNullException("topUpHistory");
            }
            if (usageHistory == null)
            {
                throw new ArgumentNullException("usageHistory");
            }

            _mobileNumber = (DTO.MobileNumber)NavigationService.Parameter;

            _simBalanceRepository = simBalance;
            _topUpHistory = topUpHistory;
            _usageHistory = usageHistory;

            Groups = new ObservableCollection<Group>();

            HandleNoInternet();
            LoadBalance();

        }
开发者ID:prebenh,项目名称:MobileVikings,代码行数:38,代码来源:SimBalanceViewModel.cs


示例2: Grid_DoubleTapped

        private async void Grid_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            Grid grid = (Grid)sender;
            Records.Items items = (Records.Items)grid.DataContext;
            String Data = String.Empty;
            ResourceLoader resourceLoader = new ResourceLoader();

            Data += String.Format(resourceLoader.GetString("pageResult_Assignment") + Environment.NewLine, items.Oid);
            Data += String.Format(resourceLoader.GetString("pageResult_Registry") + Environment.NewLine, items.RegistryID);
            Data += String.Format(resourceLoader.GetString("pageResult_OrganizationName") + Environment.NewLine, items.Name);
            Data += String.Format(resourceLoader.GetString("pageResult_OrganizationAddress") + Environment.NewLine, items.Address);

            if ( (items.Protocol != String.Empty) && (items.Protocol != null))
            {
                Data += String.Format(resourceLoader.GetString("pageResult_Protocol") + Environment.NewLine, items.Protocol);
            }

            DataPackage dataPackage = new DataPackage();

            dataPackage.SetText(Data);
            Clipboard.SetContent(dataPackage);

            MessageDialog msgbox = new MessageDialog(Data, resourceLoader.GetString("pageResult_DialogCopied"));

            msgbox.Commands.Clear();
            msgbox.Commands.Add(new UICommand { Label = resourceLoader.GetString("pageResult_DialogClose"), Id = 0 });
 
            var res = await msgbox.ShowAsync();
        }
开发者ID:EddyBeaupre,项目名称:searchIEEE,代码行数:29,代码来源:pageResults.xaml.cs


示例3: 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);
        }
开发者ID:AlyCrunch,项目名称:samples,代码行数:29,代码来源:MembersViewModel.cs


示例4: FavoriteTeamsViewModel

 public FavoriteTeamsViewModel(INavigationService navigationService)
 {
     _navigationService = navigationService;
     daTeams = new ChampionshipsAPIAccess();
     daUsers = new UsersAPIAccess();
     loader = new ResourceLoader();
 }
开发者ID:kevinWillot,项目名称:EuropeanChampionships,代码行数:7,代码来源:FavoriteTeamsViewModel.cs


示例5: 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);
                    }
                }
            }
        }
开发者ID:nidzo732,项目名称:SecureMessaging,代码行数:34,代码来源:WNSHandling.cs


示例6: LoadNavigation

        public void LoadNavigation()
        {
            Nodes = new ObservableCollection<NavigationNode>();
		    var resourceLoader = new ResourceLoader();
            Nodes.Add(new ItemNavigationNode
            {
                Title = @"XenoForums App",
                Label = "Home",
                FontIcon = "\ue10f",
                IsSelected = true,
                NavigationInfo = NavigationInfo.FromPage("HomePage")
            });

            Nodes.Add(new ItemNavigationNode
            {
                Label = "Latest News",
                FontIcon = "\ue12a",
                NavigationInfo = NavigationInfo.FromPage("LatestNewsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Latest Posts",
                FontIcon = "\ue15f",
                NavigationInfo = NavigationInfo.FromPage("LatestPostsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Our YouTube",
                FontIcon = "\ue173",
                NavigationInfo = NavigationInfo.FromPage("OurYouTubeListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Our Staff Members",
                FontIcon = "\ue13d",
                NavigationInfo = NavigationInfo.FromPage("OurStaffMembersListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Server Status",
                FontIcon = "\ue102",
                NavigationInfo = NavigationInfo.FromPage("ServerStatusListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPaneAbout"),
                FontIcon = "\ue11b",
                NavigationInfo = NavigationInfo.FromPage("AboutPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPanePrivacy"),
                FontIcon = "\ue1f7",
                NavigationInfo = new NavigationInfo()
                {
                    NavigationType = NavigationType.DeepLink,
                    TargetUri = new Uri("http://appstudio.windows.com/home/appprivacyterms", UriKind.Absolute)
                }
            });
        }
开发者ID:TheDiamondPicks,项目名称:XenoForums-App,代码行数:60,代码来源:AppNavigation.cs


示例7: FromResourceResponse

		public static TestMessageHandler FromResourceResponse(string key)
		{
			if(s_TestResponses == null)
				s_TestResponses = new Windows.ApplicationModel.Resources.ResourceLoader("TestResponses");
			var testResponse = s_TestResponses.GetString(key);
			return new TestMessageHandler(testResponse);
		}
开发者ID:Gue2014,项目名称:DS2014-GettingStarted,代码行数:7,代码来源:TestMessageHandler.cs


示例8: GetLoader

 private static ResourceLoader GetLoader()
 {
     if (loader == null) {
         loader = ResourceLoader.GetForCurrentView("Intense/Resources");
     }
     return loader;
 }
开发者ID:blinds52,项目名称:intense,代码行数:7,代码来源:ResourceHelper.cs


示例9: CallButton_Click

        private async void CallButton_Click(object sender, RoutedEventArgs e)
        {
            SetEnableState(false);
            ErrorBorder.Visibility = Visibility.Collapsed;

            ResultTextBox.Text = "";

            var function = (string)FunctionComboBox.SelectedItem;
            var arg = ArgumentsTextBox.Text;

            try
            {
                var functionValue = await particleDevice.RunFunctionAsync(function, arg);
                if (functionValue != null)
                    ResultTextBox.Text = Convert.ToString(functionValue.ReturnValue);
            }
            catch
            {
                ResourceLoader resourceLoader = new ResourceLoader();
                ErrorText.Text = resourceLoader.GetString("Error");
                ErrorBorder.Visibility = Visibility.Visible;
            }

            SetEnableState(true);
        }
开发者ID:toolboc,项目名称:particle-app-windows,代码行数:25,代码来源:FunctionsPage.cs


示例10: LoadNavigation

        public void LoadNavigation()
        {
            Nodes = new ObservableCollection<NavigationNode>();
		    var resourceLoader = new ResourceLoader();
            Nodes.Add(new ItemNavigationNode
            {
                Title = @"Windows 10 News",
                Label = "Home",
                FontIcon = "\ue10f",
                IsSelected = true,
                NavigationInfo = NavigationInfo.FromPage("HomePage")
            });

            Nodes.Add(new ItemNavigationNode
            {
                Label = "What's going on",
                FontIcon = "\ue12a",
                NavigationInfo = NavigationInfo.FromPage("WhatsGoingOnListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Recent news",
                FontIcon = "\ue1d7",
                NavigationInfo = NavigationInfo.FromPage("RecentNewsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Apps",
                FontIcon = "\ue15a",
                NavigationInfo = NavigationInfo.FromPage("AppsListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Insider program",
                FontIcon = "\ue178",
                NavigationInfo = NavigationInfo.FromPage("InsiderProgramListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "What are people talking about",
                FontIcon = "\ue134",
                NavigationInfo = NavigationInfo.FromPage("WhatArePeopleTalkingAboutListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = "Do more",
                FontIcon = "\ue12d",
                NavigationInfo = NavigationInfo.FromPage("DoMoreListPage")
            });
            Nodes.Add(new ItemNavigationNode
            {
                Label = resourceLoader.GetString("NavigationPanePrivacy"),
                FontIcon = "\ue1f7",
                NavigationInfo = new NavigationInfo()
                {
                    NavigationType = NavigationType.DeepLink,
                    TargetUri = new Uri("http://appstudio.windows.com/home/appprivacyterms", UriKind.Absolute)
                }
            });
        }
开发者ID:mateerladnam,项目名称:Win10NewsApp,代码行数:60,代码来源:AppNavigation.cs


示例11: ApplicationViewModel

        public ApplicationViewModel(
              ISettingsService settingsService
            , IToolbarStateService toolbarStateService
            )
        {
            var resources = new ResourceLoader();

            AvailableCharsets = new ObservableCharsetCollection(new[] {
                    new DisplayedItem<Charset> { Key = Charset.UTF8, Label = resources.GetString("/Resources/Encoding_UTF8"), },
                    new DisplayedItem<Charset> { Key = Charset.UnicodeLe, Label = resources.GetString("/Resources/Encoding_UnicodeLe"), },
                    new DisplayedItem<Charset> { Key = Charset.UnicodeBe, Label = resources.GetString("/Resources/Encoding_UnicodeBe"), },
                    new DisplayedItem<Charset> { Key = Charset.CentralEasternEurope, Label = resources.GetString("/Resources/Encoding_CentralEasternEurope_1250"), },
                    new DisplayedItem<Charset> { Key = Charset.WesternEurope, Label = resources.GetString("/Resources/Encoding_WesternEurope_1252"), },
                    new DisplayedItem<Charset> { Key = Charset.Greece, Label = resources.GetString("/Resources/Encoding_Greece_1253"), },
                });

            // register an event for changes to the DefaultCharset Setting property.

            settingsService_ = settingsService;
            settingsService_.DefaultCharsetChanged += SettingsService__DefaultCharsetChanged;

            // register an event for changes to the SaveCommandEnabled state.

            toolbarStateService_ = toolbarStateService;
            toolbarStateService_.SaveCommandEnabledChanged += ToolbarStateService__SaveCommandEnabledChanged;
            toolbarStateService_.IsPaneOpenChanged += ToolbarStateService__IsPaneOpenChanged;
        }
开发者ID:springcomp,项目名称:TextPad,代码行数:27,代码来源:ApplicationViewModel.cs


示例12: GetErrorResource

        // *** Methods ***

        public static string GetErrorResource(string resourceName)
        {
            if (errorResourceLoader == null)
                errorResourceLoader = new ResourceLoader("Okra.MEF/Errors");

            return errorResourceLoader.GetString(resourceName);
        }
开发者ID:Valks,项目名称:Okra,代码行数:9,代码来源:ResourceHelper.cs


示例13: Convert

        public object Convert(object value, Type targetType, object parameter, string language)
        {
            var loader = new ResourceLoader();
            var returnValue = string.Format("{0}{1}", loader.GetString("LocalCurrency"),((double)value).ToString(CultureInfo.InvariantCulture));

            return returnValue;
        }
开发者ID:EmiiFont,项目名称:MyShuttle_RC,代码行数:7,代码来源:PriceToStringConverter.cs


示例14: 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);
        }
开发者ID:AntonioJorgeFlorindo,项目名称:StarterKits,代码行数:28,代码来源:MainPage.xaml.cs


示例15: AuthEnforcementHandler

        public AuthEnforcementHandler()
        {
            _resourceLoader = ResourceLoader.GetForCurrentView();

            // We need to be aware of when a sign-in happens.
            AppEnvironment.Instance.CurrentUserChanged += AppEnvironment_CurrentUserChanged;
        }
开发者ID:Microsoft,项目名称:Appsample-Photosharing,代码行数:7,代码来源:AuthEnforcementHandler.cs


示例16: MessageBoxDialog

 public static async void MessageBoxDialog(string message)
 {
     ResourceLoader resourceLoader = new ResourceLoader();
     string messageString = resourceLoader.GetString(message);
     MessageDialog msgbox = new MessageDialog(messageString);
     await msgbox.ShowAsync();
 }
开发者ID:ddumic,项目名称:WP_8_1_helper,代码行数:7,代码来源:MobileHelper.cs


示例17: MainPage

 public MainPage()
 {
     this.InitializeComponent();
     RegisterForSharing();
     RegisterForSettings();
     resources = new ResourceLoader();
 }
开发者ID:tallichet,项目名称:ShareIt,代码行数:7,代码来源:MainPage.xaml.cs


示例18: GetErrorResource

        // *** Methods ***

        public static string GetErrorResource(string resourceName)
        {
            if (s_errorResourceLoader == null)
                s_errorResourceLoader = ResourceLoader.GetForViewIndependentUse(ERROR_RESOURCEMAP);

            return s_errorResourceLoader.GetString(resourceName);
        }
开发者ID:deepakpal9046,项目名称:Okra.Core,代码行数:9,代码来源:ResourceHelper.cs


示例19: Format

 // loads a resource string and runs string.Format on it...
 public static string Format(string name, params object[] args)
 {
     var buf = new ResourceLoader(ResourceMapName).GetString("Resources/" + name);
     if (args.Any())
         return string.Format(buf, args);
     else
         return buf;
 }
开发者ID:jimgrant,项目名称:ProgrammingWindowsStoreApps,代码行数:9,代码来源:StringHelper.cs


示例20: 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);
        }
开发者ID:sriramdasbalaji,项目名称:My-Shuttle-Biz,代码行数:8,代码来源:SettingsPanelHelper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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