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


C# NSObject.GetType方法代碼示例

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


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

示例1: CheckToString

 protected override void CheckToString(NSObject obj)
 {
     switch (obj.GetType ().FullName) {
     // native crash calling MonoMac.Foundation.NSObject.get_Description ()
     case "WebKit.WKNavigationAction":
     case "WebKit.WKFrameInfo": //  EXC_BAD_ACCESS (code=1, address=0x0)
     case "MonoMac.Foundation.NSUrlConnection":
     case "Foundation.NSUrlConnection":
     case "MonoMac.AppKit.NSLayoutConstraint": // Unable to create description in descriptionForLayoutAttribute_layoutItem_coefficient. Something is nil
     case "AppKit.NSLayoutConstraint":
     case "MonoMac.AVFoundation.AVPlayerItemTrack":
     case "AVFoundation.AVPlayerItemTrack":
     // 10.8
     case "MonoMac.AVFoundation.AVComposition":
     case "AVFoundation.AVComposition":
     case "MonoMac.GameKit.GKPlayer": // Crashing on 10.8.3 from the Apple beta channel for abock (on 2013-01-30)
     case "GameKit.GKPlayer":
     case "MonoMac.AVFoundation.AVAssetResourceLoadingRequest": // Crashing on 10.9.1 for abock (2014-01-13)
     case "AVFoundation.AVAssetResourceLoadingRequest":
     case "MonoMac.AVFoundation.AVAssetResourceLoadingDataRequest": // Crashes on 10.9.3 for chamons (constructor found in AVCompat)
     case "AVFoundation.AVAssetResourceLoadingDataRequest":
     case "MonoMac.AVFoundation.AVCaptureDeviceInputSource": // Crashes on 10.9.5
     case "AVFoundation.AVCaptureDeviceInputSource":
         break;
     default:
         base.CheckToString (obj);
         break;
     }
 }
開發者ID:yudhitech,項目名稱:xamarin-macios,代碼行數:29,代碼來源:MacApiCtorInitTest.cs

示例2: CheckNSObjectProtocol

 protected override void CheckNSObjectProtocol(NSObject obj)
 {
     switch (obj.GetType ().Name) {
     case "NSString":
         // according to bots `isKindOf (null)` returns true before Yosemite
         break;
     case "SBObject":
         // *** NSForwarding: warning: object 0x77a49a0 of class '__NSMessageBuilder' does not implement doesNotRecognizeSelector: -- abort
         break;
     default:
         base.CheckNSObjectProtocol (obj);
         break;
     }
 }
開發者ID:yudhitech,項目名稱:xamarin-macios,代碼行數:14,代碼來源:MacApiCtorInitTest.cs

示例3: CheckIsDirectBinding

 /// <summary>
 /// Checks that the IsDirectBinding property is identical to the IsWrapper property of the Register attribute.
 /// </summary>
 /// <param name="obj">Object.</param>
 protected virtual void CheckIsDirectBinding(NSObject obj)
 {
     var attrib = obj.GetType ().GetCustomAttribute<RegisterAttribute> (false);
     // only check types that we register - that way we avoid the 118 MonoTouch.CoreImagge.CI* "special" types
     if (attrib == null)
         return;
     var is_wrapper = attrib != null && attrib.IsWrapper;
     var is_direct_binding = GetIsDirectBinding (obj);
     if (is_direct_binding != is_wrapper)
         ReportError ("{0} : IsDirectBinding (expected {1}, got {2})", instance_type_name, is_wrapper, is_direct_binding);
 }
開發者ID:yudhitech,項目名稱:xamarin-macios,代碼行數:15,代碼來源:ApiCtorInitTest.cs

示例4: SaveDocument

		public override void SaveDocument (NSObject delegateObject, MonoMac.ObjCRuntime.Selector didSaveSelector, IntPtr contextInfo) {
			Logger.Debug ("Not sure what this is doing yet SaveDocument {0}", delegateObject.GetType ());
			SaveData ();
		}
開發者ID:gitter-badger,項目名稱:tomboy.osx,代碼行數:4,代碼來源:MyDocument.cs


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