| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562 |
- // 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 Hernandez <[email protected]>
- //
- //
- using System;
- using System.Windows.Forms;
- using System.Drawing;
- using System.IO;
- using System.Reflection;
- using System.Runtime.Serialization;
- using System.Runtime.Serialization.Formatters;
- using System.Runtime.Serialization.Formatters.Binary;
- using NUnit.Framework;
-
- namespace MonoTests.System.Windows.Forms
- {
- [TestFixture]
- public class ListViewItemTest : TestHelper
- {
- [Test]
- public void ListViewItemConstructors ()
- {
- Font fnt = new Font ("Arial", 12);
- ListViewItem item1 = new ListViewItem ("Hello folks");
- Assert.AreEqual ("Hello folks", item1.Text, "Constructor#1");
- ListViewItem item2 = new ListViewItem (new string [] {"Element1", "Element2"},
- -1, Color.Blue, Color.Red, fnt);
- Assert.AreEqual (item2.ForeColor, Color.Blue, "Constructor#2");
- Assert.AreEqual (item2.BackColor, Color.Red, "Constructor#3");
- Assert.AreEqual (2, item2.SubItems.Count,"Constructor#4");
- Assert.AreEqual (Color.Blue, item2.SubItems[0].ForeColor,"Constructor#5");
- Assert.AreEqual (Color.Red, item2.SubItems[0].BackColor, "Constructor#6");
- Assert.AreEqual (fnt, item2.SubItems[0].Font, "Constructor#7");
- Assert.AreEqual ("Element1", item2.SubItems[0].Text, "Constructor#8");
- Assert.AreEqual ("Element2", item2.SubItems[1].Text, "Constructor#12");
- ListViewItem item3 = new ListViewItem ((string)null);
- Assert.AreEqual (String.Empty, item3.Text, "Constructor#13");
- ListViewItem item4 = new ListViewItem ((string)null, -99);
- Assert.AreEqual (String.Empty, item4.Text, "Constructor#14");
- Assert.AreEqual (-99, item4.ImageIndex, "Constructor#15");
- ListViewItem item5 = new ListViewItem (new string [2]);
- Assert.AreEqual (2, item5.SubItems.Count, "Constructor#16");
- Assert.IsNotNull (item5.SubItems [0], "Constructor#17");
- Assert.IsNotNull (item5.SubItems [1], "Constructor#18");
- ListViewItem item6 = new ListViewItem (new string [2], -1, Color.Blue, Color.Red,
- fnt);
- Assert.AreEqual (2, item6.SubItems.Count, "Constructor#19");
- Assert.IsNotNull (item6.SubItems [0], "Constructor#20");
- Assert.IsNotNull (item6.SubItems [1], "Constructor#21");
- Assert.AreEqual (Color.Blue, item6.ForeColor, "Constructor#22");
- Assert.AreEqual (Color.Blue, item6.SubItems [0].ForeColor, "Constructor#23");
- Assert.AreEqual (Color.Red, item6.BackColor, "Constructor#24");
- Assert.AreEqual (Color.Red, item6.SubItems [0].BackColor, "Constructor#25");
- Assert.AreEqual (fnt, item6.Font, "Constructor#26");
- Assert.AreEqual (fnt, item6.SubItems [0].Font, "Constructor#27");
- }
- [Test]
- public void Constructor2_Text_Null ()
- {
- ListViewItem item = new ListViewItem ((string) null);
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.AreEqual (1, item.SubItems.Count, "#2");
- Assert.IsNotNull (item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
- }
- [Test]
- public void Constructor3_Items_Empty ()
- {
- ListViewItem item = new ListViewItem (new string [3]);
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.AreEqual (3, item.SubItems.Count, "#2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#4");
- Assert.AreEqual (string.Empty, item.SubItems [2].Text, "#5");
- }
- [Test]
- public void Constructor3_Items_Null ()
- {
- ListViewItem item = new ListViewItem ((string []) null);
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.AreEqual (1, item.SubItems.Count, "#2");
- Assert.IsNotNull (item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
- }
- [Test]
- [ExpectedException (typeof (NullReferenceException))]
- public void Constructor4_SubItems_Empty ()
- {
- new ListViewItem (new ListViewItem.ListViewSubItem [2], 3);
- }
- [Test]
- [ExpectedException (typeof (NullReferenceException))]
- public void Constructor4_SubItems_Null ()
- {
- new ListViewItem ((ListViewItem.ListViewSubItem []) null, 3);
- }
- [Test]
- public void Constructor5_Text_Null ()
- {
- ListViewItem item = new ListViewItem ((string) null, 2);
- Assert.AreEqual (2, item.ImageIndex, "#1");
- Assert.AreEqual (1, item.SubItems.Count, "#2");
- Assert.IsNotNull (item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
- }
- [Test]
- public void Constructor6_Items_Empty ()
- {
- ListViewItem item = new ListViewItem (new string [3], 5);
- Assert.AreEqual (5, item.ImageIndex, "#1");
- Assert.AreEqual (3, item.SubItems.Count, "#2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#4");
- Assert.AreEqual (string.Empty, item.SubItems [2].Text, "#5");
- }
- [Test]
- public void Constructor6_Items_Null ()
- {
- ListViewItem item = new ListViewItem ((string []) null, 3);
- Assert.AreEqual (3, item.ImageIndex, "#1");
- Assert.AreEqual (1, item.SubItems.Count, "#2");
- Assert.IsNotNull (item.SubItems [0].Text, "#3");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
- }
- [Test]
- public void Constructor7_Items_Empty ()
- {
- Font font = new Font (FontFamily.GenericSansSerif, 6);
- ListViewItem item = new ListViewItem (new string [2], 3, Color.Red,
- Color.Blue, font);
- Assert.AreEqual (Color.Blue, item.BackColor, "#1");
- Assert.AreEqual (Color.Red, item.ForeColor, "#2");
- Assert.AreSame (font, item.Font, "#3");
- Assert.AreEqual (3, item.ImageIndex, "#4");
- Assert.AreEqual (2, item.SubItems.Count, "#5");
- Assert.IsNotNull (item.SubItems [0].Text, "#6");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#7");
- Assert.IsNotNull (item.SubItems [1].Text, "#8");
- Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#9");
- }
- [Test]
- public void Constructor7_Items_Null ()
- {
- Font font = new Font (FontFamily.GenericSansSerif, 6);
- ListViewItem item = new ListViewItem ((string []) null, 3, Color.Red,
- Color.Blue, font);
- Assert.AreEqual (Color.Blue, item.BackColor, "#1");
- Assert.AreEqual (Color.Red, item.ForeColor, "#2");
- Assert.AreSame (font, item.Font, "#3");
- Assert.AreEqual (3, item.ImageIndex, "#4");
- Assert.AreEqual (1, item.SubItems.Count, "#5");
- Assert.IsNotNull (item.SubItems [0].Text, "#6");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#7");
- }
- #if NET_2_0
- [Test]
- public void Constructor9_Text_Null ()
- {
- ListViewItem item = new ListViewItem ((string) null, "key");
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.IsNotNull (item.ImageKey, "#2");
- Assert.AreEqual ("key", item.ImageKey, "#3");
- Assert.AreEqual (1, item.SubItems.Count, "#4");
- Assert.IsNotNull (item.SubItems [0].Text, "#5");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#6");
- }
- [Test]
- public void Constructor9_ImageKey_Null ()
- {
- ListViewItem item = new ListViewItem ("name", (string) null);
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.IsNotNull (item.ImageKey, "#2");
- Assert.AreEqual (string.Empty, item.ImageKey, "#3");
- Assert.AreEqual (1, item.SubItems.Count, "#4");
- Assert.IsNotNull (item.SubItems [0].Text, "#5");
- Assert.AreEqual ("name", item.SubItems [0].Text, "#6");
- }
- [Test]
- [ExpectedException (typeof (NullReferenceException))]
- public void Constructor10_SubItems_Null ()
- {
- new ListViewItem ((ListViewItem.ListViewSubItem []) null, "key");
- }
- [Test]
- [ExpectedException (typeof (NullReferenceException))]
- public void Constructor10_SubItems_Empty ()
- {
- new ListViewItem (new ListViewItem.ListViewSubItem [2], "key");
- }
- [Test]
- public void Constructor10_ImageKey_Null ()
- {
- ListViewItem.ListViewSubItem subItemA = new ListViewItem.ListViewSubItem ();
- subItemA.Text = "A";
- ListViewItem.ListViewSubItem subItemB = new ListViewItem.ListViewSubItem ();
- subItemB.Text = "B";
- ListViewItem item = new ListViewItem (new ListViewItem.ListViewSubItem [] {
- subItemA, subItemB }, (string) null);
- Assert.AreEqual (-1, item.ImageIndex, "#1");
- Assert.IsNotNull (item.ImageKey, "#2");
- Assert.AreEqual (string.Empty, item.ImageKey, "#3");
- Assert.AreEqual (2, item.SubItems.Count, "#4");
- Assert.IsNotNull (item.SubItems [0].Text, "#5");
- Assert.AreEqual ("A", item.SubItems [0].Text, "#6");
- Assert.IsNotNull (item.SubItems [1].Text, "#7");
- Assert.AreEqual ("B", item.SubItems [1].Text, "#8");
- }
- [Test]
- public void Constructor_Groups ()
- {
- ListViewItem itemA = new ListViewItem ((ListViewGroup) null);
- Assert.AreEqual (null, itemA.Group, "#A1");
- ListViewGroup group = new ListViewGroup ("Group A");
- group.Items.Add (itemA);
- ListViewItem itemB = new ListViewItem ("B", group);
- Assert.AreEqual (group, itemB.Group, "#B1");
- Assert.AreEqual (2, group.Items.Count, "#B2");
- Assert.AreEqual (itemB, group.Items [1], "#B3");
- }
- [Test]
- public void Constructor_Serializable ()
- {
- ListViewItem item = new ListViewItem ("A");
- ListView lvw = new ListView ();
- lvw.Items.Add (item);
- lvw.CreateControl (); // Need to calculate layout
- item.SubItems.Add ("B");
- item.SubItems.Add ("C");
- item.SubItems.Add ("D");
- item.BackColor = Color.AliceBlue;
- item.Checked = true;
- item.Font = new Font (item.Font, FontStyle.Bold);
- item.ForeColor = Color.AntiqueWhite;
- item.ImageIndex = 1;
- item.Selected = true;
- item.Tag = "Tag";
- item.UseItemStyleForSubItems = false;
- ListViewGroup group = lvw.Groups.Add ("GroupKey", "MyGroup");
- group.Items.Add (item);
- item.ImageKey = "MyKey";
- item.IndentCount = 2;
- item.Name = "MyName";
- item.ToolTipText = "MyTooltipText";
- MemoryStream ms = new MemoryStream ();
- BinaryFormatter formatter = new BinaryFormatter ();
- formatter.Serialize (ms, item);
- ListViewItem item2 = null;
- ms.Position = 0;
- item2 = (ListViewItem) formatter.Deserialize (ms);
- Assert.AreEqual ("A", item2.Text, "#A1");
- Assert.AreEqual ("A", item2.SubItems [0].Text, "#A2");
- Assert.AreEqual ("B", item2.SubItems [1].Text, "#A3");
- Assert.AreEqual ("C", item2.SubItems [2].Text, "#A4");
- Assert.AreEqual (Color.AliceBlue, item2.BackColor, "#A4");
- Assert.AreEqual (null, item2.ListView, "#A5");
- Assert.AreEqual (Rectangle.Empty, item2.Bounds, "#A6");
- Assert.AreEqual (item.Checked, item2.Checked, "#A7");
- Assert.AreEqual (item.Font, item2.Font, "#A8");
- Assert.AreEqual (item.ForeColor, item2.ForeColor, "#A9");
- Assert.AreEqual (item.ImageIndex, item2.ImageIndex, "#A10");
- Assert.AreEqual (-1, item2.Index, "#A11");
- Assert.AreEqual (false, item2.Selected, "#A12");
- Assert.AreEqual (null, item2.Tag, "#A13");
- Assert.AreEqual (item.UseItemStyleForSubItems, item2.UseItemStyleForSubItems, "#A14");
- Assert.AreEqual (item.ImageKey, item2.ImageKey, "#A15");
- Assert.AreEqual (0, item2.IndentCount, "#A16");
- Assert.AreEqual (String.Empty, item2.Name, "#A17");
- Assert.AreEqual (new Point (-1, -1), item2.Position, "#A18");
- Assert.AreEqual (String.Empty, item2.ToolTipText, "#A19");
- Assert.AreEqual (item.Group.Header, item2.Group.Header, "#A20");
- }
- #endif
- [Test]
- public void ListViewItemDefaultValues ()
- {
- ListViewItem item = new ListViewItem ();
- Assert.IsFalse (item.Focused, "DefaultValues#3");
- Assert.IsFalse (item.Checked, "DefaultValues#4");
- Assert.AreEqual (string.Empty, item.Text, "DefaultValues#5");
- Assert.IsTrue (item.UseItemStyleForSubItems, "DefaultValues#6");
- Assert.AreEqual (-1, item.ImageIndex, "DefaultValues#7");
- #if NET_2_0
- Assert.AreEqual (String.Empty, item.Name, "DefaultValues#8");
- Assert.AreEqual(String.Empty, item.ImageKey, "DefaultValues#9");
- Assert.AreEqual (String.Empty, item.ToolTipText, "DefaultValues#10");
- Assert.AreEqual (0, item.IndentCount, "DefaultValues#11");
- #endif
- }
- [Test]
- public void ListViewItemBackColor ()
- {
- ListViewItem item = new ListViewItem ();
- ListView lv = new ListView ();
- lv.Items.Add (item);
- lv.BackColor = Color.Orange;
- Assert.AreEqual (lv.BackColor, item.BackColor, "BackColor#1");
- Assert.AreEqual (lv.BackColor, item.SubItems [0].BackColor, "BackColor#2");
- item.BackColor = Color.Navy;
- Assert.AreEqual (Color.Navy, item.BackColor, "BackColor#3");
- Assert.AreEqual (Color.Navy, item.SubItems [0].BackColor, "BackColor#4");
- item.SubItems [0].BackColor = Color.Green;
- Assert.AreEqual (Color.Green, item.BackColor, "BackColor#5");
- Assert.AreEqual (Color.Green, item.SubItems [0].BackColor, "BackColor#6");
- }
- [Test]
- public void ListViewItemForeColor ()
- {
- ListViewItem item = new ListViewItem ();
- ListView lv = new ListView ();
- lv.Items.Add (item);
- lv.ForeColor = Color.Orange;
- Assert.AreEqual (lv.ForeColor, item.ForeColor, "ForeColor#1");
- Assert.AreEqual (lv.ForeColor, item.SubItems [0].ForeColor, "ForeColor#2");
- item.ForeColor = Color.Navy;
- Assert.AreEqual (Color.Navy, item.ForeColor, "ForeColor#3");
- Assert.AreEqual (Color.Navy, item.SubItems [0].ForeColor, "ForeColor#4");
- item.SubItems [0].ForeColor = Color.Green;
- Assert.AreEqual (Color.Green, item.ForeColor, "ForeColor#5");
- Assert.AreEqual (Color.Green, item.SubItems [0].ForeColor, "ForeColor#6");
- }
- [Test]
- public void ListViewItemFocused ()
- {
- ListView lv = new ListView ();
- ListViewItem item1 = lv.Items.Add ("A");
- ListViewItem item2 = lv.Items.Add ("B");
- ListViewItem item3 = lv.Items.Add ("C");
- // Need to show form
- Form form = new Form ();
- lv.Parent = form;
- form.Show ();
- item1.Focused = true;
- Assert.IsTrue (item1.Focused, "#A1");
- Assert.IsFalse (item2.Focused, "#A2");
- Assert.IsFalse (item3.Focused, "#A3");
- Assert.AreEqual (item1, lv.FocusedItem, "#A4");
- item2.Focused = true;
- Assert.IsFalse (item1.Focused, "#B1");
- Assert.IsTrue (item2.Focused, "#B2");
- Assert.IsFalse (item3.Focused, "#B3");
- Assert.AreEqual (item2, lv.FocusedItem, "#B4");
- item3.Focused = true;
- Assert.IsFalse (item1.Focused, "#C1");
- Assert.IsFalse (item2.Focused, "#C2");
- Assert.IsTrue (item3.Focused, "#C3");
- Assert.AreEqual (item3, lv.FocusedItem, "#C4");
- item3.Focused = false;
- Assert.IsFalse (item1.Focused, "#D1");
- Assert.IsFalse (item2.Focused, "#D2");
- Assert.IsFalse (item3.Focused, "#D3");
- Assert.IsNull (lv.FocusedItem, "#D4");
- // Test Focused for Items without owner
- ListViewItem item4 = new ListViewItem ();
- Assert.IsFalse (item4.Focused);
- item4.Focused = true;
- Assert.IsFalse (item4.Focused, "#E1");
- form.Dispose ();
- }
- #if NET_2_0
- [Test]
- [ExpectedException (typeof (ArgumentOutOfRangeException))]
- public void ListViewItemIndent ()
- {
- ListViewItem item = new ListViewItem ();
- item.IndentCount = -1;
- }
- [Test]
- public void ListViewItemPosition ()
- {
- ListViewItem itemA = new ListViewItem ();
- ListViewItem itemB = new ListViewItem ();
- Point initial_pos = new Point (-1, -1);
- Assert.AreEqual (itemA.Position, initial_pos, "#A1");
- Assert.AreEqual (itemB.Position, initial_pos, "#A2");
- ListView lvw = new ListView ();
- lvw.Items.AddRange (new ListViewItem [] { itemA, itemB });
- Assert.AreEqual (itemA.Position, initial_pos, "#B1");
- Assert.AreEqual (itemB.Position, initial_pos, "#B2");
- // Create handle for lvw
- lvw.CreateControl ();
- Point itemA_pos = itemA.Position;
- Point itemB_pos = itemB.Position;
- Assert.IsTrue (itemA_pos != initial_pos, "#C1");
- Assert.IsTrue (itemB_pos != initial_pos, "#C2");
- // Now remove
- lvw.Items.Clear ();
- Assert.AreEqual (itemA_pos, itemA.Position, "#D1");
- Assert.AreEqual (itemB_pos, itemB.Position, "#D2");
- // Add in reverse order
- lvw.Items.AddRange (new ListViewItem [] { itemB, itemA });
- Assert.IsTrue (itemA_pos != itemA.Position, "#E1");
- Assert.IsTrue (itemB_pos != itemB.Position, "#E2");
- // Remove from ListView
- lvw.Items.Clear ();
- Assert.IsTrue (initial_pos != itemA.Position, "#F1");
- Assert.IsTrue (initial_pos != itemB.Position, "#F2");
- //
- // Now add them in other view (no effect)
- //
- lvw.Items.AddRange (new ListViewItem [] { itemA, itemB });
- lvw.Columns.Add ("Column A");
- lvw.View = View.Details;
- itemB_pos = itemB.Position;
- Assert.IsTrue (Point.Empty != itemB_pos, "#G1");
- Assert.IsTrue (initial_pos != itemB_pos, "#G2");
- itemB.Position = Point.Empty;
- Assert.AreEqual (itemB_pos, itemB.Position, "#H1");
- }
- #endif
- [Test] // bug #330415 and #331643
- public void RemoveFocusedItem ()
- {
- ListView lv = new ListView ();
- ListViewItem itemA = lv.Items.Add ("ItemA");
- ListViewItem itemB = lv.Items.Add ("ItemB");
- ListViewItem itemC = lv.Items.Add ("ItemC");
- ListViewItem itemD = lv.Items.Add ("ItemD");
- Form form = new Form ();
- form.ShowInTaskbar = false;
- form.Controls.Add (lv);
- form.Show ();
- // Calling Form.Show () doesn't fire
- // GotFocus event on child controls (asynch messages),
- // thus we can't get the first item focused,
- // but we DO when calling Application.Run ()
- //Assert.IsTrue (itemA.Focused, "#A1");
- Assert.IsFalse (itemB.Focused, "#A2");
- Assert.IsFalse (itemC.Focused, "#A3");
- Assert.IsFalse (itemD.Focused, "#A4");
- itemB.Focused = true;
- Assert.IsFalse (itemA.Focused, "#B1");
- Assert.IsTrue (itemB.Focused, "#B2");
- Assert.IsFalse (itemC.Focused, "#B3");
- Assert.IsFalse (itemD.Focused, "#B4");
- lv.Items.Remove (itemB);
- Assert.IsFalse (itemA.Focused, "#C1");
- Assert.IsFalse (itemB.Focused, "#C2");
- Assert.IsTrue (itemC.Focused, "#C3");
- Assert.IsFalse (itemD.Focused, "#C4");
- itemD.Focused = true;
- Assert.IsFalse (itemA.Focused, "#D1");
- Assert.IsFalse (itemB.Focused, "#D2");
- Assert.IsFalse (itemC.Focused, "#D3");
- Assert.IsTrue (itemD.Focused, "#D4");
- lv.Items.Remove (itemD);
- Assert.IsFalse (itemA.Focused, "#E1");
- Assert.IsFalse (itemB.Focused, "#E2");
- Assert.IsTrue (itemC.Focused, "#E3");
- Assert.IsFalse (itemD.Focused, "#E4");
- lv.Items.Remove (itemC);
- Assert.IsTrue (itemA.Focused, "#F1");
- Assert.IsFalse (itemB.Focused, "#F2");
- Assert.IsFalse (itemC.Focused, "#F3");
- Assert.IsFalse (itemD.Focused, "#F4");
- lv.Items.Remove (itemA);
- Assert.IsFalse (itemA.Focused, "#G1");
- Assert.IsFalse (itemB.Focused, "#G2");
- Assert.IsFalse (itemC.Focused, "#G3");
- Assert.IsFalse (itemD.Focused, "#G4");
- ListViewItem itemE = lv.Items.Add ("ItemE");
- Assert.IsFalse (itemA.Focused, "#H1");
- Assert.IsFalse (itemB.Focused, "#H2");
- Assert.IsFalse (itemC.Focused, "#H3");
- Assert.IsFalse (itemD.Focused, "#H4");
- Assert.IsFalse (itemE.Focused, "#H5");
- form.Dispose ();
- }
-
- #if NET_2_0
- [Test]
- public void ListViewItemGroup ()
- {
- ListViewGroup lvg1 = new ListViewGroup ();
- ListViewGroup lvg2 = new ListViewGroup ();
- ListViewItem lvi = new ListViewItem ();
-
- lvg1.Items.Add (lvi);
-
- Assert.AreEqual (1, lvg1.Items.Count, "#A1");
- Assert.AreEqual (lvg1, lvi.Group, "#A2");
- lvi.Group = lvg2;
-
- Assert.AreEqual (0, lvg1.Items.Count, "#B1");
- Assert.AreEqual (1, lvg2.Items.Count, "#B2");
- Assert.AreEqual (lvg2, lvi.Group, "#B3");
- }
- #endif
- [Test]
- public void ListViewItemUseItemStyleForSubItems ()
- {
- ListViewItem item = new ListViewItem ();
- Assert.AreEqual (1, item.SubItems.Count);
- // UseitemStyleForSubItems works at draw level
- item.UseItemStyleForSubItems = true;
- ListViewItem.ListViewSubItem subitem0 = item.SubItems [0];
- Color subitem0_back_color = subitem0.BackColor = Color.Black;
- Color subitem0_fore_color = subitem0.ForeColor = Color.White;
- Assert.AreEqual (subitem0_back_color, item.SubItems [0].BackColor, "UseItemStyleForSubItems#1");
- Assert.AreEqual (subitem0_fore_color, item.SubItems [0].ForeColor, "UseItemStyleForSubItems#2");
- Assert.AreEqual (item.BackColor, item.SubItems [0].BackColor, "UseItemStyleForSubItems#3");
- Assert.AreEqual (item.ForeColor, item.SubItems [0].ForeColor, "UseItemStyleForSubItems#4");
- ListViewItem.ListViewSubItem subitem1 = item.SubItems.Add ("SubItem");
- Color subitem1_back_color = subitem1.BackColor = Color.Blue;
- Color subitem1_fore_color = subitem1.ForeColor = Color.Gray;
- Assert.AreEqual (subitem1_back_color, subitem1.BackColor, "UseItemStyleForSubItem#5");
- Assert.AreEqual (subitem1_fore_color, subitem1.ForeColor, "UseItemStyleForSubItem#6");
- }
- [Test]
- public void ListViewItemTestClone ()
- {
- Form f = new Form ();
- ListView lv = new ListView ();
- lv.Parent = f;
- ListViewItem item1 = lv.Items.Add ("Hello");
- item1.ForeColor = Color.Blue;
- item1.BackColor = Color.Red;
- item1.Font = new Font ("Arial", 14);
- item1.SubItems.Add ("Element2");
- #if NET_2_0
- item1.ToolTipText = item1.Text;
- #endif
- f.Show ();
- ListViewItem item2 = (ListViewItem) item1.Clone ();
- Assert.AreEqual (Color.Blue, item2.ForeColor, "#1");
- Assert.AreEqual (Color.Red, item2.BackColor, "#2");
- Assert.AreEqual ("Hello", item2.Text, "#3");
- Assert.AreEqual (item1.Font, item2.Font, "#4");
- Assert.AreEqual (2, item2.SubItems.Count, "#5");
- Assert.AreEqual ("Hello", item2.SubItems [0].Text, "#6");
- Assert.AreEqual ("Element2", item2.SubItems[1].Text, "#7");
- #if NET_2_0
- Assert.AreEqual (item1.ToolTipText, item2.ToolTipText, "#8");
- #endif
- // Focused is not copied
- // These tests shoule be re-enabled when #333693
- /*Assert.IsTrue (item1.Focused, "#9");
- Assert.IsFalse (item2.Focused, "#10");*/
- f.Dispose ();
- }
- #if NET_2_0
- [Test]
- public void ListViewItemTestImageIndex()
- {
- ListViewItem item1 = new ListViewItem();
- item1.ImageKey = "Key1";
- item1.ImageIndex = 0;
- Assert.AreEqual(String.Empty, item1.ImageKey, "ImageIndex#1");
- item1.ImageIndex = 0;
- item1.ImageKey = "Key1";
- Assert.AreEqual (-1, item1.ImageIndex, "ImageIndex#2");
- item1.ImageKey = "Key1";
- item1.ImageIndex = -1;
- Assert.AreEqual (String.Empty, item1.ImageKey, "ImageIndex#3");
- item1.ImageIndex = 0;
- item1.ImageKey = String.Empty;
- Assert.AreEqual (-1, item1.ImageIndex, "ImageIndex#4");
- }
- [Test]
- public void ListViewItemToolTipText ()
- {
- ListViewItem item1 = new ListViewItem();
- item1.ToolTipText = null;
- Assert.AreEqual (String.Empty, item1.ToolTipText, "ToolTipText#1");
- }
- #endif
- }
- [TestFixture]
- public class ListViewSubItemTest : TestHelper
- {
- [Test] // ctor ()
- public void Constructor1 ()
- {
- ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
- Assert.AreEqual (string.Empty, subItem.Text, "#1");
- Assert.AreEqual (SystemColors.Window, subItem.BackColor, "#2");
- Assert.AreEqual (SystemColors.WindowText, subItem.ForeColor, "#3");
- Assert.AreEqual (SystemFonts.DefaultFont, subItem.Font, "#4");
- }
- [Test] // ctor (ListViewItem, String)
- public void Constructor2 ()
- {
- ListViewItem.ListViewSubItem subItem;
- ListViewItem item = new ListViewItem ();
-
- subItem = new ListViewItem.ListViewSubItem (null, null);
- Assert.IsNotNull (subItem.Font, "#A1");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#A2");
- Assert.IsNull (subItem.Tag, "#A3");
- #endif
- Assert.AreEqual (String.Empty, subItem.Text, "#A4");
- subItem = new ListViewItem.ListViewSubItem (item, "SubItem2");
- Assert.IsNotNull (subItem.Font, "#B1");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#B2");
- Assert.IsNull (subItem.Tag, "#B3");
- #endif
- Assert.AreEqual ("SubItem2", subItem.Text, "#B4");
- }
- [Test] // ctor (ListViewItem, String, Color, Color, Font)
- public void Constructor3 ()
- {
- ListViewItem.ListViewSubItem subItem;
- Font font = new Font ("Arial", 12);
- ListViewItem item = new ListViewItem ();
- subItem = new ListViewItem.ListViewSubItem (null, null,
- Color.Blue, Color.Red, null);
- Assert.AreEqual (Color.Red, subItem.BackColor, "#A1");
- Assert.IsNotNull (subItem.Font, "#A2");
- Assert.AreEqual (Color.Blue, subItem.ForeColor, "#A3");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#A4");
- Assert.IsNull (subItem.Tag, "#A5");
- #endif
- Assert.AreEqual (string.Empty, subItem.Text, "#A6");
- subItem = new ListViewItem.ListViewSubItem (item, "SubItem3",
- Color.Blue, Color.Green, font);
- Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
- Assert.AreSame (font, subItem.Font, "#B2");
- Assert.AreEqual (Color.Blue, subItem.ForeColor, "#B3");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#B4");
- Assert.IsNull (subItem.Tag, "#B5");
- #endif
- Assert.AreEqual ("SubItem3", subItem.Text, "#B6");
- }
- #if NET_2_0
- [Test]
- public void Name ()
- {
- ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
- subItem.Name = "foo";
- Assert.AreEqual ("foo", subItem.Name, "#1");
- subItem.Name = null;
- Assert.AreEqual (string.Empty, subItem.Name, "#2");
- subItem.Name = "bar";
- Assert.AreEqual ("bar", subItem.Name, "#3");
- subItem.Name = string.Empty;
- Assert.AreEqual (string.Empty, subItem.Name, "#4");
- subItem.Name = " \t ";
- Assert.AreEqual (" \t ", subItem.Name, "#5");
- }
- [Test]
- public void Tag ()
- {
- ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
- subItem.Tag = "foo";
- Assert.AreEqual ("foo", subItem.Tag, "#1");
- subItem.Tag = null;
- Assert.IsNull (subItem.Tag, "#2");
- subItem.Tag = 5;
- Assert.AreEqual (5, subItem.Tag, "#3");
- }
- #endif
- [Test]
- public void Text ()
- {
- ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
- subItem.Text = "foo";
- Assert.AreEqual ("foo", subItem.Text, "#1");
- subItem.Text = null;
- Assert.AreEqual (string.Empty, subItem.Text, "#2");
- subItem.Text = "bar";
- Assert.AreEqual ("bar", subItem.Text, "#3");
- subItem.Text = string.Empty;
- Assert.AreEqual (string.Empty, subItem.Text, "#4");
- subItem.Text = " \t ";
- Assert.AreEqual (" \t ", subItem.Text, "#5");
- }
- [Test]
- public void Serialize ()
- {
- ListViewItem.ListViewSubItem subItem;
- Font font = new Font ("Arial", 12);
- ListViewItem item = new ListViewItem ();
- subItem = new ListViewItem.ListViewSubItem (item,
- "SubItemText", Color.Yellow, Color.Green,
- font);
- #if NET_2_0
- subItem.Name = "foo";
- subItem.Tag = "bar";
- #endif
- MemoryStream ms = new MemoryStream ();
- BinaryFormatter formatter = new BinaryFormatter ();
- formatter.Serialize (ms, subItem);
- ms.Position = 0;
- subItem = (ListViewItem.ListViewSubItem)
- formatter.Deserialize (ms);
- Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
- Assert.AreEqual (font, subItem.Font, "#A2");
- Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#A4");
- Assert.IsNull (subItem.Tag, "#A5");
- #endif
- Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
- ms.Position = 0;
- byte [] ser = new byte [ms.Length];
- ms.Read (ser, 0, ser.Length);
- }
- [Test]
- [Category ("NotDotNet")]
- [Category ("NotWorking")] // fails on buildbot
- public void SerializeExact_Mono ()
- {
- ListViewItem.ListViewSubItem subItem;
- Font font = new Font ("Arial", 12);
- ListViewItem item = new ListViewItem ();
- subItem = new ListViewItem.ListViewSubItem (item,
- "SubItemText", Color.Yellow, Color.Green,
- font);
- #if NET_2_0
- subItem.Name = "foo";
- subItem.Tag = "bar";
- #endif
- MemoryStream ms = new MemoryStream ();
- BinaryFormatter formatter = new BinaryFormatter ();
- formatter.AssemblyFormat = FormatterAssemblyStyle.Full;
- formatter.Serialize (ms, subItem);
- ms.Position = 0;
- byte [] ser = new byte [ms.Length];
- ms.Read (ser, 0, ser.Length);
- #if NET_2_0
- Assert.AreEqual (_serializedV20_Mono, ser);
- #else
- Assert.AreEqual (_serializedV11_Mono, ser);
- #endif
- }
- [Test]
- [Category ("NotWorking")]
- public void SerializeExact_MS ()
- {
- ListViewItem.ListViewSubItem subItem;
- Font font = new Font ("Arial", 12);
- ListViewItem item = new ListViewItem ();
- subItem = new ListViewItem.ListViewSubItem (item,
- "SubItemText", Color.Yellow, Color.Green,
- font);
- #if NET_2_0
- subItem.Name = "foo";
- subItem.Tag = "bar";
- #endif
- MemoryStream ms = new MemoryStream ();
- BinaryFormatter formatter = new BinaryFormatter ();
- formatter.Serialize (ms, subItem);
- ms.Position = 0;
- byte [] ser = new byte [ms.Length];
- ms.Read (ser, 0, ser.Length);
- #if NET_2_0
- Assert.AreEqual (_serializedV20_MS, ser);
- #else
- Assert.AreEqual (_serializedV11_MS, ser);
- #endif
- }
- [Test]
- public void Deserialize ()
- {
- ListViewItem.ListViewSubItem subItem;
- MemoryStream ms;
- BinaryFormatter formatter = new BinaryFormatter ();
- ms = new MemoryStream ();
- ms.Write (_serializedV11_Mono, 0, _serializedV11_Mono.Length);
- ms.Position = 0;
- subItem = (ListViewItem.ListViewSubItem)
- formatter.Deserialize (ms);
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
- Assert.AreEqual ("Green", subItem.BackColor.Name, "#A1");
- Assert.IsNotNull (subItem.Font, "#A2");
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
- Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#A3");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#A4");
- Assert.IsNull (subItem.Tag, "#A5");
- #endif
- Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
- ms = new MemoryStream ();
- ms.Write (_serializedV11_MS, 0, _serializedV11_MS.Length);
- ms.Position = 0;
- subItem = (ListViewItem.ListViewSubItem)
- formatter.Deserialize (ms);
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
- Assert.AreEqual ("Green", subItem.BackColor.Name, "#B1");
- Assert.IsNotNull (subItem.Font, "#B2");
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#B3");
- Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#B3");
- #if NET_2_0
- Assert.AreEqual (string.Empty, subItem.Name, "#B4");
- Assert.IsNull (subItem.Tag, "#B5");
- #endif
- Assert.AreEqual ("SubItemText", subItem.Text, "#B6");
- #if NET_2_0
- ms = new MemoryStream ();
- ms.Write (_serializedV20_Mono, 0, _serializedV20_Mono.Length);
- ms.Position = 0;
- subItem = (ListViewItem.ListViewSubItem)
- formatter.Deserialize (ms);
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Green, subItem.BackColor, "#C1");
- Assert.AreEqual ("Green", subItem.BackColor.Name, "#C1");
- Assert.IsNotNull (subItem.Font, "#C2");
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#C3");
- Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#C3");
- Assert.AreEqual (string.Empty, subItem.Name, "#C4");
- Assert.IsNull (subItem.Tag, "#C5");
- Assert.AreEqual ("SubItemText", subItem.Text, "#C6");
- ms = new MemoryStream ();
- ms.Write (_serializedV20_MS, 0, _serializedV20_MS.Length);
- ms.Position = 0;
- subItem = (ListViewItem.ListViewSubItem)
- formatter.Deserialize (ms);
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Green, subItem.BackColor, "#D1");
- Assert.AreEqual ("Green", subItem.BackColor.Name, "#D1");
- Assert.IsNotNull (subItem.Font, "#D2");
- // FIXME: bug #410693
- //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#D3");
- Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#D3");
- Assert.AreEqual (string.Empty, subItem.Name, "#D4");
- Assert.IsNull (subItem.Tag, "#D5");
- Assert.AreEqual ("SubItemText", subItem.Text, "#D6");
- #endif
- }
- static byte [] _serializedV11_MS = {
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
- 0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
- 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
- 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
- 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
- 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
- 0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
- 0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
- 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
- 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
- 0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
- 0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
- 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
- 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
- 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
- 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
- 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
- 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
- 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
- 0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
- 0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
- 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
- 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
- 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
- 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
- 0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
- 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
- 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
- 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
- 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
- 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
- 0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
- 0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
- 0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
- 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
- 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
- 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xfa, 0xff, 0xff,
- 0xff, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
- 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
- 0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00,
- 0x0a, 0x01, 0xf9, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00,
- 0x0a, 0x09, 0x08, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00,
- 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
- 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00,
- 0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a,
- 0x65, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69,
- 0x74, 0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
- 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00,
- 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
- 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70,
- 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00,
- 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00, 0x05,
- 0x41, 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0xf6,
- 0xff, 0xff, 0xff, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
- 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e,
- 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf5, 0xff, 0xff, 0xff,
- 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
- 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69,
- 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
- static byte [] _serializedV20_MS = {
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
- 0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
- 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
- 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
- 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
- 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
- 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
- 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
- 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
- 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x08, 0x75,
- 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x01, 0x01, 0x04, 0x02,
- 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
- 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
- 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
- 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
- 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
- 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
- 0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x09, 0x05,
- 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x03, 0x62, 0x61,
- 0x72, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
- 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
- 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
- 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
- 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
- 0x05, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
- 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
- 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
- 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
- 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
- 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
- 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
- 0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
- 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
- 0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
- 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
- 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0x14, 0x53, 0x79, 0x73,
- 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
- 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
- 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x01, 0x00, 0x00, 0x00, 0x09, 0x07,
- 0x07, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00, 0x01, 0xf7, 0xff, 0xff,
- 0xff, 0xf8, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00, 0x09, 0x0a, 0x00, 0x00,
- 0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
- 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61,
- 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79,
- 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04,
- 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53,
- 0x74, 0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
- 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55,
- 0x6e, 0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c,
- 0x00, 0x00, 0x40, 0x41, 0x05, 0xf4, 0xff, 0xff, 0xff, 0x18, 0x53,
- 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
- 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c,
- 0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x05, 0xf3, 0xff, 0xff, 0xff, 0x1b, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
- 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69,
- 0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
- 0x00, 0x0b };
- static byte [] _serializedV11_Mono = {
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
- 0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
- 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
- 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
- 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
- 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
- 0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
- 0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
- 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
- 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
- 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
- 0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
- 0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
- 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
- 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
- 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
- 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
- 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
- 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
- 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
- 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
- 0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
- 0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
- 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
- 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
- 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
- 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
- 0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
- 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
- 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
- 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
- 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
- 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
- 0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
- 0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
- 0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
- 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
- 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
- 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
- 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00,
- 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x05,
- 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
- 0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x4f, 0x00,
- 0x06, 0x07, 0x00, 0x00, 0x00, 0x05, 0x47, 0x72, 0x65, 0x65, 0x6e,
- 0x01, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xff,
- 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xa6, 0x00, 0x06,
- 0x09, 0x00, 0x00, 0x00, 0x06, 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77,
- 0x09, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13,
- 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
- 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00,
- 0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65,
- 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74,
- 0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
- 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00, 0x00,
- 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
- 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41,
- 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0x0c, 0x00,
- 0x00, 0x00, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
- 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74,
- 0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0d, 0x00, 0x00, 0x00, 0x1b,
- 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
- 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63,
- 0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
- 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
- static byte [] _serializedV20_Mono = {
- 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
- 0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
- 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
- 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
- 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
- 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
- 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
- 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
- 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
- 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
- 0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x08, 0x75, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74,
- 0x61, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x01, 0x02, 0x04,
- 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
- 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
- 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
- 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
- 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
- 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
- 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
- 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
- 0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x06, 0x05,
- 0x00, 0x00, 0x00, 0x03, 0x62, 0x61, 0x72, 0x09, 0x06, 0x00, 0x00,
- 0x00, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
- 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
- 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
- 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
- 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
- 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
- 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
- 0x05, 0x06, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
- 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
- 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
- 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
- 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
- 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
- 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
- 0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
- 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
- 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
- 0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
- 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
- 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73,
- 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
- 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x05,
- 0x76, 0x61, 0x6c, 0x75, 0x65, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
- 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x00, 0x01, 0x09, 0x07,
- 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xff, 0x00, 0x00,
- 0x00, 0x00, 0x07, 0x00, 0x4f, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00,
- 0x05, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x01, 0x0a, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
- 0x00, 0x07, 0x00, 0xa6, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x06,
- 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x09, 0x0c, 0x00, 0x00, 0x00,
- 0x05, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
- 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d,
- 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79, 0x6c,
- 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04, 0x0b,
- 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
- 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74,
- 0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73,
- 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
- 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e,
- 0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06,
- 0x0d, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x00,
- 0x00, 0x40, 0x41, 0x05, 0x0e, 0x00, 0x00, 0x00, 0x18, 0x53, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
- 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65,
- 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
- 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x05, 0x0f, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47,
- 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74,
- 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
- 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x0b };
- }
- [TestFixture]
- public class ListViewSubItemCollectionTest : TestHelper
- {
- [Test]
- public void Ctor ()
- {
- ListViewItem item = new ListViewItem ();
- item.Text = "MAIN";
- ListViewItem.ListViewSubItemCollection sub_items;
- sub_items = new ListViewItem.ListViewSubItemCollection (item);
- Assert.AreEqual (1, sub_items.Count, "#A1");
- Assert.AreEqual ("MAIN", sub_items [0].Text, "#A2");
- sub_items.Add ("A");
- Assert.AreEqual (2, sub_items.Count, "#B1");
- Assert.AreEqual ("A", sub_items [1].Text, "#B2");
- }
- [Test]
- public void AddRange1 ()
- {
- ListViewItem item = new ListViewItem ();
- ListViewItem.ListViewSubItem subItemA = item.SubItems.Add ("A");
- Assert.AreEqual (2, item.SubItems.Count, "#A1");
- Assert.IsNotNull (item.SubItems [0], "#A2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
- ListViewItem.ListViewSubItem subItemB = new ListViewItem.ListViewSubItem ();
- subItemB.Text = "B";
- ListViewItem.ListViewSubItem subItemC = new ListViewItem.ListViewSubItem ();
- subItemB.Text = "C";
- item.SubItems.AddRange (new ListViewItem.ListViewSubItem [] {
- subItemB, null, subItemC });
- Assert.AreEqual (4, item.SubItems.Count, "#B1");
- Assert.IsNotNull (item.SubItems [0], "#B2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
- Assert.IsNotNull (item.SubItems [1], "#B3");
- Assert.AreSame (subItemA, item.SubItems [1], "#B4");
- Assert.IsNotNull (item.SubItems [2], "#B5");
- Assert.AreSame (subItemB, item.SubItems [2], "#B6");
- Assert.IsNotNull (item.SubItems [3], "#B7");
- Assert.AreSame (subItemC, item.SubItems [3], "#B8");
- }
- [Test]
- public void AddRange1_Null ()
- {
- ListViewItem item = new ListViewItem ();
- try {
- item.SubItems.AddRange ((ListViewItem.ListViewSubItem []) null);
- Assert.Fail ("#1");
- } catch (ArgumentNullException ex) {
- Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
- Assert.IsNotNull (ex.Message, "#3");
- Assert.IsNotNull (ex.ParamName, "#4");
- Assert.AreEqual ("items", ex.ParamName, "#5");
- Assert.IsNull (ex.InnerException, "#6");
- }
- }
- [Test]
- public void AddRange2 ()
- {
- string subItemAText = "A";
- string subItemBText = "B";
- string subItemCText = "B";
- ListViewItem item = new ListViewItem ();
- item.SubItems.Add (subItemAText);
- Assert.AreEqual (2, item.SubItems.Count, "#A1");
- Assert.IsNotNull (item.SubItems [0], "#A2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
- Assert.IsNotNull (item.SubItems [1], "#A4");
- Assert.AreEqual (subItemAText, item.SubItems [1].Text, "#A5");
- item.SubItems.AddRange (new string [] { subItemBText, null, subItemCText });
- Assert.AreEqual (4, item.SubItems.Count, "#B1");
- Assert.IsNotNull (item.SubItems [0], "#B2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
- Assert.IsNotNull (item.SubItems [1], "#B4");
- Assert.AreSame (subItemAText, item.SubItems [1].Text, "#B5");
- Assert.IsNotNull (item.SubItems [2], "#B6");
- Assert.AreSame (subItemBText, item.SubItems [2].Text, "#B7");
- Assert.IsNotNull (item.SubItems [3], "#B8");
- Assert.AreSame (subItemCText, item.SubItems [3].Text, "#B9");
- }
- [Test]
- public void AddRange2_Null ()
- {
- ListViewItem item = new ListViewItem ();
- try {
- item.SubItems.AddRange ((string []) null);
- Assert.Fail ("#1");
- } catch (ArgumentNullException ex) {
- Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
- Assert.IsNotNull (ex.Message, "#3");
- Assert.IsNotNull (ex.ParamName, "#4");
- Assert.AreEqual ("items", ex.ParamName, "#5");
- Assert.IsNull (ex.InnerException, "#6");
- }
- }
- [Test]
- public void AddRange3 ()
- {
- string subItemAText = "A";
- string subItemBText = "B";
- string subItemCText = "B";
- Font font = new Font ("Arial", 14);
- ListViewItem item = new ListViewItem ();
- item.SubItems.Add (subItemAText);
- Assert.AreEqual (2, item.SubItems.Count, "#A1");
- Assert.IsNotNull (item.SubItems [0], "#A2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
- Assert.IsNotNull (item.SubItems [1], "#A4");
- Assert.AreEqual (subItemAText, item.SubItems [1].Text, "#A5");
- item.SubItems.AddRange (new string [] { subItemBText, null, subItemCText },
- Color.Blue, Color.Red, font);
- Assert.AreEqual (4, item.SubItems.Count, "#B1");
- Assert.IsNotNull (item.SubItems [0], "#B2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
- Assert.IsNotNull (item.SubItems [1], "#C1");
- Assert.AreSame (subItemAText, item.SubItems [1].Text, "#C2");
- Assert.IsNotNull (item.SubItems [2], "#D1");
- Assert.AreSame (subItemBText, item.SubItems [2].Text, "#D2");
- Assert.AreEqual (Color.Blue, item.SubItems [2].ForeColor, "#D3");
- Assert.AreEqual (Color.Red, item.SubItems [2].BackColor, "#D4");
- Assert.AreSame (font, item.SubItems [2].Font, "#D5");
- Assert.IsNotNull (item.SubItems [3], "#E1");
- Assert.AreSame (subItemCText, item.SubItems [3].Text, "#E2");
- Assert.AreEqual (Color.Blue, item.SubItems [3].ForeColor, "#E3");
- Assert.AreEqual (Color.Red, item.SubItems [3].BackColor, "#E4");
- Assert.AreSame (font, item.SubItems [3].Font, "#E6");
- }
- [Test]
- public void AddRange3_Items_Null ()
- {
- ListViewItem item = new ListViewItem ();
- try {
- item.SubItems.AddRange ((string []) null, Color.Blue, Color.Red,
- new Font ("Arial", 14));
- Assert.Fail ("#1");
- } catch (ArgumentNullException ex) {
- Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
- Assert.IsNotNull (ex.Message, "#3");
- Assert.IsNotNull (ex.ParamName, "#4");
- Assert.AreEqual ("items", ex.ParamName, "#5");
- Assert.IsNull (ex.InnerException, "#6");
- }
- }
- [Test]
- public void AddRange4 ()
- {
- ListViewItem item = new ListViewItem ();
- Assert.AreEqual (1, item.SubItems.Count, "#1");
- item.SubItems.AddRange (new string [3]);
- Assert.AreEqual (1, item.SubItems.Count, "#2");
- item.SubItems.AddRange (new ListViewItem.ListViewSubItem [3]);
- Assert.AreEqual (1, item.SubItems.Count, "#3");
- }
- [Test]
- public void Clear ()
- {
- ListViewItem item = new ListViewItem ();
- item.SubItems.AddRange (new string [] { "A", "B", "C" });
- item.SubItems.Clear ();
- Assert.AreEqual (1, item.SubItems.Count, "#1");
- Assert.IsNotNull (item.SubItems [0].Text, "#2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
- }
- [Test]
- public void RemoveAt ()
- {
- ListViewItem item = new ListViewItem ();
- item.SubItems.AddRange (new string [] { "A", "B" });
- Assert.AreEqual (3, item.SubItems.Count, "#A1");
- Assert.IsNotNull (item.SubItems [0].Text, "#A2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
- Assert.IsNotNull (item.SubItems [1].Text, "#A4");
- Assert.AreEqual ("A", item.SubItems [1].Text, "#A5");
- Assert.IsNotNull (item.SubItems [2].Text, "#A6");
- Assert.AreEqual ("B", item.SubItems [2].Text, "#A7");
- item.SubItems.RemoveAt (1);
- Assert.AreEqual (2, item.SubItems.Count, "#B1");
- Assert.IsNotNull (item.SubItems [0].Text, "#B2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
- Assert.IsNotNull (item.SubItems [1].Text, "#B4");
- Assert.AreEqual ("B", item.SubItems [1].Text, "#B5");
- item.SubItems.RemoveAt (0);
- Assert.AreEqual (1, item.SubItems.Count, "#C1");
- Assert.IsNotNull (item.SubItems [0].Text, "#C2");
- Assert.AreEqual ("B", item.SubItems [0].Text, "#C3");
- item.SubItems.RemoveAt (0);
- Assert.AreEqual (1, item.SubItems.Count, "#D1");
- Assert.IsNotNull (item.SubItems [0].Text, "#D2");
- Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#D3");
- }
- }
- }
|