?? objectlistview.cs
字號:
/// </remarks>
[Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual IList CheckedObjects
{
get {
ArrayList objects = new ArrayList();
if (this.CheckBoxes) {
for (int i = 0; i < this.GetItemCount(); i++) {
OLVListItem olvi = this.GetItem(i);
if (olvi.CheckState == CheckState.Checked)
objects.Add(olvi.RowObject);
}
}
return objects;
}
set {
if (!this.CheckBoxes)
return;
if (value == null)
value = new ArrayList();
foreach (Object x in this.Objects) {
if (value.Contains(x))
this.SetObjectCheckedness(x, CheckState.Checked);
else
this.SetObjectCheckedness(x, CheckState.Unchecked);
}
}
}
/// <summary>
/// Get/set the list of columns that should be used when the list switches to tile view.
/// </summary>
[Browsable(false),
Obsolete("Use GetFilteredColumns() and OLVColumn.IsTileViewColumn instead"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public List<OLVColumn> ColumnsForTileView
{
get { return this.GetFilteredColumns(View.Tile); }
}
/// <summary>
/// Return the visible columns in the order they are displayed to the user
/// </summary>
[Browsable(false)]
public virtual List<OLVColumn> ColumnsInDisplayOrder
{
get {
List<OLVColumn> columnsInDisplayOrder = new List<OLVColumn>(this.Columns.Count);
for (int i = 0; i < this.Columns.Count; i++)
columnsInDisplayOrder.Add(null);
for (int i = 0; i < this.Columns.Count; i++) {
OLVColumn col = this.GetColumn(i);
columnsInDisplayOrder[col.DisplayIndex] = col;
}
return columnsInDisplayOrder;
}
}
/// <summary>
/// When owner drawing, this renderer will draw columns that do not have specific renderer
/// given to them
/// </summary>
/// <remarks>If you try to set this to null, it will revert to a BaseRenderer</remarks>
[Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public IRenderer DefaultRenderer
{
get { return defaultRenderer; }
set
{
if (value == null)
defaultRenderer = new BaseRenderer();
else
defaultRenderer = value;
}
}
private IRenderer defaultRenderer = new BaseRenderer();
/// <summary>
/// This registry decides what control should be used to edit what cells, based
/// on the type of the value in the cell.
/// </summary>
/// <see cref="EditorRegistry"/>
/// <remarks>All instances of ObjectListView share the same editor registry.</remarks>
static public EditorRegistry EditorRegistry = new EditorRegistry();
/// <summary>
/// If there are no items in this list view, what m should be drawn onto the control?
/// </summary>
[Category("Appearance"),
Description("When the list has no items, show this m in the control"),
DefaultValue(null)]
public virtual String EmptyListMsg
{
get { return emptyListMsg; }
set {
if (emptyListMsg != value) {
emptyListMsg = value;
this.Invalidate();
}
}
}
private String emptyListMsg;
/// <summary>
/// What font should the 'list empty' m be drawn in?
/// </summary>
[Category("Appearance"),
Description("What font should the 'list empty' m be drawn in?"),
DefaultValue(null)]
public virtual Font EmptyListMsgFont
{
get { return emptyListMsgFont; }
set { emptyListMsgFont = value; }
}
private Font emptyListMsgFont;
/// <summary>
/// Return the font for the 'list empty' m or a default
/// </summary>
[Browsable(false)]
public virtual Font EmptyListMsgFontOrDefault
{
get {
if (this.EmptyListMsgFont == null)
return new Font("Tahoma", 14);
else
return this.EmptyListMsgFont;
}
}
/// <summary>
/// Get or set whether or not the listview is frozen. When the listview is
/// frozen, it will not update itself.
/// </summary>
/// <remarks><para>The Frozen property is similar to the methods Freeze()/Unfreeze()
/// except that changes to the Frozen property do not nest.</para></remarks>
/// <example>objectListView1.Frozen = false; // unfreeze the control regardless of the number of Freeze() calls
/// </example>
[Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual bool Frozen
{
get { return freezeCount > 0; }
set {
if (value)
Freeze();
else if (freezeCount > 0) {
freezeCount = 1;
Unfreeze();
}
}
}
private int freezeCount = 0;
/// <summary>
/// When a group title has an item count, how should the lable be formatted?
/// </summary>
/// <remarks>
/// The given format string can/should have two placeholders:
/// <list type="bullet">
/// <item>{0} - the original group title</item>
/// <item>{1} - the number of items in the group</item>
/// </list>
/// </remarks>
/// <example>"{0} [{1} items]"</example>
[Category("Behavior - ObjectListView"),
Description("The format to use when suffixing item counts to group titles"),
DefaultValue(null)]
public virtual string GroupWithItemCountFormat
{
get { return groupWithItemCountFormat; }
set { groupWithItemCountFormat = value; }
}
private string groupWithItemCountFormat;
/// <summary>
/// Return this.GroupWithItemCountFormat or a reasonable default
/// </summary>
[Browsable(false)]
public virtual string GroupWithItemCountFormatOrDefault
{
get {
if (String.IsNullOrEmpty(this.GroupWithItemCountFormat))
return "{0} [{1} items]";
else
return this.GroupWithItemCountFormat;
}
}
/// <summary>
/// When a group title has an item count, how should the lable be formatted if
/// there is only one item in the group?
/// </summary>
/// <remarks>
/// The given format string can/should have two placeholders:
/// <list type="bullet">
/// <item>{0} - the original group title</item>
/// <item>{1} - the number of items in the group (always 1)</item>
/// </list>
/// </remarks>
/// <example>"{0} [{1} item]"</example>
[Category("Behavior - ObjectListView"),
Description("The format to use when suffixing item counts to group titles"),
DefaultValue(null)]
public virtual string GroupWithItemCountSingularFormat
{
get { return groupWithItemCountSingularFormat; }
set { groupWithItemCountSingularFormat = value; }
}
private string groupWithItemCountSingularFormat;
/// <summary>
/// Return this.GroupWithItemCountSingularFormat or a reasonable default
/// </summary>
[Browsable(false)]
public virtual string GroupWithItemCountSingularFormatOrDefault
{
get {
if (String.IsNullOrEmpty(this.GroupWithItemCountSingularFormat))
return "{0} [{1} item]";
else
return this.GroupWithItemCountSingularFormat;
}
}
/// <summary>
/// Does this listview have a m that should be drawn when the list is empty?
/// </summary>
[Browsable(false)]
public virtual bool HasEmptyListMsg
{
get { return !String.IsNullOrEmpty(this.EmptyListMsg); }
}
/// <summary>
/// The index of the item that is 'hot', i.e. under the cursor. -1 means no item.
/// </summary>
[Browsable(false),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public virtual int HotItemIndex
{
get { return hotItemIndex; }
set { hotItemIndex = value; }
}
private int hotItemIndex = -1;
/// <summary>
/// What sort of formatting should be applied to the row under the cursor?
/// </summary>
/// <remarks>This only takes effect when UseHotItem is true.</remarks>
[Category("Appearance"),
Description("How should the row under the cursor be highlighted"),
DefaultValue(null)]
public virtual HotItemStyle HotItemStyle
{
get { return this.hotItemStyle; }
set { this.hotItemStyle = value; }
}
private HotItemStyle hotItemStyle;
/// <summary>
/// What color should be used for the background of selected rows?
/// </summary>
/// <remarks>Windows does not give the option of changing the selection background.
/// So the control has to be owner drawn to see the result of this setting.
/// Setting UseCustomSelectionColors = true will do this for you.</remarks>
[Category("Appearance"),
Description("The background foregroundColor of selected rows when the control is owner drawn"),
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -