public void HandleAppleEvent(NSAppleEventDescriptor evt, NSAppleEventDescriptor replyEvt) { var url = evt.ParamDescriptorForKeyword(DirectObject).StringValue; var uri = new Uri(url); OpenUrl(WebUtils.GetNativeUrl(uri)); }
void GetUrlWithReplyEvent(NSAppleEventDescriptor @event, NSAppleEventDescriptor replyEvent) { // from /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AppleEvents.h const uint keyDirectObject = 757935405; // '----' const uint keyErrorNumber = 1701999214; // 'errn' const uint keyErrorString = 1701999219; // 'errs' string errorMessage = null; var urlString = @event?.ParamDescriptorForKeyword(keyDirectObject).StringValue; if (urlString != null) { SessionDocumentController .SharedDocumentController .OpenDocument(new NSUrl(urlString)); applicationShouldOpenUntitledFile = false; } replyEvent.SetParamDescriptorforKeyword( NSAppleEventDescriptor.DescriptorWithInt32(errorMessage == null ? 0 : 1), keyErrorNumber); if (errorMessage != null) { replyEvent.SetParamDescriptorforKeyword( NSAppleEventDescriptor.DescriptorWithString(errorMessage), keyErrorString); } }
public void GetUrl(NSAppleEventDescriptor evt, NSAppleEventDescriptor withReplyEvent) { passedUrl = evt.ParamDescriptorForKeyword(FourCC("----")).StringValue; if (isLoaded) { invoke.Invoke(LoadPassedUrl); } }
public void MonoApplication_HandleURLEvent(NSAppleEventDescriptor value, NSAppleEventDescriptor reply) { var url = value.ParamDescriptorForKeyword(AEKeyword.DirectObject)?.StringValue; if (url != null) { TryOpen(new string[] { url }, Msg.WM_OPEN_URLS); } }
private void HandleGetURLEvent(NSAppleEventDescriptor descriptor, NSAppleEventDescriptor replyEvent) { // Breakpoint here, debug normally and *then* call your URL try { var keyDirectObject = "----"; var keyword = (((uint)keyDirectObject[0]) << 24 | ((uint)keyDirectObject[1]) << 16 | ((uint)keyDirectObject[2]) << 8 | ((uint)keyDirectObject[3])); var openinArgs = descriptor.ParamDescriptorForKeyword(keyword).StringValue; ParseOpeningString(openinArgs); } catch { } }
private void HandleGetURLEvent(NSAppleEventDescriptor descriptor, NSAppleEventDescriptor replyEvent) { // stackoverflow.com/questions/1945 // https://forums.xamarin.com/discussion/9774/custom-url-schema-handling var keyDirectObject = "----"; var keyword = (((uint)keyDirectObject[0]) << 24 | ((uint)keyDirectObject[1]) << 16 | ((uint)keyDirectObject[2]) << 8 | ((uint)keyDirectObject[3])); var urlString = descriptor.ParamDescriptorForKeyword(keyword).StringValue; using (var alert = new NSAlert()){ alert.MessageText = urlString; alert.RunSheetModal(null); } }
void HandleGetUrlEvent(NSAppleEventDescriptor descriptor, NSAppleEventDescriptor reply) { var openUrlEvent = OpenUrl; if (openUrlEvent == null) { return; } string keyDirectObjectString = "----"; uint keywordDirectObject = (((uint)keyDirectObjectString [0]) << 24 | ((uint)keyDirectObjectString [1]) << 16 | ((uint)keyDirectObjectString [2]) << 8 | ((uint)keyDirectObjectString [3])); string urlString = descriptor.ParamDescriptorForKeyword(keywordDirectObject).ToString(); openUrlEvent(NSApplication.SharedApplication, new OpenUrlEventArgs(urlString)); }
void HandleGetUrlEvent(NSAppleEventDescriptor descriptor, NSAppleEventDescriptor reply) { var openUrlEvent = OpenUrl; if (openUrlEvent == null) return; string keyDirectObjectString = "----"; uint keywordDirectObject = (((uint)keyDirectObjectString [0]) << 24 | ((uint)keyDirectObjectString [1]) << 16 | ((uint)keyDirectObjectString [2]) << 8 | ((uint)keyDirectObjectString [3])); string urlString = descriptor.ParamDescriptorForKeyword (keywordDirectObject).ToString (); openUrlEvent (NSApplication.SharedApplication, new OpenUrlEventArgs (urlString)); }
public void UrlHandleEvent (NSAppleEventDescriptor evt, NSAppleEventDescriptor replyEvt) { var url = evt.ParamDescriptorForKeyword (AppleEventParameters.DirectObject).StringValue; SimpleAuth.NativeSafariAuthenticator.ResumeAuth (url); }
internal virtual void HandleGetURLEvent(NSAppleEventDescriptor ae, NSAppleEventDescriptor aeReply) { string url = ae.ParamDescriptorForKeyword(AEKeyword.DirectObject).StringValue; TryOpenFiles(new string[] { url }, Msg.WM_OPEN_URLS); }
public void UrlHandleEvent(NSAppleEventDescriptor evt, NSAppleEventDescriptor replyEvt) { var url = evt.ParamDescriptorForKeyword(AppleEventParameters.DirectObject).StringValue; SimpleAuth.NativeSafariAuthenticator.ResumeAuth(url); }