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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? datalistview.cs

?? Linux 恢復(fù)盤制作工具 process調(diào)用busybox dd實(shí)現(xiàn)寫*.img鏡像
?? CS
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 * DataListView - A data-bindable listview
 *
 * Author: Phillip Piper
 * Date: 27/09/2008 9:15 AM
 *
 * Change log:
 * 2009-01-18   JPP  - Boolean columns are now handled as checkboxes
 *                   - Auto-generated columns would fail if the data source was 
 *                     reseated, even to the same data source
 * v2.0.1
 * 2009-01-07   JPP  - Made all public and protected methods virtual 
 * 2008-10-03   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.ComponentModel;
using System.Data;
using System.Drawing.Design;
using System.Windows.Forms;

namespace BrightIdeasSoftware
{

    /// <summary>
    /// A DataListView is a ListView that can be bound to a datasource (which would normally be a DataTable or DataView).
    /// </summary>
    /// <remarks>
    /// <para>This listview keeps itself in sync with its source datatable by listening for change events.</para>
    /// <para>If the listview has no columns when given a data source, it will automatically create columns to show all of the datatables columns.
    /// This will be only the simplest view of the world, and would look more interesting with a few delegates installed.</para>
    /// <para>This listview will also automatically generate missing aspect getters to fetch the values from the data view.</para>
    /// <para>Changing data sources is possible, but error prone. Before changing data sources, the programmer is responsible for modifying/resetting
    /// the column collection to be valid for the new data source.</para>
    /// <para>Internally, a CurrencyManager controls keeping the data source in-sync with other users of the data source (as per normal .NET
    /// behavior). This means that the model objects in the DataListView are DataRowView objects. If you write your own AspectGetters/Setters,
    /// they will be given DataRowView objects.</para>
    /// </remarks>
    public class DataListView : ObjectListView
    {
        /// <summary>
        /// Make a DataListView
        /// </summary>
        public DataListView()
            : base()
        {
        }

        #region Public Properties

        /// <summary>
        /// Get or set the DataSource that will be displayed in this list view.
        /// </summary>
        /// <remarks>The DataSource should implement either <see cref="IList"/>, <see cref="IBindingList"/>,
        /// or <see cref="IListSource"/>. Some common examples are the following types of objects:
        /// <list type="unordered">
        /// <item><see cref="DataView"/></item>
        /// <item><see cref="DataTable"/></item>
        /// <item><see cref="DataSet"/></item>
        /// <item><see cref="DataViewManager"/></item>
        /// <item><see cref="BindingSource"/></item>
        /// </list>
        /// <para>When binding to a list container (i.e. one that implements the
        /// <see cref="IListSource"/> interface, such as <see cref="DataSet"/>)
        /// you must also set the <see cref="DataMember"/> property in order
        /// to identify which particular list you would like to display. You
        /// may also set the <see cref="DataMember"/> property even when
        /// DataSource refers to a list, since <see cref="DataMember"/> can
        /// also be used to navigate relations between lists.</para>
        /// </remarks>
        [Category("Data"),
        TypeConverter("System.Windows.Forms.Design.DataSourceConverter, System.Design")]
        public virtual Object DataSource
        {
            get { return dataSource; }
            set {
                //THINK: Should we only assign it if it is changed?
                //if (dataSource != value) {
                dataSource = value;
                this.RebindDataSource(true);
                //}
            }
        }
        private Object dataSource;

        /// <summary>
        /// Gets or sets the name of the list or table in the data source for which the DataListView is displaying data.
        /// </summary>
        /// <remarks>If the data source is not a DataSet or DataViewManager, this property has no effect</remarks>
        [Category("Data"),
         Editor("System.Windows.Forms.Design.DataMemberListEditor, System.Design", typeof(UITypeEditor)),
         DefaultValue("")]
        public virtual string DataMember
        {
            get { return dataMember; }
            set {
                if (dataMember != value) {
                    dataMember = value;
                    RebindDataSource();
                }
            }
        }
        private string dataMember = "";

        #endregion

        #region Initialization

        private CurrencyManager currencyManager = null;

        /// <summary>
        /// Our data source has changed. Figure out how to handle the new source
        /// </summary>
        protected virtual void RebindDataSource()
        {
            RebindDataSource(false);
        }

        /// <summary>
        /// Our data source has changed. Figure out how to handle the new source
        /// </summary>
        protected virtual void RebindDataSource(bool forceDataInitialization)
        {
            if (this.BindingContext == null)
                return;

            // Obtain the CurrencyManager for the current data source.
            CurrencyManager tempCurrencyManager = null;

            if (this.DataSource != null) {
                tempCurrencyManager = (CurrencyManager)this.BindingContext[this.DataSource, this.DataMember];
            }

            // Has our currency manager changed?
            if (this.currencyManager != tempCurrencyManager) {

                // Stop listening for events on our old currency manager
                if (this.currencyManager != null) {
                    this.currencyManager.MetaDataChanged -= new EventHandler(currencyManager_MetaDataChanged);
                    this.currencyManager.PositionChanged -= new EventHandler(currencyManager_PositionChanged);
                    this.currencyManager.ListChanged -= new ListChangedEventHandler(currencyManager_ListChanged);
                }

                this.currencyManager = tempCurrencyManager;

                // Start listening for events on our new currency manager
                if (this.currencyManager != null) {
                    this.currencyManager.MetaDataChanged += new EventHandler(currencyManager_MetaDataChanged);
                    this.currencyManager.PositionChanged += new EventHandler(currencyManager_PositionChanged);
                    this.currencyManager.ListChanged += new ListChangedEventHandler(currencyManager_ListChanged);
                }

                // Our currency manager has changed so we have to initialize a new data source
                forceDataInitialization = true;
            }

            if (forceDataInitialization)
                InitializeDataSource();
        }

        /// <summary>
        /// The data source for this control has changed. Reconfigure the control for the new source
        /// </summary>
        protected virtual void InitializeDataSource()
        {
            if (this.Frozen || this.currencyManager == null)
                return;

            this.CreateColumnsFromSource();
            this.CreateMissingAspectGettersAndPutters();
            this.SetObjects(this.currencyManager.List);

            // If we have some data, resize the new columns based on the data available.
            if (this.Items.Count > 0) {
                foreach (ColumnHeader column in this.Columns) {
                    if (column.Width == 0)
                        this.AutoResizeColumn(column.Index, ColumnHeaderAutoResizeStyle.ColumnContent);
                }
            }
        }

        /// <summary>
        /// Create columns for the listview based on what properties are available in the data source
        /// </summary>
        /// <remarks>
        /// <para>This method will not replace existing columns.</para>
        /// </remarks>
        protected virtual void CreateColumnsFromSource()
        {
            if (this.currencyManager == null || this.Columns.Count != 0)
                return;

            PropertyDescriptorCollection properties = this.currencyManager.GetItemProperties();
            if (properties.Count == 0)
                return;

            bool hasBooleanColumns = false;
            for (int i = 0; i < properties.Count; i++) {
                PropertyDescriptor property = properties[i];

                // Relationships to other tables turn up as IBindibleLists. Don't make columns to show them.
                // CHECK: Is this always true? What other things could be here? Constraints? Triggers?
                if (property.PropertyType == typeof(IBindingList))
                    continue;

                // Create a column
                OLVColumn column = new OLVColumn(property.DisplayName, property.Name);
                if (property.PropertyType == typeof(bool) || property.PropertyType == typeof(CheckState)) {
                    hasBooleanColumns = true;
                    column.TextAlign = HorizontalAlignment.Center;
                    column.Width = 32;
                    column.AspectName = property.Name;
                    column.CheckBoxes = true;
                    if (property.PropertyType == typeof(CheckState))
                        column.TriStateCheckBoxes = true;
                } else {
                    column.Width = 0; // zero-width since we will resize it once we have some data

                    // If our column is a BLOB, it could be an image, so assign a renderer to draw it.
                    // CONSIDER: Is this a common enough case to warrant this code?
                    if (property.PropertyType == typeof(System.Byte[]))
                        column.Renderer = new ImageRenderer();
                }
                column.IsEditable = !property.IsReadOnly;

                // Add it to our list
                this.Columns.Add(column);
            }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品中文字幕在线一区| 欧美精品自拍偷拍动漫精品| 久久精品在线观看| 精品一区二区三区久久久| 久久久久久久网| 国产成人av电影免费在线观看| 久久久久国色av免费看影院| 国产成人av电影免费在线观看| 国产精品乱子久久久久| 色综合久久99| 午夜av一区二区三区| 精品久久久网站| 成人看片黄a免费看在线| 亚洲免费在线观看视频| 欧美高清一级片在线| 免费成人在线影院| 国产亚洲精久久久久久| 色婷婷久久综合| 五月婷婷激情综合网| 久久综合久久综合久久综合| 国产v日产∨综合v精品视频| 亚洲免费成人av| 欧美一级搡bbbb搡bbbb| 成人免费视频app| 亚洲第一成人在线| 精品国产三级a在线观看| 97se亚洲国产综合自在线不卡| 亚洲国产日韩综合久久精品| 精品免费99久久| 日本精品免费观看高清观看| 日本美女一区二区三区视频| 国产精品全国免费观看高清| 欧美婷婷六月丁香综合色| 国产在线一区二区综合免费视频| 国产精品久久久久一区二区三区| 91精品在线麻豆| 99久久综合狠狠综合久久| 青青青伊人色综合久久| 国产精品每日更新在线播放网址 | 91麻豆精品91久久久久同性| 国产高清亚洲一区| 亚洲成va人在线观看| 国产人久久人人人人爽| 欧美日韩一区二区三区免费看| 国产一区二区三区在线观看免费视频| 亚洲欧美日韩国产一区二区三区| 欧美一个色资源| 在线这里只有精品| 成人av在线网站| 精品在线视频一区| 午夜精品一区二区三区三上悠亚| 国产精品久久久久久久久久免费看| 欧美日韩精品欧美日韩精品一综合| 国产91在线看| 国内精品国产三级国产a久久| 伊人夜夜躁av伊人久久| 国产精品欧美一区二区三区| 欧美精品一区二区三区蜜桃| 欧美精品九九99久久| 色狠狠色狠狠综合| av资源网一区| 成人夜色视频网站在线观看| 激情综合色综合久久| 日韩av电影免费观看高清完整版在线观看| 国产精品久久久久久久第一福利 | 精品理论电影在线| 欧美理论电影在线| 欧美天堂亚洲电影院在线播放| 成人av资源下载| 成人黄色小视频| 成人午夜在线视频| 成人免费看的视频| 成人av网站大全| av在线一区二区| 99亚偷拍自图区亚洲| 成人av资源下载| 成人免费观看视频| 不卡的av电影| 99精品一区二区三区| 99精品一区二区| 色综合久久六月婷婷中文字幕| 99精品热视频| 91一区二区三区在线观看| 欧美日韩精品一区二区三区四区 | 最近日韩中文字幕| 中文字幕欧美国产| 中文字幕在线免费不卡| 亚洲三级久久久| 一个色综合av| 婷婷成人综合网| 捆绑变态av一区二区三区| 免费成人在线网站| 国产伦精一区二区三区| 成人妖精视频yjsp地址| 91麻豆文化传媒在线观看| 色婷婷狠狠综合| 欧美精选在线播放| 精品国产亚洲在线| 国产精品久99| 亚洲一区在线播放| 久久99国产精品尤物| 国产精品小仙女| 成人av电影免费观看| 色婷婷av一区二区三区gif| 欧美午夜寂寞影院| 欧美成人艳星乳罩| 中文字幕在线一区免费| 亚洲一区二区三区免费视频| 麻豆精品一区二区三区| 国产成人综合亚洲网站| 色综合久久久网| 91精品国产91久久综合桃花| 国产亚洲精品7777| 亚洲精品国久久99热| 日韩电影在线观看电影| 国产成人自拍网| 在线精品视频一区二区三四| 日韩免费高清电影| 综合久久国产九一剧情麻豆| 亚洲mv在线观看| 国产精品18久久久久久vr| 色素色在线综合| 欧美精品一区二区三区蜜桃| 亚洲一区精品在线| 国产东北露脸精品视频| 欧美日本高清视频在线观看| 久久久不卡影院| 日韩二区在线观看| 不卡的av中国片| 精品久久人人做人人爱| 樱花影视一区二区| 国产成人综合在线观看| 91精品综合久久久久久| 亚洲欧美日韩国产成人精品影院 | 美女诱惑一区二区| 色一情一乱一乱一91av| 精品裸体舞一区二区三区| 亚洲一区自拍偷拍| 成人高清免费观看| 精品久久久久久久久久久久久久久| 亚洲一区视频在线| 成人精品视频一区二区三区 | 色综合天天综合网天天狠天天 | 精品国产一区二区亚洲人成毛片| 亚洲日本va午夜在线影院| 国产一区二区三区免费| 欧美精品18+| 亚洲国产精品久久人人爱| 97se亚洲国产综合在线| 国产日韩欧美精品在线| 毛片不卡一区二区| 欧美日韩精品高清| 亚洲激情自拍视频| av资源网一区| 国产精品天干天干在线综合| 精品影视av免费| 日韩一级片在线播放| 亚洲国产人成综合网站| 99精品黄色片免费大全| 中文字幕日本乱码精品影院| 国产福利一区二区| 久久精品日韩一区二区三区| 捆绑调教一区二区三区| 日韩欧美一区在线| 日本女人一区二区三区| 欧美一区二区三区免费观看视频 | 久久国产精品一区二区| 5月丁香婷婷综合| 日韩精品免费专区| 欧美美女一区二区三区| 午夜欧美2019年伦理| 欧美日韩国产一级| 水蜜桃久久夜色精品一区的特点| 欧美日韩成人一区二区| 日韩精品欧美精品| 91精品黄色片免费大全| 三级久久三级久久久| 欧美日韩卡一卡二| 免费成人美女在线观看.| 正在播放一区二区| 日韩电影在线观看电影| 欧美zozo另类异族| 国产一区免费电影| 日本一区二区三区在线不卡| av在线一区二区| 亚洲综合免费观看高清完整版在线| 在线国产电影不卡| 爽好久久久欧美精品| 精品国产自在久精品国产| 国产风韵犹存在线视精品| 国产精品久久三区| 一本色道久久综合亚洲精品按摩| 亚洲一卡二卡三卡四卡| 91麻豆精品久久久久蜜臀| 国产一区二区三区四| 亚洲三级电影网站| 欧美日韩不卡一区| 国产在线播精品第三| 亚洲同性同志一二三专区| 欧美吞精做爰啪啪高潮|