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


C# NSString.ToString方法代码示例

本文整理汇总了C#中MonoMac.Foundation.NSString.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# NSString.ToString方法的具体用法?C# NSString.ToString怎么用?C# NSString.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoMac.Foundation.NSString的用法示例。


在下文中一共展示了NSString.ToString方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NeedsDisplayForKey

		static bool NeedsDisplayForKey (NSString key)
		{
			switch (key.ToString ()) {
			case "clockColor":
				return true;
			default:
				return CALayer.NeedsDisplayForKey (key);
			}
		}
开发者ID:Anomalous-Software,项目名称:monomac,代码行数:9,代码来源:ClockLayer.cs

示例2: RegisteredForRemoteNotifications

		public override void RegisteredForRemoteNotifications (NSApplication application, NSData deviceToken)
		{
			var oldDeviceToken = NSUserDefaults.StandardUserDefaults.StringForKey("PushDeviceToken");
			
			//There's probably a better way to do this
			var strFormat = new NSString("%@");
			var dt = new NSString(MonoTouch.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(new MonoTouch.ObjCRuntime.Class("NSString").Handle, new MonoTouch.ObjCRuntime.Selector("stringWithFormat:").Handle, strFormat.Handle, deviceToken.Handle));
			var newDeviceToken = dt.ToString().Replace("<", "").Replace(">", "").Replace(" ", "");
			
			if (string.IsNullOrEmpty(oldDeviceToken) || !deviceToken.Equals(newDeviceToken))
			{
				//TODO: Put your own logic here to notify your server that the device token has changed/been created!
			}
			
			//Save device token now
			NSUserDefaults.StandardUserDefaults.SetString(newDeviceToken, "PushDeviceToken");
			
			Console.WriteLine("Device Token: " + newDeviceToken);
		}
开发者ID:GrimReio,项目名称:PushSharp,代码行数:19,代码来源:AppDelegate.cs

示例3: Equals

		public static bool Equals (NSString a, NSString b)
                {
			if ((a as object) == (b as object))
				return true;

			if (((object) a) == null || ((object) b) == null)
				return false;

			if (a.Handle == b.Handle)
				return true;
#if GENERATOR || COREBUILD
			return a.ToString ().Equals (b.ToString ());
#else
			return a.IsEqualTo (b.Handle);
#endif
		}
开发者ID:jorik041,项目名称:maccore,代码行数:16,代码来源:NSString.cs

示例4: UrlToFileSystemPath

        // we need to map the volumeUrl's to pathes
        // like file://localhost/Volumes/Mountpoint -> /Volumes/MountPoint
        public static string UrlToFileSystemPath(string url, uint mode)
        {
            if (url == null) {
                throw new ArgumentException ("url cannot be null");
            }

            using (var arp = new NSAutoreleasePool ()) {
                NSUrl nsurl =  new NSUrl (url);
                NSString path = new NSString (CoreFoundation.CFURLCopyFileSystemPath (nsurl.Handle, mode));
                return path.ToString ();
            }
        }
开发者ID:kelsieflynn,项目名称:banshee,代码行数:14,代码来源:OsxDiskArbiter.cs

示例5: Equals

		public static bool Equals (NSString a, NSString b)
                {
			if ((a as object) == (b as object))
				return true;

			if (((object) a) == null || ((object) b) == null)
				return false;

			if (a.Handle == b.Handle)
				return true;

			return a.ToString ().Equals (b.ToString ());
		}
开发者ID:JoeMatt,项目名称:maccore,代码行数:13,代码来源:NSString.cs

示例6: ObserveValue

		public override void ObserveValue (NSString keyPath, NSObject ofObject, NSDictionary change, IntPtr context)
		{
			if (keyPath.ToString () == HiddenProperty.ToString () && ofObject.Equals (ContentView)) {
				if (ContentView.Hidden) {
					if (eventsEnabled.HasFlag (WindowFrameEvent.Hidden)) {
						OnHidden ();
					}
				} else {
					if (eventsEnabled.HasFlag (WindowFrameEvent.Shown)) {
						OnShown ();
					}
				}
			}
		}
开发者ID:TheBrainTech,项目名称:xwt,代码行数:14,代码来源:WindowBackend.cs

示例7: ObserveValue

            public override void ObserveValue(NSString key, NSObject of, NSDictionary change, IntPtr context)
            {
                // TODO why is key sometimes null?
                if (key == null) return;

                Observe (key.ToString ());
            }
开发者ID:kelegorm,项目名称:awareness,代码行数:7,代码来源:MacPreferences.cs

示例8: observeValueForKeyPath

 private void observeValueForKeyPath(NSString keyPath, NSArrayController ofObject, NSDictionary change, IntPtr context)
 {
     Console.Write(String.Format("Table selection changed: keyPath = {0} : ",
         keyPath.ToString()));
     for(uint idx = 0; idx < ofObject.SelectionIndexes.Count; idx++)
     {
         Console.Write(ofObject.SelectionIndexes.IndexGreaterThanOrEqual(idx) + " ");
     }
     Console.WriteLine();
 }
开发者ID:unsliced,项目名称:head-race-management,代码行数:10,代码来源:MainWindowController.cs


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