コード例 #1
0
        public NSAppleScript(string source)
            : base(NSObjectFlag.Empty)
        {
            IntPtr str = NSString.CreateNative(source);

            if (IsDirectBinding)
            {
                base.Handle = Messaging.IntPtr_objc_msgSend_IntPtr(base.Handle, Selector.GetHandle("initWithSource:"), str);
            }
            else
            {
                base.Handle = Messaging.IntPtr_objc_msgSendSuper_IntPtr(base.SuperHandle, Selector.GetHandle("initWithSource:"), str);
            }
            NSString.ReleaseNative(str);
        }
コード例 #2
0
        public virtual void Unschedule(NSRunLoop aRunLoop, string forMode)
        {
            if (aRunLoop == null)
            {
                throw new ArgumentNullException("aRunLoop");
            }
            if (forMode == null)
            {
                throw new ArgumentNullException("forMode");
            }
            var nsforMode = NSString.CreateNative(forMode);

            if (IsDirectBinding)
            {
                Messaging.void_objc_msgSend_IntPtr_IntPtr(this.Handle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode);
            }
            else
            {
                Messaging.void_objc_msgSendSuper_IntPtr_IntPtr(this.SuperHandle, selUnscheduleFromRunLoopForMode_, aRunLoop.Handle, nsforMode);
            }
            NSString.ReleaseNative(nsforMode);
        }
コード例 #3
0
ファイル: NSUuid.cs プロジェクト: NikoXu/maccore
        public NSUuid(string str)
            : base(NSObjectFlag.Empty)
        {
            if (str == null)
            {
                throw new ArgumentNullException("str");
            }
            var nsstr = NSString.CreateNative(str);

            if (IsDirectBinding)
            {
                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_IntPtr(this.Handle, Selector.GetHandle("initWithUUIDString:"), nsstr);
            }
            else
            {
                Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_IntPtr(this.SuperHandle, Selector.GetHandle("initWithUUIDString:"), nsstr);
            }
            NSString.ReleaseNative(nsstr);
            if (Handle == IntPtr.Zero)
            {
                throw new ArgumentException("Could not create NSUuid from string: " + str, "str");
            }
        }