Ejemplo n.º 1
0
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// cachevirtualitemseventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this CacheVirtualItemsEventHandler cachevirtualitemseventhandler, Object sender, CacheVirtualItemsEventArgs e, AsyncCallback callback)
        {
            if (cachevirtualitemseventhandler == null)
            {
                throw new ArgumentNullException("cachevirtualitemseventhandler");
            }

            return(cachevirtualitemseventhandler.BeginInvoke(sender, e, callback, null));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a VirtualObjectListView
        /// </summary>
        public VirtualObjectListView()
            : base()
        {
            VirtualMode = true;             // Virtual lists have to be virtual -- no prizes for guessing that :)

            CacheVirtualItems    += new CacheVirtualItemsEventHandler(HandleCacheVirtualItems);
            RetrieveVirtualItem  += new RetrieveVirtualItemEventHandler(HandleRetrieveVirtualItem);
            SearchForVirtualItem += new SearchForVirtualItemEventHandler(HandleSearchForVirtualItem);

            // At the moment, we don't need to handle this event. But we'll keep this comment to remind us about it.
            //this.VirtualItemsSelectionRangeChanged += new ListViewVirtualItemsSelectionRangeChangedEventHandler(VirtualObjectListView_VirtualItemsSelectionRangeChanged);

            VirtualListDataSource = new VirtualListVersion1DataSource(this);
        }
        public SessionInfoListView(SessionInfo sessionInfo)
        {
            Session = sessionInfo;

            Columns.Add(LogControl.CreateColumnHeader("", 70));
            Columns.Add(LogControl.CreateColumnHeader("", 90));

            Columns[0].TextAlign = HorizontalAlignment.Left;

            View                 = View.Details;
            Dock                 = DockStyle.Fill;
            ShowItemToolTips     = true;
            VirtualMode          = true;
            VirtualListSize      = Session.Items.GetUpperBound(0) + 1;
            RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(SessionInfoListView_RetrieveVirtualItem);
            CacheVirtualItems   += new CacheVirtualItemsEventHandler(SessionInfoListView_CacheVirtualItems);
            StatoscopeForm.SetDoubleBuffered(this);

            LviCache = new List <ListViewItem>(VirtualListSize);
            UpdateLviCache();
        }
Ejemplo n.º 4
0
        public BucketListView(BucketSet bucketSet)
        {
            InitializeComponent();

            View                 = View.Details;
            Dock                 = DockStyle.Fill;
            GridLines            = true;
            FullRowSelect        = true;
            VirtualMode          = true;
            VirtualListSize      = bucketSet.m_buckets.Count;
            RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(bucketsListView_RetrieveVirtualItem);
            CacheVirtualItems   += new CacheVirtualItemsEventHandler(bucketsListView_CacheVirtualItems);
            StatoscopeForm.SetDoubleBuffered(this);

            int numColHeaders  = CountHeaders(bucketSet);
            int colHeaderWidth = Math.Max(50, (Width) / numColHeaders);

            Columns.Add(LogControl.CreateColumnHeader("Bucket", colHeaderWidth));
            CreateHeaders(bucketSet, colHeaderWidth);

            m_bucketSet = bucketSet;
            m_lviCache  = new List <ListViewItem>(bucketSet.m_buckets.Count);
            UpdateLviCache();
        }
Ejemplo n.º 5
0
        public StatsListView(List <LogView> logViews, string path)
        {
            Columns.Add(LogControl.CreateColumnHeader("", 92));
            Columns.Add(LogControl.CreateColumnHeader("#Frames", 55));
            Columns.Add(LogControl.CreateColumnHeader("Min", 55));
            Columns.Add(LogControl.CreateColumnHeader("Max", 55));
            Columns.Add(LogControl.CreateColumnHeader("Avg", 55));

            Columns[0].TextAlign = HorizontalAlignment.Left;

            View                 = View.Details;
            Dock                 = DockStyle.Fill;
            ShowItemToolTips     = true;
            VirtualMode          = true;
            VirtualListSize      = logViews.Count;
            RetrieveVirtualItem += new RetrieveVirtualItemEventHandler(statsListView_RetrieveVirtualItem);
            CacheVirtualItems   += new CacheVirtualItemsEventHandler(statsListView_CacheVirtualItems);
            StatoscopeForm.SetDoubleBuffered(this);

            m_logViews = logViews;
            m_path     = path;
            m_lviCache = new List <ListViewItem>(logViews.Count);
            UpdateLviCache();
        }