Esempio n. 1
0
        public static IList <string> GetUrlListFromEventRef(IntPtr eventRef)
        {
            AEDesc list = GetEventParameter <AEDesc> (eventRef, CarbonEventParameterName.DirectObject, CarbonEventParameterType.AEList);

            try {
                return(AppleEvent.GetUtf8StringListFromAEDesc(ref list, true));
            } finally {
                Carbon.CheckReturn((int)AppleEvent.AEDisposeDesc(ref list));
            }
        }
Esempio n. 2
0
 static CarbonEventHandlerStatus HandleOpenUrls(IntPtr callRef, IntPtr eventRef, IntPtr user_data)
 {
     try {
         var urls = Carbon.GetUrlListFromEventRef(eventRef);
         var args = new ApplicationUrlEventArgs(urls);
         openUrls(null, args);
         return(args.HandledStatus);
     } catch (Exception ex) {
         System.Console.WriteLine(ex);
         return(CarbonEventHandlerStatus.NotHandled);
     }
 }
Esempio n. 3
0
 static CarbonEventHandlerStatus HandleOpenDocuments(IntPtr callRef, IntPtr eventRef, IntPtr user_data)
 {
     try {
         var docs = Carbon.GetFileListFromEventRef(eventRef);
         var args = new ApplicationDocumentEventArgs(docs);
         openDocuments?.Invoke(null, args);
         return(args.HandledStatus);
     } catch (Exception ex) {
         System.Console.WriteLine(ex);
         return(CarbonEventHandlerStatus.NotHandled);
     }
 }
Esempio n. 4
0
 public OSType(string fourcc)
 {
     value = Carbon.ConvertCharCode(fourcc);
 }