Now i'm able to get the a c# string from a CFString :)
[firemac.git] / Fireball.Carbon / test / Program.cs
blob942316a0f1b3ca7ae9f0167e08325c7768a9d12f
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using Fireball.Carbon;
5 using System.IO;
7 namespace test
9 class Program
11 static void Main(string[] args)
13 IntPtr pt = IntPtr.Zero;
14 try
17 /* CGRect rect = new CGRect();
18 rect.origin = new CGPoint();
19 rect.size = new CGSize();
20 rect.size.height = 480;
21 rect.size.width = 640;
23 pt = CGContextRef.CGPDFContextCreateWithURL("/Users/dotnetfireball/py.pdf",
24 rect, null);*/
25 CFStringRef rs = new CFStringRef("hello");
26 // rs = (CFStringRef)rs.Clone();
27 pt = rs.Pointer;
29 Console.WriteLine(pt.ToString());
31 string s = rs.ToString();
32 if(!string.IsNullOrEmpty(s))
33 Console.WriteLine("S:" + s);
34 else
35 Console.WriteLine("La stringa e' nulla!");
37 catch(Exception ex)
39 File.AppendAllText("/Users/dotnetfireball/out.txt", ex.ToString());
42 File.AppendAllText("/Users/dotnetfireball/out.txt", string.Format("Pointer {0}", pt));