Author: urs
Date: 2005-04-27 15:28:29 -0400 (Wed, 27 Apr 2005)
New Revision: 43679
Added:
trunk/cocoa-sharp/generator/custom/Foundation/NSRange.addin
Modified:
trunk/cocoa-sharp/generator/custom/Foundation/TypeConverter.cs
Log:
add NSRange
Added: trunk/cocoa-sharp/generator/custom/Foundation/NSRange.addin
===================================================================
--- trunk/cocoa-sharp/generator/custom/Foundation/NSRange.addin 2005-04-27
18:48:18 UTC (rev 43678)
+++ trunk/cocoa-sharp/generator/custom/Foundation/NSRange.addin 2005-04-27
19:28:29 UTC (rev 43679)
@@ -0,0 +1,10 @@
+ public uint location;
+ public uint length;
+
+ public uint Max { get { return location + length; } }
+ public bool LocationInRange(uint loc) { return loc - location <
length; }
+
+ public NSRange(uint location, uint length) {
+ this.location = location;
+ this.length = length;
+ }
Modified: trunk/cocoa-sharp/generator/custom/Foundation/TypeConverter.cs
===================================================================
--- trunk/cocoa-sharp/generator/custom/Foundation/TypeConverter.cs
2005-04-27 18:48:18 UTC (rev 43678)
+++ trunk/cocoa-sharp/generator/custom/Foundation/TypeConverter.cs
2005-04-27 19:28:29 UTC (rev 43679)
@@ -122,7 +122,7 @@
return nsObj.Raw;
string str = obj as string;
if (str != null)
- return new NSString(str).Raw;
+ return
((NSString)(NSString.StringWithUTF8String(str))).Raw;
throw new Exception("Net2NS: not handled type of
object: " + obj.GetType());
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches