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


C# NSObject.ToString方法代碼示例

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


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

示例1: SetObjectValue

 public override void SetObjectValue(NSTableView tableView, NSObject theObject, NSTableColumn tableColumn, int row)
 {
     var proposedValue = theObject.ToString();
     if (proposedValue.Trim().Length > 0) {
         controller.gamerList[row].Gamertag = theObject.ToString();
         controller.gamerList[row].DisplayName = theObject.ToString();
     }
 }
開發者ID:JoelCarter,項目名稱:MonoGame,代碼行數:8,代碼來源:SigninController.cs

示例2: CheckToString

 /// <summary>
 /// Checks that ToString does not return null (not helpful for debugging) and that it does not crash.
 /// </summary>
 /// <param name="obj">NSObject instance to validate</param>
 protected virtual void CheckToString(NSObject obj)
 {
     if (obj.ToString () == null)
         ReportError ("{0} : ToString", instance_type_name);
 }
開發者ID:yudhitech,項目名稱:xamarin-macios,代碼行數:9,代碼來源:ApiCtorInitTest.cs

示例3: CheckToString

 /// <summary>
 /// Checks that ToString does not return null (not helpful for debugging) and that it does not crash.
 /// </summary>
 /// <param name="obj">NSObject instance to validate</param>
 protected virtual void CheckToString(NSObject obj)
 {
     bool result = obj.ToString () != null;
     if (!ContinueOnFailure)
         Assert.IsTrue (result, instance_type_name + ".ToString");
     else if (!result) {
         Console.WriteLine ("[FAIL] {0} : ToString", instance_type_name);
         Errors++;
     }
 }
開發者ID:officedrop,項目名稱:maccore,代碼行數:14,代碼來源:ApiCtorInitTest.cs

示例4: SetObjectValue

 public override void SetObjectValue(NSTableView tableView, NSObject theObject, NSTableColumn tableColumn, int row)
 {
     NSTableColumn[] cols = tableView.TableColumns();
     int idx = cols.ToList().FindIndex(t => t.HeaderCell.StringValue == tableColumn.HeaderCell.StringValue);
     if (idx == (int)TableLocation.Brightness && BrightnessCellEdited != null) BrightnessCellEdited(row, theObject.ToString());
 }
開發者ID:ivynetca,項目名稱:lapsestudio,代碼行數:6,代碼來源:HelperClasses.cs

示例5: InsertText

		public override void InsertText (NSObject insertString)
		{
			if (!((TextBoxBase)Host.Host).Multiline && insertString.ToString () == "\n")
				return ;
			base.InsertText (insertString);
		}
開發者ID:gabfr,項目名稱:MonoMac.Windows.Form,代碼行數:6,代碼來源:TextBoxHelper.cs

示例6: SetValueForKey

		public override void SetValueForKey (NSObject value, NSString key)
		{
			if (key == "bindingText")
				BindingText = value.ToString ();
		}
開發者ID:indazoo,項目名稱:MvvmCross_DesignData,代碼行數:5,代碼來源:MvxTableColumn.cs

示例7: ConvertPrimitive

		public static object ConvertPrimitive (NSObject obj)
		{
			var arr = obj as NSArray;
			if (arr != null) {
				var objArr = new object[arr.Count];
				for (uint i = 0; i < objArr.Length; i++) {
					objArr [i] = ConvertPrimitive (MonoMac.ObjCRuntime.Runtime.GetNSObject (arr.ValueAt (i)));
				}
				return MakeStrongerTypedArray (objArr);
			}
		
			var str = obj as NSString;
			if (str != null)
				return str.ToString ();
		
			var num = obj as NSNumber;
			if (num != null)
				return ConvertNumber (num);
		
			var date = obj as NSDate;
			if (date != null)
				return (DateTime)(NSDate)date;
		
			var data = obj as NSData;
			if (data != null)
				return ConvertData (data);
		
			throw new NotSupportedException (obj.ToString ());
		}
開發者ID:antoniusriha,項目名稱:tasqueforc.ui.prototype,代碼行數:29,代碼來源:TypeConverter.cs

示例8: InvokeViewModelIndexMethod

 public void InvokeViewModelIndexMethod(string id, string methodName, NSObject arg)
 {
     bridge.InvokeViewModelMethod(id, methodName, arg == null ? null :  arg.ToString());
 }
開發者ID:Claytonious,項目名稱:spinnaker,代碼行數:4,代碼來源:ScriptObject.cs


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