コード例 #1
0
        public bool GetStream(int idx, out CGPDFStream result)
        {
            IntPtr ptr;
            var    r = CGPDFArrayGetStream(handle, idx, out ptr);

            result = r ? new CGPDFStream(ptr) : null;
            return(r);
        }
コード例 #2
0
        static IntPtr Create(CGPDFStream stream, NSDictionary?streamResources = null, CGPDFContentStream?parent = null)
        {
            if (stream is null)
            {
                throw new ArgumentNullException(nameof(stream));
            }

            return(CGPDFContentStreamCreateWithStream(stream.Handle, streamResources.GetHandle(), parent.GetHandle()));
        }
コード例 #3
0
        public bool GetStream(string key, out CGPDFStream result)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            IntPtr ptr;
            var    r = CGPDFDictionaryGetStream(handle, key, out ptr);

            result = r ? new CGPDFStream(ptr) : null;
            return(r);
        }
コード例 #4
0
 public CGPDFStream[] GetStreams()
 {
     using (CFArray a = new CFArray(CGPDFContentStreamGetStreams(Handle))) {
         var streams = new CGPDFStream [a.Count];
         for (int i = 0; i < a.Count; i++)
         {
             streams [i] = new CGPDFStream(a.GetValue(i));
         }
         return(streams);
         // note: CGPDFStreamRef is weird because it has no retain/release calls unlike other CGPDF* types
     }
 }
コード例 #5
0
        public CGPDFContentStream(CGPDFStream stream, NSDictionary streamResources = null, CGPDFContentStream parent = null)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            var dh = streamResources == null ? IntPtr.Zero : streamResources.Handle;
            var ph = parent == null ? IntPtr.Zero : parent.Handle;

            Handle = CGPDFContentStreamCreateWithStream(stream.Handle, dh, ph);
        }
コード例 #6
0
ファイル: CGPDFObject.cs プロジェクト: tondat/xamarin-macios
        public bool TryGetValue(out CGPDFStream value)
        {
            IntPtr ip;

            if (CGPDFObjectGetValue(Handle, CGPDFObjectType.Stream, out ip))
            {
                value = new CGPDFStream(ip);
                return(true);
            }
            else
            {
                value = null;
                return(false);
            }
        }
コード例 #7
0
        public bool TryPop(out CGPDFStream value)
        {
            IntPtr ip;

            if (CGPDFScannerPopStream(Handle, out ip))
            {
                value = new CGPDFStream(ip);
                return(true);
            }
            else
            {
                value = null;
                return(false);
            }
        }
コード例 #8
0
 public bool GetStream(int idx, out CGPDFStream result)
 {
     return(GetStream((nint)idx, out result));
 }
コード例 #9
0
 public CGPDFContentStream(CGPDFStream stream, NSDictionary?streamResources = null, CGPDFContentStream?parent = null)
     : base(Create(stream, streamResources, parent), true)
 {
 }