コード例 #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(' ', ';');
        }
コード例 #3
0
ファイル: VehiclesList.cs プロジェクト: dmziryanov/ApecAuto
        protected virtual void WriteCell(HtmlTextWriter writer, VehicleInfo vehicle, string column, string link)
        {
            //'<td>'.$this->DrawCellValue($row, $column, $link).'</td>';
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            WriteCellValue(writer, vehicle, column, link);

            writer.RenderEndTag();
        }
コード例 #4
0
ファイル: VehiclesList.cs プロジェクト: dmziryanov/ApecAuto
        protected virtual void WriteRow(HtmlTextWriter writer, VehicleInfo vehicle, List<string> actualColumns)
        {
            PrepareVihecleInfo(vehicle, actualColumns);

            string link = FormatLink("vehicle", vehicle);

            //<tr onmouseout="this.className=\'\';" onmouseover="this.className=\'over\';" onclick="window.location=\''.$link.'\'">
            writer.AddAttribute(HtmlTextWriterAttribute.Onclick, String.Format("window.location = '{0}'", link));
            writer.AddAttribute("onmouseout", "this.className='';");
            writer.AddAttribute("onmouseover", "this.className='over';");
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            foreach (string column in actualColumns)
            {
                WriteCell(writer, vehicle, column, link);
            }

            writer.RenderEndTag();
        }