GetPropertyValue() 공개 정적인 메소드

public static GetPropertyValue ( object inObject, string propertyName ) : string
inObject object
propertyName string
리턴 string
예제 #1
0
        public override string GetTitle(UIPickerView uipv, int row, int comp)
        {
            //each component would get its own title.
            var theObject = Picker.Items[row];

            if (string.IsNullOrEmpty(Picker.DisplayMember))
            {
                return(theObject.ToString());
            }
            return(Util.GetPropertyValue(theObject, Picker.DisplayMember));
        }
        public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
        {
            var cell = tableView.DequeueReusableCell(CellID);

            if (cell == null)
            {
                cell = new UITableViewCell(cellStyle, CellID);
            }

            object l;

            if (string.IsNullOrEmpty(CellSubsections))
            {
                l = dataArray.ElementAt(indexPath.Row);
            }

            else
            {
                l = Util.GetPropertyArray(dataArray[indexPath.Section], CellSubsections).ElementAt(indexPath.Row);
            }

            if (cell.TextLabel != null)
            {
                cell.TextLabel.Text = Util.GetPropertyValue(l, CellTextLabelMember);
            }

            if (cell.DetailTextLabel != null)
            {
                cell.DetailTextLabel.Text = Util.GetPropertyValue(l, CellDetailTextLabelMember);
                //cell.DetailTextLabel.BackgroundColor = UIColor.Purple;
            }
            UIView bg = new UIView(cell.Frame);

            //bg.BackgroundColor = UIColor.Purple;
            cell.BackgroundView = bg;
            cell.Accessory      = cellAccessory;
            //cell.BackgroundColor = UIColor.Purple;
            return(cell);
        }
 /// <summary>
 /// Called by the TableView to retrieve the footer text for the particular section(group)
 /// </summary>
 public override string TitleForFooter(UITableView tableView, int section)
 {
     return(Util.GetPropertyValue(this.dataArray[section], CellSectionFooter));
 }