Esempio n. 1
0
 public int IndexOf(GridViewSummaryRowItem summaryItem)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         if (this.Items[index].SummaryRowItem == summaryItem)
         {
             return(index);
         }
     }
     return(-1);
 }
Esempio n. 2
0
 internal GridViewSummaryRowInfo Remove(GridViewSummaryRowItem summaryItem)
 {
     for (int index = 0; index < this.Items.Count; ++index)
     {
         if (this.Items[index].SummaryRowItem == summaryItem)
         {
             GridViewSummaryRowInfo viewSummaryRowInfo = this.Items[index];
             this.Items.Remove(viewSummaryRowInfo);
             return(viewSummaryRowInfo);
         }
     }
     return((GridViewSummaryRowInfo)null);
 }
Esempio n. 3
0
        internal GridViewSummaryRowInfo Add(
            GridViewInfo viewInfo,
            GridViewSummaryRowItem summaryItem,
            bool top)
        {
            GridViewCreateRowInfoEventArgs e = new GridViewCreateRowInfoEventArgs((GridViewRowInfo) new GridViewSummaryRowInfo(viewInfo, (GridViewGroupRowInfo)null), viewInfo);

            viewInfo.ViewTemplate.OnCreateRowInfo(e);
            GridViewSummaryRowInfo rowInfo = e.RowInfo as GridViewSummaryRowInfo;

            if (rowInfo != null)
            {
                rowInfo.SummaryRowItem = summaryItem;
                rowInfo.RowPosition    = top ? SystemRowPosition.Top : SystemRowPosition.Bottom;
                this.Items.Add(rowInfo);
            }
            return(rowInfo);
        }
        public override object ConvertTo(
            ITypeDescriptorContext context,
            CultureInfo culture,
            object value,
            Type destinationType)
        {
            if ((object)destinationType != (object)typeof(InstanceDescriptor))
            {
                return(base.ConvertTo(context, culture, value, destinationType));
            }
            GridViewSummaryRowItem viewSummaryRowItem = value as GridViewSummaryRowItem;

            if (viewSummaryRowItem == null)
            {
                throw new ArgumentException("GridViewSummaryRowItemTypeConverter can convert items of type GridViewSummaryRowItem");
            }
            return((object)new InstanceDescriptor((MemberInfo)typeof(GridViewSummaryRowItem).GetConstructor(new Type[1]
            {
                typeof(GridViewSummaryItem[])
            }), (ICollection) new object[1]
            {
                (object)viewSummaryRowItem.Fields
            }));
        }
Esempio n. 5
0
 public bool Contains(GridViewSummaryRowItem summaryItem)
 {
     return(this.IndexOf(summaryItem) != -1);
 }