當前位置: 首頁>>代碼示例>>C#>>正文


C# NSString.Dispose方法代碼示例

本文整理匯總了C#中XamCore.Foundation.NSString.Dispose方法的典型用法代碼示例。如果您正苦於以下問題:C# NSString.Dispose方法的具體用法?C# NSString.Dispose怎麽用?C# NSString.Dispose使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XamCore.Foundation.NSString的用法示例。


在下文中一共展示了NSString.Dispose方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SetString

        public void SetString(string value, string defaultName)
        {
            NSString str = new NSString (value);

            SetObjectForKey (str, defaultName);

            str.Dispose ();
        }
開發者ID:,項目名稱:,代碼行數:8,代碼來源:

示例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);
            XamCore.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr (class_ptr, Selector.GetHandle ("setClassName:forClass:"), nsname.Handle, kls.Handle);
            nsname.Dispose ();
        }
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例3: 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:,項目名稱:,代碼行數:15,代碼來源:

示例4: CreateRequest

		public static CFHTTPMessage CreateRequest (Uri uri, string method, Version version)
		{
			if (uri == null)
				throw new ArgumentNullException ("uri");

			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);

				return CreateRequest (urlRef, methodRef, version);
			} finally {
				if (urlRef != null)
					urlRef.Dispose ();
				if (methodRef != null)
					methodRef.Dispose ();
			}
		}
開發者ID:,項目名稱:,代碼行數:24,代碼來源:


注:本文中的XamCore.Foundation.NSString.Dispose方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。