亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? typedobjectlistview.cs

?? Linux 恢復盤制作工具 process調用busybox dd實現寫*.img鏡像
?? CS
?? 第 1 頁 / 共 2 頁
字號:
/*
 * TypedObjectListView - A wrapper around an ObjectListView that provides type-safe delegates.
 *
 * Author: Phillip Piper
 * Date: 27/09/2008 9:15 AM
 *
 * Change log:
 * 2008-11-26   JPP  - Added tool tip getting methods
 * 2008-11-05   JPP  - Added CheckState handling methods
 * 2008-10-24   JPP  - Generate dynamic methods MkII. This one handles value types
 * 2008-10-21   JPP  - Generate dynamic methods
 * 2008-09-27   JPP  - Separated from ObjectListView.cs
 * 
 * Copyright (C) 2006-2008 Phillip Piper
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * If you wish to use this code in a closed source application, please contact phillip_piper@bigfoot.com.
 */

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Reflection.Emit;

namespace BrightIdeasSoftware
{
    /// <summary>
    /// A TypedObjectListView is a type-safe wrapper around an ObjectListView.
    /// </summary>
    /// <remarks>
    /// <para>VCS does not support generics on controls. It can be faked to some degree, but it
    /// cannot be completely overcome. In our case in particular, there is no way to create
    /// the custom OLVColumn's that we need to truly be generic. So this wrapper is an 
    /// experiment in providing some type-safe access in a way that is useful and available today.</para>
    /// <para>A TypedObjectListView is not more efficient than a normal ObjectListView.
    /// Underneath, the same name of casts are performed. But it is easier to use since you
    /// do not have to write the casts yourself.
    /// </para>
    /// </remarks>
    /// <typeparam name="T">The class of model object that the list will manage</typeparam>
    /// <example>
    /// To use a TypedObjectListView, you write code like this:
    /// <code>
    /// TypedObjectListView<Person> tlist = new TypedObjectListView<Person>(this.listView1);
    /// tlist.CheckStateGetter = delegate(Person x) { return x.IsActive; };
    /// tlist.GetColumn(0).AspectGetter = delegate(Person x) { return x.Name; };
    /// ...
    /// </code>
    /// To iterate over the selected objects, you can write something elegant like this:
    /// <code>
    /// foreach (Person x in tlist.SelectedObjects {
    ///     x.GrantSalaryIncrease();
    /// }
    /// </code>
    /// </example>
    public class TypedObjectListView<T> where T : class
    {
        /// <summary>
        /// Create a typed wrapper around the given list.
        /// </summary>
        /// <param name="olv">The listview to be wrapped</param>
        public TypedObjectListView(ObjectListView olv)
        {
            this.olv = olv;
        }

        //--------------------------------------------------------------------------------------
        // Properties

        /// <summary>
        /// Return the model object that is checked, if only one row is checked.
        /// If zero rows are checked, or more than one row, null is returned.
        /// </summary>
        public virtual T CheckedObject
        {
            get { return (T)this.olv.CheckedObject; }
        }

        /// <summary>
        /// Return the list of all the checked model objects
        /// </summary>
        public virtual IList<T> CheckedObjects
        {
            get {
                IList checkedObjects = this.olv.CheckedObjects;
                List<T> objects = new List<T>(checkedObjects.Count);
                foreach (object x in checkedObjects)
                    objects.Add((T)x);

                return objects;
            }
            set { this.olv.CheckedObjects = (IList)value; }
        }

        /// <summary>
        /// The ObjectListView that is being wrapped
        /// </summary>
        public virtual ObjectListView ListView
        {
            get { return olv; }
            set { olv = value; }
        }
        private ObjectListView olv;

        /// <summary>
        /// Return the model object that is selected, if only one row is selected.
        /// If zero rows are selected, or more than one row, null is returned.
        /// </summary>
        public virtual T SelectedObject
        {
            get { return (T)this.olv.GetSelectedObject(); }
            set { this.olv.SelectObject(value, true); }
        }

        /// <summary>
        /// The list of model objects that are selected.
        /// </summary>
        public virtual IList<T> SelectedObjects
        {
            get {
                List<T> objects = new List<T>(this.olv.SelectedIndices.Count);
                foreach (int index in this.olv.SelectedIndices)
                    objects.Add((T)this.olv.GetModelObject(index));

                return objects;
            }
            set { this.olv.SelectObjects((IList)value); }
        }

        //--------------------------------------------------------------------------------------
        // Accessors

        /// <summary>
        /// Return a typed wrapper around the column at the given index
        /// </summary>
        /// <param name="i">The index of the column</param>
        /// <returns>A typed column or null</returns>
        public virtual TypedColumn<T> GetColumn(int i)
        {
            return new TypedColumn<T>(this.olv.GetColumn(i));
        }

        /// <summary>
        /// Return a typed wrapper around the column with the given name
        /// </summary>
        /// <param name="i">The name of the column</param>
        /// <returns>A typed column or null</returns>
        public virtual TypedColumn<T> GetColumn(string name)
        {
            return new TypedColumn<T>(this.olv.GetColumn(name));
        }

        /// <summary>
        /// Return the model object at the given index
        /// </summary>
        /// <param name="index">The index of the model object</param>
        /// <returns>The model object or null</returns>
        public virtual T GetModelObject(int index)
        {
            return (T)this.olv.GetModelObject(index);
        }

        //--------------------------------------------------------------------------------------
        // Delegates

        public delegate CheckState TypedCheckStateGetterDelegate(T rowObject);

        public virtual TypedCheckStateGetterDelegate CheckStateGetter
        {
            get { return checkStateGetter; }
            set {
                this.checkStateGetter = value;
                if (value == null)
                    this.olv.CheckStateGetter = null;
                else
                    this.olv.CheckStateGetter = delegate(object x) {
                        return this.checkStateGetter((T)x);
                    };
            }
        }
        private TypedCheckStateGetterDelegate checkStateGetter;

        public delegate bool TypedBooleanCheckStateGetterDelegate(T rowObject);

        public virtual TypedBooleanCheckStateGetterDelegate BooleanCheckStateGetter
        {
            set {
                if (value == null)
                    this.olv.BooleanCheckStateGetter = null;
                else
                    this.olv.BooleanCheckStateGetter = delegate(object x) {
                        return value((T)x);
                    };
            }
        }

        public delegate CheckState TypedCheckStatePutterDelegate(T rowObject, CheckState newValue);

        public virtual TypedCheckStatePutterDelegate CheckStatePutter
        {
            get { return checkStatePutter; }
            set {
                this.checkStatePutter = value;
                if (value == null)
                    this.olv.CheckStatePutter = null;
                else
                    this.olv.CheckStatePutter = delegate(object x, CheckState newValue) {
                        return this.checkStatePutter((T)x, newValue);
                    };
            }
        }
        private TypedCheckStatePutterDelegate checkStatePutter;

        public delegate bool TypedBooleanCheckStatePutterDelegate(T rowObject, bool newValue);

        public virtual TypedBooleanCheckStatePutterDelegate BooleanCheckStatePutter
        {
            set {
                if (value == null)
                    this.olv.BooleanCheckStatePutter = null;
                else
                    this.olv.BooleanCheckStatePutter = delegate(object x, bool newValue) {
                        return value((T)x, newValue);
                    };
            }
        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
夜夜嗨av一区二区三区四季av| 最新国产の精品合集bt伙计| 91蜜桃婷婷狠狠久久综合9色| 狠狠色丁香婷婷综合| 日韩制服丝袜先锋影音| 五月激情丁香一区二区三区| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲国产精品黑人久久久| 久久久久久一二三区| 久久九九国产精品| 中文一区二区完整视频在线观看| 国产色综合久久| 国产精品女主播av| 成人欧美一区二区三区1314| 怡红院av一区二区三区| 亚洲精品国产高清久久伦理二区| 夜夜嗨av一区二区三区| 日韩精品免费视频人成| 精品一区二区三区不卡| 国产一区二区女| av中文字幕在线不卡| 在线观看免费亚洲| 日韩一区二区三区视频| 26uuu精品一区二区| 中日韩av电影| 亚洲无线码一区二区三区| 日韩精品视频网| 国产精品一区二区果冻传媒| 91丨九色丨尤物| 91精品久久久久久久99蜜桃| 久久蜜臀精品av| 亚洲精品日韩综合观看成人91| 亚洲va中文字幕| 激情综合色综合久久综合| 成人黄色在线网站| 欧美日韩一卡二卡| 久久久蜜臀国产一区二区| 亚洲人成人一区二区在线观看| 天天综合天天做天天综合| 国产精品1024久久| 欧美在线三级电影| 国产午夜亚洲精品理论片色戒| 亚洲精品成a人| 国产一区二区在线看| 欧美视频在线一区二区三区| 久久久久88色偷偷免费| 美女精品自拍一二三四| 99re8在线精品视频免费播放| 欧美一区二区三区视频免费播放 | 欧美—级在线免费片| 亚洲综合丁香婷婷六月香| 精品一区二区av| 欧美手机在线视频| 日韩理论片一区二区| 精品无人区卡一卡二卡三乱码免费卡| 99精品视频在线免费观看| 337p亚洲精品色噜噜噜| 精品久久一区二区| 亚洲第一搞黄网站| 91美女片黄在线观看91美女| 欧美激情在线一区二区| 麻豆91免费观看| 欧美精品tushy高清| 亚洲日本va在线观看| 成人国产在线观看| 国产欧美日韩卡一| 国产精品香蕉一区二区三区| 日韩欧美一二区| 日韩电影免费在线看| 欧美丝袜自拍制服另类| 亚洲精品亚洲人成人网| 色综合色综合色综合| 中文字幕亚洲欧美在线不卡| 国产精品综合在线视频| 精品播放一区二区| 国产精品一区二区在线播放 | 久久精品国产久精国产| 3751色影院一区二区三区| 亚洲第一成年网| 欧美日韩一区久久| 日韩在线卡一卡二| 欧美一区二区三区人| 日本特黄久久久高潮| 欧美一区二区三区在线观看| 喷水一区二区三区| 精品国产乱码久久久久久图片| 久久99久久精品欧美| 日韩精品专区在线影院观看| 久久99精品一区二区三区三区| 精品少妇一区二区三区视频免付费| 日本午夜一区二区| 久久午夜电影网| 不卡一卡二卡三乱码免费网站| 综合av第一页| 精品视频在线免费看| 天天综合日日夜夜精品| 精品日产卡一卡二卡麻豆| 国产精品1024久久| 玉足女爽爽91| 欧美精品久久一区二区三区| 久久国产生活片100| 亚洲国产精品传媒在线观看| 91黄色免费看| 麻豆国产精品一区二区三区 | 久久这里都是精品| 不卡欧美aaaaa| 天天色 色综合| 精品国产人成亚洲区| 97久久久精品综合88久久| 一区二区三区鲁丝不卡| 欧美成人在线直播| 91丨九色丨国产丨porny| 日本亚洲电影天堂| 欧美韩国日本一区| 欧美精品自拍偷拍动漫精品| 国产乱码精品一品二品| 亚洲最大的成人av| 欧美精品一区二区高清在线观看| av不卡一区二区三区| 亚洲.国产.中文慕字在线| 亚洲精品一区二区精华| 欧美性感一类影片在线播放| 国产一区二区美女| 亚洲成人www| 国产精品乱码一区二三区小蝌蚪| 欧美精品国产精品| 97久久久精品综合88久久| 蜜桃久久av一区| 亚洲综合成人在线视频| 中文字幕的久久| 欧美一区二区三区影视| 色999日韩国产欧美一区二区| 精品夜夜嗨av一区二区三区| 一区二区三区四区在线| 国产欧美一区二区三区在线老狼| 欧美日韩国产一级片| 91视频免费播放| 国产成人综合网站| 久久国产综合精品| 日韩电影在线观看一区| 一区二区三区国产精品| 亚洲三级免费观看| 国产欧美精品一区| 2024国产精品| 日韩欧美国产系列| 91精品久久久久久久99蜜桃| 色综合 综合色| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 中文一区一区三区高中清不卡| 欧美一级在线视频| 6080yy午夜一二三区久久| 国产亚洲一区二区在线观看| 91精品国产欧美日韩| 91麻豆精品国产自产在线观看一区 | 亚洲男人的天堂网| 亚洲欧美自拍偷拍色图| 国产精品入口麻豆九色| 欧美国产精品久久| 中文字幕免费不卡| 国产精品麻豆视频| 亚洲人快播电影网| 亚洲精品午夜久久久| 一区二区三区四区高清精品免费观看 | 91在线视频播放| 一本久道久久综合中文字幕| 93久久精品日日躁夜夜躁欧美| 97精品久久久久中文字幕| 一本一道综合狠狠老| 精品视频一区二区三区免费| 欧美日韩小视频| 精品理论电影在线观看| 久久亚洲一区二区三区四区| 中文一区二区在线观看| 一区二区激情视频| 婷婷激情综合网| 国内精品久久久久影院薰衣草 | 国产一区91精品张津瑜| 国产传媒欧美日韩成人| 99精品黄色片免费大全| 欧美午夜寂寞影院| 欧美成人一区二区三区在线观看| 久久嫩草精品久久久精品| 综合久久久久久| 亚洲图片欧美色图| 国内精品自线一区二区三区视频| 国产**成人网毛片九色| 欧美最猛性xxxxx直播| 日韩欧美国产综合| 中文字幕一区二区三| 午夜视频一区二区三区| 国产成人午夜视频| 欧美性猛交xxxx乱大交退制版| 91精品国产综合久久精品| 久久久精品蜜桃| 亚洲一区在线电影| 国产传媒欧美日韩成人| 欧美日韩国产综合草草| 国产欧美日韩视频在线观看| 午夜影院在线观看欧美| 成人午夜伦理影院|