当前位置: 首页>>代码示例>>C#>>正文


C# NSString.Dispose方法代码示例

本文整理汇总了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 ();

		}
开发者ID:kelegorm,项目名称:awareness,代码行数:10,代码来源:LoginItemManager.g.cs

示例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 ();
		}
开发者ID:Anomalous-Software,项目名称:maccore,代码行数:11,代码来源:NSKeyedArchiver.cs

示例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 ();

		}
开发者ID:sichy,项目名称:monomac,代码行数:14,代码来源:CLRegion.g.cs

示例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;
			}
		}
开发者ID:Anomalous-Software,项目名称:maccore,代码行数:15,代码来源:AudioSession.cs

示例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 ();
			}
		}
开发者ID:Anomalous-Software,项目名称:maccore,代码行数:25,代码来源:CFHTTPMessage.cs


注:本文中的MonoMac.Foundation.NSString.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。