コード例 #1
0
		static bool NeedsDisplayForKey (NSString key)
		{
			switch (key.ToString ()) {
			case "clockColor":
				return true;
			default:
				return CALayer.NeedsDisplayForKey (key);
			}
		}
コード例 #2
0
ファイル: NSString.cs プロジェクト: CartBlanche/maccore
        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()));
        }
コード例 #3
0
ファイル: AppDelegate.cs プロジェクト: GrimReio/PushSharp
		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);
		}
コード例 #4
0
        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
        }
コード例 #5
0
ファイル: NSString.cs プロジェクト: jorik041/maccore
		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
		}
コード例 #6
0
ファイル: OsxDiskArbiter.cs プロジェクト: kelsieflynn/banshee
        // 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 ();
            }
        }
コード例 #7
0
ファイル: NSString.cs プロジェクト: JoeMatt/maccore
		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 ());
		}
コード例 #8
0
ファイル: WindowBackend.cs プロジェクト: TheBrainTech/xwt
		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 ();
					}
				}
			}
		}
コード例 #9
0
ファイル: MacPreferences.cs プロジェクト: kelegorm/awareness
            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 ());
            }
コード例 #10
0
 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();
 }