Esempio n. 1
0
        void rptFiles_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (!ItemTemplateHelper.IsContentItem(e.Item))
                return;

            var image = (ImageInfo)e.Item.DataItem;
            var itemHelper = new ItemTemplateHelper(e.Item);

            var btnName = itemHelper.Find<LinkButton>("btnName");
            var btnSize = itemHelper.Find<LinkButton>("btnSize");
            var btnType = itemHelper.Find<LinkButton>("btnType");
            var btnDate = itemHelper.Find<LinkButton>("btnDate");

            btnName.Text = image.Name;
            btnSize.Text = string.Format("{0} KB", Math.Ceiling(image.FileSize/1024d));
            btnType.Text = image.FileExtension;
            btnDate.Text = image.CreationTime.ToString("dd.MM.yyyy");

            foreach (var button in new[] { btnName, btnSize, btnType, btnDate })
            {
                button.CommandName = "selectItem";
                button.CommandArgument = image.Id.ToString();
            }

            if(image.Id == _currentId)
            {
                itemHelper.Find<Panel>("pnlItem").AddCssClass("current");
                PopulateSelectedItemPanel(image);
            }
        }
Esempio n. 2
0
 private void SetAllChecked(bool value)
 {
     foreach (var item in rptFiles.Items.OfType<RepeaterItem>())
     {
         var itemHelper = new ItemTemplateHelper(item);
         itemHelper.Find<CheckBox>("cbSelectItem").Checked = value;
     }
 }
Esempio n. 3
0
 private void FindSelectedItems()
 {
     _selectedIds.Clear();
     var images = GetImages();
     foreach(var item in rptFiles.Items.OfType<RepeaterItem>())
     {
         var itemHelper = new ItemTemplateHelper(item);
         if (itemHelper.Find<CheckBox>("cbSelectItem").Checked)
             _selectedIds.Add(images[item.ItemIndex].Id);
     }
 }