ResultFile.cs
上传用户:huiyue
上传日期:2022-04-08
资源大小:1429k
文件大小:2k
源码类别:

搜索引擎

开发平台:

ASP/ASPX

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Searcharoo.Common
  5. {
  6.     /// <summary>
  7.     /// 
  8.     /// </summary>
  9.     public class ResultFile : File
  10.     {
  11.         private int _Rank;
  12.         public ResultFile(File sourceFile)
  13.         {
  14.             this.Url = sourceFile.Url;
  15.             this.Title = sourceFile.Title;
  16.             this.Description = sourceFile.Description;
  17.             this.CrawledDate = sourceFile.CrawledDate;
  18.             this.Size = sourceFile.Size;
  19.             this.Rank = -1;
  20.             this.GpsLocation = sourceFile.GpsLocation;
  21.             this.KeywordString = sourceFile.KeywordString;
  22.             this.Extension = sourceFile.Extension;
  23.         }
  24.         public int Rank
  25.         {
  26.             get { return _Rank; }
  27.             set { _Rank = value; }
  28.         }
  29.         public string GpsLocationHtml
  30.         {
  31.             get
  32.             {
  33.                 if (this.GpsLocation == null)
  34.                 {
  35.                     return "";
  36.                 }
  37.                 else
  38.                 {
  39.                     return String.Format(@"<a href='http://maps.google.com/maps?f=q&hl=en&geocode=&q={2}&ll={0},{1}&ie=UTF8&t=h&z=16&iwloc=addr' target='_blank' class='geo'><span class='geo'>
  40. <span class='latitude'>{0}</span>,<span class='longitude'>{1}</span>
  41. </span></a>", 
  42. this.GpsLocation.Latitude, this.GpsLocation.Longitude, this.Title);
  43.                 }
  44.             }
  45.         }
  46.         public string TitleText
  47.         {
  48.             get 
  49.             {
  50.                 return this.Title.Replace("&", "");
  51.             }
  52.         }
  53.         public string DescriptionText
  54.         {
  55.             get
  56.             {
  57.                 return this.Description.Replace("&", "");
  58.             }
  59.         }
  60.         public string GpsLocationText
  61.         {
  62.             get
  63.             {
  64.                 if (this.GpsLocation == null)
  65.                 {
  66.                     return "0,0";
  67.                 }
  68.                 else
  69.                 {
  70.                     return String.Format(@"{0},{1}", this.GpsLocation.Longitude, this.GpsLocation.Latitude);
  71.                 }
  72.             }
  73.         }
  74.     }
  75. }