MonoMobile.Views.ViewSource.PerformActionIfCellListElement C# (CSharp) Method

PerformActionIfCellListElement() private method

private PerformActionIfCellListElement ( UITableViewCell cell, NSIndexPath indexPath, Action action ) : bool
cell UITableViewCell
indexPath NSIndexPath
action Action
return bool
		private bool PerformActionIfCellListElement(UITableViewCell cell, NSIndexPath indexPath, Action<ListSource> action)
		{
			var listIndexPath = NSIndexPath.FromRowSection(0, indexPath.Section);
			var listSource = GetListSource(listIndexPath);

			if (listSource != null && !listSource.IsRootCell)
			{
				var listCount = listSource.Sections[0].DataContext.Count;
				if (indexPath.Row < listCount)
				{
					var memberData = listSource.MemberData;
								
					if ((typeof(IEnumerable).IsAssignableFrom(memberData.Type) || typeof(Enum).IsAssignableFrom(memberData.Type)))
					{
						if (action != null)
						{
							action(listSource);
							return true;
						}
					}
				}
			}

			return false;
		}
	}