Beispiel #1
0
        public static bool GetBooleanValue(IntPtr theDict, IntPtr key)
        {
            var value = GetValue(theDict, key);

            if (value == IntPtr.Zero)
            {
                return(false);
            }
            return(CFBoolean.GetValue(value));
        }
Beispiel #2
0
        private string CFBoolean()
        {
            String sBool = new CFBoolean(typeRef).GetDescription();
            Match  match = Regex.Match(sBool, @".*?\{value[\s]*=[\s]*(.*?)\}", RegexOptions.IgnoreCase);

            if (match.Success)
            {
                return(match.Groups[1].Value);
            }
            return("N/A");
        }
        static CFBoolean()
        {
            var handle = Dlfcn.dlopen(Constants.CoreFoundationLibrary, 0);

            if (handle == IntPtr.Zero)
            {
                return;
            }
            try {
                True  = new CFBoolean(Dlfcn.GetIntPtr(handle, "kCFBooleanTrue"), false);
                False = new CFBoolean(Dlfcn.GetIntPtr(handle, "kCFBooleanFalse"), false);
            }
            finally {
                Dlfcn.dlclose(handle);
            }
        }