本文整理汇总了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();
}
}
示例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);
}
示例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++;
}
}
示例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());
}
示例5: InsertText
public override void InsertText (NSObject insertString)
{
if (!((TextBoxBase)Host.Host).Multiline && insertString.ToString () == "\n")
return ;
base.InsertText (insertString);
}
示例6: SetValueForKey
public override void SetValueForKey (NSObject value, NSString key)
{
if (key == "bindingText")
BindingText = value.ToString ();
}
示例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 ());
}
示例8: InvokeViewModelIndexMethod
public void InvokeViewModelIndexMethod(string id, string methodName, NSObject arg)
{
bridge.InvokeViewModelMethod(id, methodName, arg == null ? null : arg.ToString());
}