本文整理汇总了C#中MonoMac.Foundation.NSString.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# NSString.Dispose方法的具体用法?C# NSString.Dispose怎么用?C# NSString.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MonoMac.Foundation.NSString
的用法示例。
在下文中一共展示了NSString.Dispose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddLoginItem
public static void AddLoginItem (string path)
{
if (path == null)
throw new ArgumentNullException ("path");
var nspath = new NSString (path);
MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (class_ptr, selAddLoginItem, nspath.Handle);
nspath.Dispose ();
}
示例2: GlobalSetClassName
public static void GlobalSetClassName (string name, Class kls)
{
if (name == null)
throw new ArgumentNullException ("name");
if (kls == null)
throw new ArgumentNullException ("kls");
var nsname = new NSString (name);
MonoMac.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr (class_ptr, Selector.GetHandle (selSetClassNameForClass_), nsname.Handle, kls.Handle);
nsname.Dispose ();
}
示例3: CLRegion
public CLRegion (CLLocationCoordinate2D center, System.Double radius, string identifier) : base (NSObjectFlag.Empty)
{
if (identifier == null)
throw new ArgumentNullException ("identifier");
var nsidentifier = new NSString (identifier);
if (IsDirectBinding) {
Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSend_CLLocationCoordinate2D_Double_IntPtr (this.Handle, selInitCircularRegionWithCenterRadiusIdentifier, center, radius, nsidentifier.Handle);
} else {
Handle = MonoMac.ObjCRuntime.Messaging.IntPtr_objc_msgSendSuper_CLLocationCoordinate2D_Double_IntPtr (this.SuperHandle, selInitCircularRegionWithCenterRadiusIdentifier, center, radius, nsidentifier.Handle);
}
nsidentifier.Dispose ();
}
示例4: ExtractAccessoryInfo
static AccessoryInfo[] ExtractAccessoryInfo (IntPtr ptr, NSString id, NSString description)
{
using (var array = new CFArray (ptr)) {
var res = new AccessoryInfo [array.Count];
for (int i = 0; i < res.Length; ++i) {
var dict = array.GetValue (i);
var n = new NSNumber (CFDictionary.GetValue (dict, id.Handle));
var desc = CFString.FetchString (CFDictionary.GetValue (dict, description.Handle));
res [i] = new AccessoryInfo ((int) n, desc);
id.Dispose ();
}
return res;
}
}
示例5: CreateRequest
public static CFHTTPMessage CreateRequest (Uri uri, string method, Version version)
{
CFUrl urlRef = null;
NSString methodRef = null;
var escaped = Uri.EscapeUriString (uri.ToString ());
try {
urlRef = CFUrl.FromUrlString (escaped, null);
if (urlRef == null)
throw new ArgumentException ("Invalid URL.");
methodRef = new NSString (method);
var msg = CreateRequest (urlRef, methodRef, version);
if (msg == null)
throw new ArgumentException ("Invalid URL.");
return msg;
} finally {
if (urlRef != null)
urlRef.Dispose ();
if (methodRef != null)
methodRef.Dispose ();
}
}