コード例 #1
0
ファイル: VehiclesList.cs プロジェクト: dmziryanov/ApecAuto
        protected virtual void WriteCellValue(HtmlTextWriter writer, VehicleInfo vehicle, string column, string link)
        {
            PropertyInfo propertyInfo = vehicle.GetType().GetProperty(column);
            object value = propertyInfo.GetValue(vehicle, null);
            string stringValue = value == null ? string.Empty : value.ToString();

            //<a href="'.$link.'">'.(string)$value.'</a>
            writer.AddAttribute(HtmlTextWriterAttribute.Href, link);
            writer.RenderBeginTag(HtmlTextWriterTag.A);
            writer.Write(stringValue);
            writer.RenderEndTag();
        }
コード例 #2
0
ファイル: VehiclesList.cs プロジェクト: dmziryanov/ApecAuto
        private void PrepareVihecleInfo(VehicleInfo vehicle, IEnumerable<string> actualColumns)
        {
            StringBuilder sb = new StringBuilder();
            foreach (string column in actualColumns)
            {
                PropertyInfo propertyInfo = vehicle.GetType().GetProperty(column);
                object value = propertyInfo.GetValue(vehicle, null);

                if(value == null) continue;

                sb.AppendFormat("{0}: {1}; ", GetLocalizedString(string.Format("ColumnVehicle{0}", column)), value);
            }
            vehicle.PathData = sb.ToString().TrimEnd(' ', ';');
        }