Author: jordi
Date: 2005-03-31 13:19:34 -0500 (Thu, 31 Mar 2005)
New Revision: 42437

Added:
   trunk/winforms/datagrid/
   trunk/winforms/datagrid/classes/
   trunk/winforms/datagrid/classes/DataGridBoolColumnTests.cs
   trunk/winforms/datagrid/classes/DataGridTableStylesTests.cs
   trunk/winforms/datagrid/classes/GridColumnStylesCollectionTests.cs
   trunk/winforms/datagrid/classes/GridTableStylesCollectionTests.cs
   trunk/winforms/datagrid/classes/Makefile
Log:
Datagrid Containter and Data test classes

Added: trunk/winforms/datagrid/classes/DataGridBoolColumnTests.cs
===================================================================
--- trunk/winforms/datagrid/classes/DataGridBoolColumnTests.cs  2005-03-31 
17:31:55 UTC (rev 42436)
+++ trunk/winforms/datagrid/classes/DataGridBoolColumnTests.cs  2005-03-31 
18:19:34 UTC (rev 42437)
@@ -0,0 +1,73 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+//     Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace DatagridTests
+{
+       class DataGridBoolColumnTests
+       {
+               public void DumpDataGridBoolColumn (DataGridBoolColumn ts)
+               {
+                       Console.WriteLine ("AllowNull {0} ", ts.AllowNull);
+                       Console.WriteLine ("FalseValue {0} ", ts.FalseValue);
+                       Console.WriteLine ("NullValue {0} ", ts.NullValue);
+                       Console.WriteLine ("TrueValue {0} ", ts.TrueValue);
+                       Console.WriteLine ("Alignment {0} ", ts.Alignment);
+                       Console.WriteLine ("DataGridTableStyle {0} ", 
ts.DataGridTableStyle);
+                       Console.WriteLine ("HeaderAccessibleObject {0} ", 
ts.HeaderAccessibleObject);
+                       Console.WriteLine ("HeaderText {0} ", ts.HeaderText);
+                       Console.WriteLine ("MappingName {0} ", ts.NullText);
+                       Console.WriteLine ("PropertyDescriptor {0} ", 
ts.PropertyDescriptor);
+                       Console.WriteLine ("ReadOnly {0} ", ts.ReadOnly);
+                       Console.WriteLine ("Width {0} ", ts.Width);
+               }
+
+               public DataGridBoolColumnTests ()
+               {
+                       DataGridBoolColumn bc = new DataGridBoolColumn ();
+                       bc.FalseValueChanged += new System.EventHandler 
(OnFalseValueChanged);
+
+                       Console.WriteLine ("DataGridBoolColumn default --- ");
+                       DumpDataGridBoolColumn (bc);
+                       bc.FalseValue = true;
+
+               }
+
+               public static void Main (string[] args)
+               {
+                       new DataGridBoolColumnTests ();
+               }
+
+               private void OnFalseValueChanged (object sender, 
System.EventArgs e)
+               {
+                       Console.WriteLine ("FalseValueChanged fired");
+               }
+
+       }
+}

Added: trunk/winforms/datagrid/classes/DataGridTableStylesTests.cs
===================================================================
--- trunk/winforms/datagrid/classes/DataGridTableStylesTests.cs 2005-03-31 
17:31:55 UTC (rev 42436)
+++ trunk/winforms/datagrid/classes/DataGridTableStylesTests.cs 2005-03-31 
18:19:34 UTC (rev 42437)
@@ -0,0 +1,107 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+//     Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+// Tests DataGridTableStyles class implementation
+//
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace DatagridTests
+{
+       class DataGridTableStylesTests
+       {
+               public class ourDataGridTableStyle : 
System.Windows.Forms.DataGridTableStyle
+               {
+                       public ourDataGridTableStyle () : base ()
+                       {
+
+                       }
+
+                       public void DumpDataGridTableStyleShouldSerialize ()
+                       {
+                               Console.WriteLine 
("ShouldSerializeAlternatingBackColor {0} ", 
ShouldSerializeAlternatingBackColor ());
+                               Console.WriteLine ("ShouldSerializeBackColor 
{0} ", ShouldSerializeBackColor ());
+                               Console.WriteLine ("ShouldSerializeForeColor 
{0} ", ShouldSerializeForeColor ());
+                               Console.WriteLine 
("ShouldSerializeGridLineColor {0} ", ShouldSerializeGridLineColor ());
+                               Console.WriteLine 
("ShouldSerializeHeaderBackColor {0} ", ShouldSerializeHeaderBackColor ());
+                               Console.WriteLine 
("ShouldSerializeHeaderForeColor {0} ", ShouldSerializeHeaderForeColor ());
+                               Console.WriteLine ("ShouldSerializeLinkColor 
{0} ", ShouldSerializeLinkColor ());
+                               Console.WriteLine 
("ShouldSerializeLinkHoverColor {0} ", ShouldSerializeLinkHoverColor ());
+                               Console.WriteLine 
("ShouldSerializePreferredRowHeight {0} ", ShouldSerializePreferredRowHeight 
());
+                               Console.WriteLine 
("ShouldSerializeSelectionBackColor {0} ", ShouldSerializeSelectionBackColor 
());
+                               Console.WriteLine 
("ShouldSerializeSelectionForeColor {0} ", ShouldSerializeSelectionForeColor 
());
+                       }
+               }
+
+               public void DumpDataGridTableStyleProperties 
(DataGridTableStyle ts)
+               {
+                       Console.WriteLine ("AllowSorting {0} ", 
ts.AllowSorting);
+                       Console.WriteLine ("AlternatingBackColor {0} ", 
ts.AlternatingBackColor);
+                       Console.WriteLine ("BackColor {0} ", ts.BackColor);
+                       Console.WriteLine ("ColumnHeadersVisible {0} ", 
ts.ColumnHeadersVisible);
+                       Console.WriteLine ("ForeColor {0} ", ts.ForeColor);
+                       Console.WriteLine ("GridLineColor {0} ", 
ts.GridLineColor);
+                       Console.WriteLine ("GridLineStyle {0} ", 
ts.GridLineStyle);
+                       Console.WriteLine ("HeaderBackColor {0} ", 
ts.HeaderBackColor);
+                       Console.WriteLine ("HeaderFont {0} ", ts.HeaderFont);
+                       Console.WriteLine ("HeaderForeColor {0} ", 
ts.HeaderForeColor);
+                       Console.WriteLine ("LinkColor {0} ", ts.LinkColor);
+                       Console.WriteLine ("LinkHoverColor {0} ", 
ts.LinkHoverColor);
+                       Console.WriteLine ("MappingName {0} ", ts.MappingName);
+                       Console.WriteLine ("PreferredColumnWidth {0} ", 
ts.PreferredColumnWidth);
+                       Console.WriteLine ("PreferredRowHeight {0} ", 
ts.PreferredRowHeight);
+                       Console.WriteLine ("ReadOnly {0} ", ts.ReadOnly);
+                       Console.WriteLine ("RowHeadersVisible {0} ", 
ts.RowHeadersVisible);
+                       Console.WriteLine ("RowHeaderWidth {0} ", 
ts.RowHeaderWidth);
+                       Console.WriteLine ("SelectionBackColor {0} ", 
ts.SelectionBackColor);
+                       Console.WriteLine ("SelectionForeColor {0} ", 
ts.SelectionForeColor);
+               }
+
+               public DataGridTableStylesTests ()
+               {
+                       ourDataGridTableStyle ts = new ourDataGridTableStyle ();
+                       Console.WriteLine ("DataGridTableStyle default --- ");
+                       DumpDataGridTableStyleProperties (ts);
+
+                       ts.BackColor = Color.White;
+                       ts.SelectionForeColor = Color.Blue;
+
+                       ts.DumpDataGridTableStyleShouldSerialize ();
+                       Console.WriteLine ("BackColor {0} ", ts.BackColor);
+
+                       ts.ResetBackColor ();
+                       ts.ResetSelectionForeColor ();
+                       Console.WriteLine ("DataGridTableStyle after Reset --- 
");
+                       DumpDataGridTableStyleProperties (ts);
+               }
+
+               public static void Main (string[] args)
+               {
+                       new DataGridTableStylesTests ();
+               }
+
+       }
+}

Added: trunk/winforms/datagrid/classes/GridColumnStylesCollectionTests.cs
===================================================================
--- trunk/winforms/datagrid/classes/GridColumnStylesCollectionTests.cs  
2005-03-31 17:31:55 UTC (rev 42436)
+++ trunk/winforms/datagrid/classes/GridColumnStylesCollectionTests.cs  
2005-03-31 18:19:34 UTC (rev 42437)
@@ -0,0 +1,59 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+//     Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace DatagridTests
+{
+       class GridColumnStylesCollectionTests
+       {
+               public void DumpGridColumnStylesCollection 
(GridColumnStylesCollection ts)
+               {
+                       Console.WriteLine ("IsSynchronized {0} ", 
ts.IsSynchronized);
+                       Console.WriteLine ("SyncRoot {0} ", ts.SyncRoot);
+                       //Console.WriteLine ("IsFixedSize {0} ", 
ts.IsFixedSize);
+                       Console.WriteLine ("IsReadOnly {0} ", ts.IsReadOnly);
+               }
+
+               public GridColumnStylesCollectionTests ()
+               {
+                       DataGridTableStyle ts = new DataGridTableStyle ();
+                       GridColumnStylesCollection sc = ts.GridColumnStyles;
+
+                       Console.WriteLine ("GridColumnStylesCollection default 
--- ");
+                       DumpGridColumnStylesCollection (sc);
+
+               }
+
+               public static void Main (string[] args)
+               {
+                       new GridColumnStylesCollectionTests ();
+               }
+       }
+}
+

Added: trunk/winforms/datagrid/classes/GridTableStylesCollectionTests.cs
===================================================================
--- trunk/winforms/datagrid/classes/GridTableStylesCollectionTests.cs   
2005-03-31 17:31:55 UTC (rev 42436)
+++ trunk/winforms/datagrid/classes/GridTableStylesCollectionTests.cs   
2005-03-31 18:19:34 UTC (rev 42437)
@@ -0,0 +1,86 @@
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+// Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
+//
+// Author:
+//     Jordi Mas i Hernadez <[EMAIL PROTECTED]>
+//
+//
+
+using System;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace DatagridTests
+{
+       class GridTableStylesCollectionTests
+       {
+               public void DumpGridTableStylesCollection 
(GridTableStylesCollection ts)
+               {
+                       Console.WriteLine ("IsSynchronized {0} ", 
ts.IsSynchronized);
+                       Console.WriteLine ("SyncRoot {0} ", ts.SyncRoot);
+                       Console.WriteLine ("IsReadOnly {0} ", ts.IsReadOnly);
+               }
+
+               public GridTableStylesCollectionTests ()
+               {
+                       DataGrid grid = new DataGrid ();
+                       GridTableStylesCollection sc = grid.TableStyles;
+                       sc.CollectionChanged += new 
CollectionChangeEventHandler (OnCollectionChanged);
+
+                       Console.WriteLine ("GridColumnStylesCollection default 
--- ");
+                       DumpGridTableStylesCollection (sc);
+
+                       Console.WriteLine ("Add single item");
+                       DataGridTableStyle ts = new DataGridTableStyle ();
+                       ts.MappingName = "Table1";
+                       sc.Add (ts);
+
+                       Console.WriteLine ("Add multipleitems");
+                       sc.AddRange (new DataGridTableStyle [] {new 
DataGridTableStyle (), new DataGridTableStyle ()});
+                       Console.WriteLine ("Remove At");
+                       sc.RemoveAt (2);
+
+                       Console.WriteLine ("Add single item");
+                       ts = new DataGridTableStyle ();
+                       ts.MappingName = "Table2";
+                       sc.Add (ts);
+
+                       for (int i = 0; i < sc.Count; i ++)
+                               Console.WriteLine ("Element {0}:{1}", i, 
sc[i].MappingName);
+
+                       sc.Remove (ts);
+                       Console.WriteLine ("Contains Table1 {0}", sc.Contains 
("Table1"));
+                       Console.WriteLine ("Contains Table4 {0}", sc.Contains 
("Table4"));
+               }
+
+               public static void Main (string[] args)
+               {
+                       new GridTableStylesCollectionTests ();
+               }
+
+               private void OnCollectionChanged (object sender, 
CollectionChangeEventArgs e)
+               {
+                       Console.WriteLine ("OnCollectionChanged fired: Action 
[{0}] Element [{1}]",
+                               e.Action, e.Element);
+               }
+
+       }
+}

Added: trunk/winforms/datagrid/classes/Makefile
===================================================================
--- trunk/winforms/datagrid/classes/Makefile    2005-03-31 17:31:55 UTC (rev 
42436)
+++ trunk/winforms/datagrid/classes/Makefile    2005-03-31 18:19:34 UTC (rev 
42437)
@@ -0,0 +1,10 @@
+all: mono
+
+mono: DataGridTableStylesTests.cs DataGridBoolColumnTests.cs 
GridColumnStylesCollectionTests.cs GridTableStylesCollectionTests.cs
+       mcs DataGridTableStylesTests.cs /r:System.Windows.Forms.dll 
/r:System.Drawing.dll
+       mcs DataGridBoolColumnTests.cs /r:System.Windows.Forms.dll 
/r:System.Drawing.dll
+       mcs GridColumnStylesCollectionTests.cs /r:System.Windows.Forms.dll 
/r:System.Drawing.dll
+       mcs GridTableStylesCollectionTests.cs /r:System.Windows.Forms.dll 
/r:System.Drawing.dll
+
+clean:
+       rm swf-datagrid.exe -r -f

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to