Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Alberto Cortez <calberto.cortez@gmail.com>2007-01-04 23:22:33 +0300
committerCarlos Alberto Cortez <calberto.cortez@gmail.com>2007-01-04 23:22:33 +0300
commit0037f9d7477a3ae585162a3e0713a98e7ffc540f (patch)
tree5f58979f26f121e6d74a1a2b69e63f297517a7fd
parent7686093a3976d4208106cf36353e56590d6eb48e (diff)
2006-01-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* ColumnHeader.cs: * ListView.cs: Implement 2.0 ColumnHeader.DisplayIndex property by using the internal information of the columns order in ListView. svn path=/trunk/mcs/; revision=70497
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog7
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs16
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs16
3 files changed, 36 insertions, 3 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index a480dc7c154..c7247f3aa00 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * ColumnHeader.cs:
+ * ListView.cs: Implement 2.0 ColumnHeader.DisplayIndex
+ property by using the internal information of the
+ columns order in ListView.
+
2007-01-04 Jonathan Pobst <monkey@jpobst.com>
* CommonDialog.cs, Cursor.cs, ErrorProvider.cs, HelpProvider.cs:
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
index c287171ebc8..807c0f6a794 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ColumnHeader.cs
@@ -170,8 +170,20 @@ namespace System.Windows.Forms
[Localizable (true)]
[RefreshProperties (RefreshProperties.Repaint)]
public int DisplayIndex {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get {
+ if (owner == null)
+ return -1;
+
+ return owner.GetReorderedColumnIndex (this);
+ }
+ set {
+ if (owner == null)
+ return;
+ if (value < 0 || value >= owner.Columns.Count)
+ throw new ArgumentOutOfRangeException ("value");
+
+ owner.ReorderColumn (this, value);
+ }
}
[DefaultValue (-1)]
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
index 3889c022654..f795e4df6aa 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs
@@ -975,6 +975,20 @@ namespace System.Windows.Forms
item_control.Width -= v_scroll.Width;
}
}
+
+#if NET_2_0
+ internal int GetReorderedColumnIndex (ColumnHeader column)
+ {
+ if (reordered_column_indices == null)
+ return column.Index;
+
+ for (int i = 0; i < Columns.Count; i++)
+ if (reordered_column_indices [i] == column.Index)
+ return i;
+
+ return -1;
+ }
+#endif
ColumnHeader GetReorderedColumn (int index)
{
@@ -984,7 +998,7 @@ namespace System.Windows.Forms
return Columns [reordered_column_indices [index]];
}
- void ReorderColumn (ColumnHeader col, int index)
+ internal void ReorderColumn (ColumnHeader col, int index)
{
#if NET_2_0
ColumnReorderedEventHandler eh = (ColumnReorderedEventHandler) (Events [ColumnReorderedEvent]);