예제 #1
0
 public void Refresh() {
     
     Controls.Clear();
     if (Page != null) {
         int i = 0;
         string noImageUrl = ClientScriptProxy.Current.GetWebResourceUrl(this, GetType(), "Thumbnail.Web.Resources.noimage.jpg");
         foreach (IThumbNailItem item in dataSource)
         {
             Table table = CreateTable();
             var img = new System.Web.UI.WebControls.Image { ID = ID + "_" + (i++) };
             var requestTextPictureItemEventArgs = new RequestTextThumbnailItemEventArgs(item);
             OnRequestText(requestTextPictureItemEventArgs);
             SetImageProperties(item, img, noImageUrl,requestTextPictureItemEventArgs.Text);
             CreateImageRow(img, table);
             CreateTextRow(item, requestTextPictureItemEventArgs, table);
         }
     }
 }
예제 #2
0
 void CreateTextRow(IThumbNailItem item, RequestTextThumbnailItemEventArgs requestTextThumbnailItemEventArgs, Table table)
 {
     TableCell cell = CreateTextCell(item, requestTextThumbnailItemEventArgs);
     table.Rows.Add(new TableRow());
     table.Rows[1].Cells.Add(cell);
 }
예제 #3
0
 TableCell CreateTextCell(IThumbNailItem item, RequestTextThumbnailItemEventArgs requestTextThumbnailItemEventArgs)
 {
     var cell = new TableCell();
     cell.Style["font-size"] = "80%";
     cell.Style["text-align"] = "center";
     cell.Style["word-wrap"] = "break-word";
     cell.Style["word-break"] = "break-word";
     string text1 = string.Format("<a href='{0}&{3}={1}'>{2}</a>",
                                  HttpContext.Current.Request.Url.AbsoluteUri, item.ID, requestTextThumbnailItemEventArgs.Text, ThumbnailListEditor.SelectedId);            
     var text = new Literal { Text = text1 };
     cell.Controls.Add(text);
     return cell;
 }
예제 #4
0
 public void OnRequestText(RequestTextThumbnailItemEventArgs e)
 {
     EventHandler<RequestTextThumbnailItemEventArgs> handler = RequestText;
     if (handler != null) handler(this, e);
 }
예제 #5
0
 void ControlOnRequestText(object sender, RequestTextThumbnailItemEventArgs requestTextThumbnailItemEventArgs) {
     requestTextThumbnailItemEventArgs.Text = GetDisplayText(requestTextThumbnailItemEventArgs.ItemClicked);
 }