Esempio n. 1
0
 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();
     }
 }
 /// <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);
 }
Esempio n. 3
0
 /// <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++;
     }
 }
Esempio n. 4
0
 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());
 }
		public override void InsertText (NSObject insertString)
		{
			if (!((TextBoxBase)Host.Host).Multiline && insertString.ToString () == "\n")
				return ;
			base.InsertText (insertString);
		}
		public override void SetValueForKey (NSObject value, NSString key)
		{
			if (key == "bindingText")
				BindingText = value.ToString ();
		}
		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 ());
		}
Esempio n. 8
0
 public void InvokeViewModelIndexMethod(string id, string methodName, NSObject arg)
 {
     bridge.InvokeViewModelMethod(id, methodName, arg == null ? null :  arg.ToString());
 }