예제 #1
0
        public static bool CanUrlAcceptUrl(NSUrl itemUrl, NSUrl targetUrl,
                                           LSRoles roles = LSRoles.All, LSAcceptanceFlags acceptanceFlags = LSAcceptanceFlags.Default)
        {
            LSResult result;

            return(CanUrlAcceptUrl(itemUrl, targetUrl, roles, acceptanceFlags, out result));
        }
예제 #2
0
        public static string [] GetAllRoleHandlersForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
            {
                throw new ArgumentNullException(nameof(contentType));
            }

            return(NSArray.StringArrayFromHandle(
                       LSCopyAllRoleHandlersForContentType(new NSString(contentType).Handle, roles)
                       ));
        }
예제 #3
0
        public static string GetDefaultRoleHandlerForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
            {
                throw new ArgumentNullException(nameof(contentType));
            }

            return((string)Runtime.GetNSObject <NSString> (
                       LSCopyDefaultRoleHandlerForContentType(new NSString(contentType).Handle, roles)
                       ));
        }
예제 #4
0
        public static NSUrl [] GetApplicationUrlsForUrl(NSUrl url, LSRoles roles = LSRoles.All)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            return(NSArray.ArrayFromHandle <NSUrl> (
                       LSCopyApplicationURLsForURL(url.Handle, roles)
                       ));
        }
예제 #5
0
        public static NSUrl GetDefaultApplicationUrlForUrl(NSUrl url, LSRoles roles = LSRoles.All)
        {
            if (url == null)
            {
                throw new ArgumentNullException(nameof(url));
            }

            return(Runtime.GetNSObject <NSUrl> (
                       LSCopyDefaultApplicationURLForURL(url.Handle, roles, IntPtr.Zero)
                       ));
        }
예제 #6
0
        // NOTE: intentionally inverting the status results (return bool, with an out
        // LSResult vs return LSResult with an out bool) to make the API nicer to use
        public static bool CanUrlAcceptUrl(NSUrl itemUrl, NSUrl targetUrl,
                                           LSRoles roles, LSAcceptanceFlags acceptanceFlags, out LSResult result)
        {
            if (itemUrl == null)
            {
                throw new ArgumentNullException(nameof(itemUrl));
            }
            if (targetUrl == null)
            {
                throw new ArgumentNullException(nameof(targetUrl));
            }

            byte acceptsItem;

            result = LSCanURLAcceptURL(itemUrl.Handle, targetUrl.Handle, roles, acceptanceFlags, out acceptsItem);
            return(acceptsItem != 0);
        }
예제 #7
0
        // NOTE: intentionally swapped handlerBundleId and roles parameters for a nicer API
        public static LSResult SetDefaultRoleHandlerForContentType(string contentType, string handlerBundleId,
                                                                   LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
            {
                throw new ArgumentNullException(nameof(contentType));
            }
            if (handlerBundleId == null)
            {
                throw new ArgumentNullException(nameof(handlerBundleId));
            }

            return(LSSetDefaultRoleHandlerForContentType(
                       new NSString(contentType).Handle,
                       roles,
                       new NSString(handlerBundleId).Handle
                       ));
        }
예제 #8
0
        public static string GetDefaultRoleHandlerForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
                throw new ArgumentNullException (nameof (contentType));

            return (string)Runtime.GetNSObject<NSString> (
                LSCopyDefaultRoleHandlerForContentType (new NSString (contentType).Handle, roles)
            );
        }
예제 #9
0
        public static NSUrl GetDefaultApplicationUrlForUrl(NSUrl url, LSRoles roles = LSRoles.All)
        {
            if (url == null)
                throw new ArgumentNullException (nameof (url));

            return Runtime.GetNSObject<NSUrl> (
                LSCopyDefaultApplicationURLForURL (url.Handle, roles, IntPtr.Zero)
            );
        }
예제 #10
0
        // NOTE: intentionally swapped handlerBundleId and roles parameters for a nicer API
        public static LSResult SetDefaultRoleHandlerForContentType(string contentType, string handlerBundleId,
            LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
                throw new ArgumentNullException (nameof (contentType));
            if (handlerBundleId == null)
                throw new ArgumentNullException (nameof (handlerBundleId));

            return LSSetDefaultRoleHandlerForContentType (
                new NSString (contentType).Handle,
                roles,
                new NSString (handlerBundleId).Handle
            );
        }
예제 #11
0
 static extern LSResult LSCanURLAcceptURL(IntPtr inItemUrl, IntPtr inTargetUrl,
                                          LSRoles inRole, LSAcceptanceFlags inFlags, out byte outAcceptsItem);
예제 #12
0
 static extern LSResult LSSetDefaultRoleHandlerForContentType(IntPtr inContentType,
                                                              LSRoles inRole, IntPtr inHandlerBundleID);
예제 #13
0
 static extern IntPtr LSCopyAllRoleHandlersForContentType(IntPtr inContentType, LSRoles inRole);
예제 #14
0
 static extern IntPtr LSCopyDefaultApplicationURLForURL(IntPtr inUrl, LSRoles inRole, /*out*/ IntPtr outError);
예제 #15
0
 static extern IntPtr LSCopyDefaultRoleHandlerForContentType(IntPtr inContentType, LSRoles inRole);
예제 #16
0
 static extern IntPtr LSCopyDefaultRoleHandlerForContentType(IntPtr inContentType, LSRoles inRole);
예제 #17
0
 static extern LSResult LSSetDefaultRoleHandlerForContentType(IntPtr inContentType,
     LSRoles inRole, IntPtr inHandlerBundleID);
예제 #18
0
 static extern IntPtr LSCopyDefaultApplicationURLForURL(IntPtr inUrl, LSRoles inRole, /*out*/ IntPtr outError);
예제 #19
0
 static extern IntPtr LSCopyDefaultApplicationURLForContentType(IntPtr inContentType, LSRoles inRole, /*out*/ IntPtr outError);
예제 #20
0
 static extern IntPtr LSCopyApplicationURLsForURL(IntPtr inUrl, LSRoles inRole);
예제 #21
0
 static extern IntPtr LSCopyAllRoleHandlersForContentType(IntPtr inContentType, LSRoles inRole);
예제 #22
0
        public static string[] GetAllRoleHandlersForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
                throw new ArgumentNullException (nameof (contentType));

            return NSArray.StringArrayFromHandle (
                LSCopyAllRoleHandlersForContentType (new NSString (contentType).Handle, roles)
            );
        }
예제 #23
0
        public static NSUrl GetDefaultApplicationUrlForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
                throw new ArgumentNullException (nameof (contentType));

            return Runtime.GetNSObject<NSUrl> (
                LSCopyDefaultApplicationURLForContentType (new NSString (contentType).Handle, roles, IntPtr.Zero)
            );
        }
예제 #24
0
        public static NSUrl GetDefaultApplicationUrlForContentType(string contentType, LSRoles roles = LSRoles.All)
        {
            if (contentType == null)
            {
                throw new ArgumentNullException(nameof(contentType));
            }

            return(Runtime.GetNSObject <NSUrl> (
                       LSCopyDefaultApplicationURLForContentType(new NSString(contentType).Handle, roles, IntPtr.Zero)
                       ));
        }
예제 #25
0
        public static NSUrl[] GetApplicationUrlsForUrl(NSUrl url, LSRoles roles = LSRoles.All)
        {
            if (url == null)
                throw new ArgumentNullException (nameof (url));

            return NSArray.ArrayFromHandle<NSUrl> (
                LSCopyApplicationURLsForURL (url.Handle, roles)
            );
        }
예제 #26
0
 static extern IntPtr LSCopyApplicationURLsForURL(IntPtr inUrl, LSRoles inRole);
예제 #27
0
        // NOTE: intentionally inverting the status results (return bool, with an out
        // LSResult vs return LSResult with an out bool) to make the API nicer to use
        public static bool CanUrlAcceptUrl(NSUrl itemUrl, NSUrl targetUrl,
            LSRoles roles, LSAcceptanceFlags acceptanceFlags, out LSResult result)
        {
            if (itemUrl == null)
                throw new ArgumentNullException (nameof (itemUrl));
            if (targetUrl == null)
                throw new ArgumentNullException (nameof (targetUrl));

            byte acceptsItem;
            result = LSCanURLAcceptURL (itemUrl.Handle, targetUrl.Handle, roles, acceptanceFlags, out acceptsItem);
            return acceptsItem != 0;
        }
예제 #28
0
 static extern LSResult LSCanURLAcceptURL(IntPtr inItemUrl, IntPtr inTargetUrl,
     LSRoles inRole, LSAcceptanceFlags inFlags, out byte outAcceptsItem);
예제 #29
0
 static extern IntPtr LSCopyDefaultApplicationURLForContentType(IntPtr inContentType, LSRoles inRole, /*out*/ IntPtr outError);
예제 #30
0
 public static bool CanUrlAcceptUrl(NSUrl itemUrl, NSUrl targetUrl,
     LSRoles roles = LSRoles.All, LSAcceptanceFlags acceptanceFlags = LSAcceptanceFlags.Default)
 {
     LSResult result;
     return CanUrlAcceptUrl (itemUrl, targetUrl, roles, acceptanceFlags, out result);
 }