本文整理汇总了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);
}
}
示例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);
}
示例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
}
示例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 ();
}
}
示例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 ());
}
示例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 ();
}
}
}
}
示例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 ());
}
示例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();
}