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)); }
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) )); }
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) )); }
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) )); }
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) )); }
// 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); }
// 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 )); }
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) ); }
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) ); }
// 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 ); }
static extern LSResult LSCanURLAcceptURL(IntPtr inItemUrl, IntPtr inTargetUrl, LSRoles inRole, LSAcceptanceFlags inFlags, out byte outAcceptsItem);
static extern LSResult LSSetDefaultRoleHandlerForContentType(IntPtr inContentType, LSRoles inRole, IntPtr inHandlerBundleID);
static extern IntPtr LSCopyAllRoleHandlersForContentType(IntPtr inContentType, LSRoles inRole);
static extern IntPtr LSCopyDefaultApplicationURLForURL(IntPtr inUrl, LSRoles inRole, /*out*/ IntPtr outError);
static extern IntPtr LSCopyDefaultRoleHandlerForContentType(IntPtr inContentType, LSRoles inRole);
static extern IntPtr LSCopyDefaultApplicationURLForContentType(IntPtr inContentType, LSRoles inRole, /*out*/ IntPtr outError);
static extern IntPtr LSCopyApplicationURLsForURL(IntPtr inUrl, LSRoles inRole);
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) ); }
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) ); }
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) )); }
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) ); }
// 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; }
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); }