Esempio n. 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);
        }
Esempio n. 2
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);
        }
 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
     }
 }
        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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 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);
            }
        }
Esempio n. 8
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;
		}
Esempio n. 9
0
 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;
     }
 }
Esempio n. 10
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;
     }
 }
Esempio n. 11
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
     }
 }
Esempio n. 12
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;
 }