当前位置: 首页>>代码示例>>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;未经允许,请勿转载。