static bool NeedsDisplayForKey (NSString key) { switch (key.ToString ()) { case "clockColor": return true; default: return CALayer.NeedsDisplayForKey (key); } }
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())); }
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); }
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 }
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 }
// 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 (); } }
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 ()); }
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 (); } } } }
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 ()); }
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(); }