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

C# NSBundle类代码示例

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

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



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

示例1: Update

		public void Update()
		{
			// Check if a language is in the preferences that we have
			var prefLang = NSUserDefaults.StandardUserDefaults.ArrayForKey("AppleLanguages")[0].ToString();
			var settingsLang = Settings.Current.GetValueOrDefault<string>(Settings.LanguageKey, string.Empty);

			var lang = string.IsNullOrEmpty(settingsLang) ? prefLang : settingsLang;

			// We don't want to have english as default language, because it is the development language
			if (!lang.Equals("en") && Array.IndexOf(NSBundle.MainBundle.Localizations, lang) >= 0)
			{
				langBundle = NSBundle.FromPath(NSBundle.MainBundle.PathForResource(lang, "lproj"));
			}
			else
			{
				// We want to use the default language
				langBundle = null;
			}

			// Activate Vernacular Catalog
			Catalog.Implementation = new ResourceCatalog 
				{
					GetResourceById = id => {
						if (langBundle == null)
							return null;
						var resource = 	langBundle.LocalizedString(id, null);
						return resource == id ? null : resource;
					},
				};
		}
开发者ID:Surfoo,项目名称:WF.Player,代码行数:30,代码来源:LanguageSetter.cs


示例2: SecondViewController

 public SecondViewController(string nibName, NSBundle bundle)
     : base(nibName, bundle)
 {
     this.Title = NSBundle.MainBundle.LocalizedString ("Second", "Second");
     //this.TabBarItem.Image = UIImage.FromBundle ("Images/second");
     this.TabBarItem.Image = UIImage.FromFile("Images/second.png");
 }
开发者ID:GSerjo,项目名称:monotouch-samples,代码行数:7,代码来源:SecondViewController.cs


示例3: EmployeeTableViewController

        public EmployeeTableViewController(string nibName, NSBundle bundle)
            : base(nibName, bundle)
        {
            m_arrEmployee = new ObservableCollection<Employee>();

            Title = NSBundle.MainBundle.LocalizedString("Employees", "Master");
        }
开发者ID:vikewoods,项目名称:KMSDirectoryMono,代码行数:7,代码来源:EmployeeTableViewController.cs


示例4: XIBLessController

 public XIBLessController(string nibName, NibManager nibManager, NSBundle mainBundle)
     : base()
 {
     this.Manager = nibManager;
     this.LoadFromNib(nibName, mainBundle);
     this.ViewDidLoad();
 }
开发者ID:dtavlikos,项目名称:JTNibManager,代码行数:7,代码来源:XIBLessController.cs


示例5: setLanguage

		public static void setLanguage(string language)
		{
			if(!isLanguageSupport(language))
				language = "en";
			string path = NSBundle.MainBundle.PathForResource(language,"lproj");
			bundle = NSBundle.FromPath (path);
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:7,代码来源:TCLocalizabled.cs


示例6: PhotoViewController

		public PhotoViewController (string nibName, NSBundle bundle) : base (NSObjectFlag.Empty)
		{
			photoMap = new Dictionary<NSUrl, string> ();
# if USE_FULLSCREEN_LAYOUT
			WantsFullScreenLayout = true;
#endif
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:7,代码来源:PhotoViewController.cs


示例7: MainViewController

		public MainViewController (string nibName, NSBundle bundle) : base (nibName, bundle)
		{
			// Custom initialization
			info.TipValueChanged += (sender, e) => {
				TipValue.Text  = info.TipValue.ToString ();
				Total.Text     = (info.TipValue + info.Total).ToString ();
			};
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:8,代码来源:MainViewController.cs


示例8: MvxSimpleTableViewSource

 public MvxSimpleTableViewSource(UITableView tableView, string nibName, string cellIdentifier = null,
                                 NSBundle bundle = null)
     : base(tableView)
 {
     cellIdentifier = cellIdentifier ?? "CellId" + nibName;
     _cellIdentifier = new NSString(cellIdentifier);
     tableView.RegisterNibForCellReuse(UINib.FromName(nibName, bundle ?? NSBundle.MainBundle), cellIdentifier);
 }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:8,代码来源:MvxSimpleTableViewSource.cs


示例9: MvxSimpleTableViewSource

 public MvxSimpleTableViewSource(UITableView tableView, string nibName, string cellIdentifier = null,
                                 NSBundle bundle = null)
     : base(tableView)
 {
     // if no cellIdentifier supplied, then use the nibName as cellId
     cellIdentifier = cellIdentifier ?? nibName;
     this._cellIdentifier = new NSString(cellIdentifier);
     tableView.RegisterNibForCellReuse(UINib.FromName(nibName, bundle ?? NSBundle.MainBundle), cellIdentifier);
 }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:9,代码来源:MvxSimpleTableViewSource.cs


示例10: MasterViewController

		public MasterViewController (string nibNameOrNull, NSBundle nibBundleOrNull) : base (nibNameOrNull, nibBundleOrNull)
		{
			titles [0] = "Faust - Erste Szene";
			titles [1] = "Julius Caesar - Antony's speech";
			titles [2] = "Midsummer Night's Dream - Exit speech";
			titles [3] = "Romeo & Juliet - Queen Mab";
			titles [4] = "Troilus and Cressida - Ulysses";

			LoadPagesFromResource ("/Pages");
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:10,代码来源:MasterViewController.cs


示例11: Settings

        static Settings()
        {
            string resourcePath = NSBundle.MainBundle.PathForResource(NSLocale.PreferredLanguages[0], "lproj");
            if(string.IsNullOrEmpty(resourcePath))
            {
                resourcePath = NSBundle.MainBundle.PathForResource("en", "lproj");
            }

            localeBundle = NSBundle.FromPath(resourcePath);
        }
开发者ID:zekiller3,项目名称:SMSParty,代码行数:10,代码来源:Settings.cs


示例12: GetBackgroundModes

        static string[] GetBackgroundModes(NSBundle bundle)
        {
            var backgroundModes = bundle.ObjectForInfoDictionary("UIBackgroundModes");

            if (backgroundModes == null)
            {
                return new string[0];
            }

            return NSArray.StringArrayFromHandle(backgroundModes.Handle);
        }
开发者ID:tomgilder,项目名称:RxPosition,代码行数:11,代码来源:NSBundleExtentions.cs


示例13: MvxTouchControl

        public MvxTouchControl(string nibName, NSBundle bundle)
            : base(nibName, bundle)
        {
            //Hack: iOS crashes if you create a MvxUIViewController without DataContext
            DataContext = new object ();

            if (!Mvx.CanResolve<IMvxControlsContainer>())
                new Plugin().Load();

            _container = Mvx.Resolve<IMvxControlsContainer>();
            _container.Add(this);
        }
开发者ID:ChristianRuiz,项目名称:MvvmCross-ControlsNavigation,代码行数:12,代码来源:MvxTouchControl.cs


示例14: RequestAuthorization

 public static void RequestAuthorization(this CLLocationManager manager, NSBundle bundle)
 {
     if (bundle.RequiresBackgroundLocation())
     {
         bundle.ThrowIfNoBackgroundDescription();
         manager.RequestAlwaysAuthorization();
     }
     else
     {
         bundle.ThrowIfNoInUseDescription();
         manager.RequestWhenInUseAuthorization();
     }
 }
开发者ID:tomgilder,项目名称:RxPosition,代码行数:13,代码来源:CLLocationManagerAuthorizeExtentions.cs


示例15: ThrowIfNoDescription

        static void ThrowIfNoDescription(NSBundle bundle, string key)
        {
            if (!UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                return;
            }

            var backgroundModes = bundle.ObjectForInfoDictionary(key);
            if (backgroundModes == null)
            {
                throw new InvalidOperationException(string.Format("You must provide a value for {0} in Info.plist to use location services", key));
            }
        }
开发者ID:tomgilder,项目名称:RxPosition,代码行数:13,代码来源:NSBundleExtentions.cs


示例16: MvxTableViewController

 protected MvxTableViewController(string nibName, NSBundle bundle)
     : base(nibName, bundle)
 {
     this.AdaptForBinding();
 }
开发者ID:indazoo,项目名称:MvvmCross_DesignData,代码行数:5,代码来源:MvxTableViewController.cs


示例17: MvxEventSourceTableViewController

 protected MvxEventSourceTableViewController(string nibName, NSBundle bundle)
     : base(nibName, bundle)
 {
 }
开发者ID:MvvmCross,项目名称:MvvmCross,代码行数:4,代码来源:MvxEventSourceTableViewController.cs


示例18: TCConsultationTemplateViewController

		public TCConsultationTemplateViewController (string nibName, NSBundle bundle) : base (nibName, bundle)
		{
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:3,代码来源:TCConsultationTemplateViewController.cs


示例19: LoadFromNib

 public void LoadFromNib(string nibName, NSBundle bundle)
 {
     this.Manager.LoadController<XIBLessController>(this, nibName, bundle);
 }
开发者ID:dtavlikos,项目名称:JTNibManager,代码行数:4,代码来源:XIBLessController.cs


示例20: RotatingViewController

		public RotatingViewController (string nibName, NSBundle bundle) : base(nibName, bundle)
		{
		}
开发者ID:Clancey,项目名称:MonoTouch.Dialog,代码行数:3,代码来源:RotatingViewController.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NSCoder类代码示例发布时间:2022-05-24
下一篇:
C# NSAutoreleasePool类代码示例发布时间: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