ListViewItemTest.cs 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
  21. //
  22. // Author:
  23. // Jordi Mas i Hernandez <[email protected]>
  24. //
  25. //
  26. using System;
  27. using System.Windows.Forms;
  28. using System.Drawing;
  29. using System.IO;
  30. using System.Reflection;
  31. using System.Runtime.Serialization;
  32. using System.Runtime.Serialization.Formatters;
  33. using System.Runtime.Serialization.Formatters.Binary;
  34. using NUnit.Framework;
  35. namespace MonoTests.System.Windows.Forms
  36. {
  37. [TestFixture]
  38. public class ListViewItemTest : TestHelper
  39. {
  40. [Test]
  41. public void ListViewItemConstructors ()
  42. {
  43. Font fnt = new Font ("Arial", 12);
  44. ListViewItem item1 = new ListViewItem ("Hello folks");
  45. Assert.AreEqual ("Hello folks", item1.Text, "Constructor#1");
  46. ListViewItem item2 = new ListViewItem (new string [] {"Element1", "Element2"},
  47. -1, Color.Blue, Color.Red, fnt);
  48. Assert.AreEqual (item2.ForeColor, Color.Blue, "Constructor#2");
  49. Assert.AreEqual (item2.BackColor, Color.Red, "Constructor#3");
  50. Assert.AreEqual (2, item2.SubItems.Count,"Constructor#4");
  51. Assert.AreEqual (Color.Blue, item2.SubItems[0].ForeColor,"Constructor#5");
  52. Assert.AreEqual (Color.Red, item2.SubItems[0].BackColor, "Constructor#6");
  53. Assert.AreEqual (fnt, item2.SubItems[0].Font, "Constructor#7");
  54. Assert.AreEqual ("Element1", item2.SubItems[0].Text, "Constructor#8");
  55. Assert.AreEqual ("Element2", item2.SubItems[1].Text, "Constructor#12");
  56. ListViewItem item3 = new ListViewItem ((string)null);
  57. Assert.AreEqual (String.Empty, item3.Text, "Constructor#13");
  58. ListViewItem item4 = new ListViewItem ((string)null, -99);
  59. Assert.AreEqual (String.Empty, item4.Text, "Constructor#14");
  60. Assert.AreEqual (-99, item4.ImageIndex, "Constructor#15");
  61. ListViewItem item5 = new ListViewItem (new string [2]);
  62. Assert.AreEqual (2, item5.SubItems.Count, "Constructor#16");
  63. Assert.IsNotNull (item5.SubItems [0], "Constructor#17");
  64. Assert.IsNotNull (item5.SubItems [1], "Constructor#18");
  65. ListViewItem item6 = new ListViewItem (new string [2], -1, Color.Blue, Color.Red,
  66. fnt);
  67. Assert.AreEqual (2, item6.SubItems.Count, "Constructor#19");
  68. Assert.IsNotNull (item6.SubItems [0], "Constructor#20");
  69. Assert.IsNotNull (item6.SubItems [1], "Constructor#21");
  70. Assert.AreEqual (Color.Blue, item6.ForeColor, "Constructor#22");
  71. Assert.AreEqual (Color.Blue, item6.SubItems [0].ForeColor, "Constructor#23");
  72. Assert.AreEqual (Color.Red, item6.BackColor, "Constructor#24");
  73. Assert.AreEqual (Color.Red, item6.SubItems [0].BackColor, "Constructor#25");
  74. Assert.AreEqual (fnt, item6.Font, "Constructor#26");
  75. Assert.AreEqual (fnt, item6.SubItems [0].Font, "Constructor#27");
  76. }
  77. [Test]
  78. public void Constructor2_Text_Null ()
  79. {
  80. ListViewItem item = new ListViewItem ((string) null);
  81. Assert.AreEqual (-1, item.ImageIndex, "#1");
  82. Assert.AreEqual (1, item.SubItems.Count, "#2");
  83. Assert.IsNotNull (item.SubItems [0].Text, "#3");
  84. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
  85. }
  86. [Test]
  87. public void Constructor3_Items_Empty ()
  88. {
  89. ListViewItem item = new ListViewItem (new string [3]);
  90. Assert.AreEqual (-1, item.ImageIndex, "#1");
  91. Assert.AreEqual (3, item.SubItems.Count, "#2");
  92. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
  93. Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#4");
  94. Assert.AreEqual (string.Empty, item.SubItems [2].Text, "#5");
  95. }
  96. [Test]
  97. public void Constructor3_Items_Null ()
  98. {
  99. ListViewItem item = new ListViewItem ((string []) null);
  100. Assert.AreEqual (-1, item.ImageIndex, "#1");
  101. Assert.AreEqual (1, item.SubItems.Count, "#2");
  102. Assert.IsNotNull (item.SubItems [0].Text, "#3");
  103. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
  104. }
  105. [Test]
  106. [ExpectedException (typeof (NullReferenceException))]
  107. public void Constructor4_SubItems_Empty ()
  108. {
  109. new ListViewItem (new ListViewItem.ListViewSubItem [2], 3);
  110. }
  111. [Test]
  112. [ExpectedException (typeof (NullReferenceException))]
  113. public void Constructor4_SubItems_Null ()
  114. {
  115. new ListViewItem ((ListViewItem.ListViewSubItem []) null, 3);
  116. }
  117. [Test]
  118. public void Constructor5_Text_Null ()
  119. {
  120. ListViewItem item = new ListViewItem ((string) null, 2);
  121. Assert.AreEqual (2, item.ImageIndex, "#1");
  122. Assert.AreEqual (1, item.SubItems.Count, "#2");
  123. Assert.IsNotNull (item.SubItems [0].Text, "#3");
  124. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
  125. }
  126. [Test]
  127. public void Constructor6_Items_Empty ()
  128. {
  129. ListViewItem item = new ListViewItem (new string [3], 5);
  130. Assert.AreEqual (5, item.ImageIndex, "#1");
  131. Assert.AreEqual (3, item.SubItems.Count, "#2");
  132. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
  133. Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#4");
  134. Assert.AreEqual (string.Empty, item.SubItems [2].Text, "#5");
  135. }
  136. [Test]
  137. public void Constructor6_Items_Null ()
  138. {
  139. ListViewItem item = new ListViewItem ((string []) null, 3);
  140. Assert.AreEqual (3, item.ImageIndex, "#1");
  141. Assert.AreEqual (1, item.SubItems.Count, "#2");
  142. Assert.IsNotNull (item.SubItems [0].Text, "#3");
  143. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#4");
  144. }
  145. [Test]
  146. public void Constructor7_Items_Empty ()
  147. {
  148. Font font = new Font (FontFamily.GenericSansSerif, 6);
  149. ListViewItem item = new ListViewItem (new string [2], 3, Color.Red,
  150. Color.Blue, font);
  151. Assert.AreEqual (Color.Blue, item.BackColor, "#1");
  152. Assert.AreEqual (Color.Red, item.ForeColor, "#2");
  153. Assert.AreSame (font, item.Font, "#3");
  154. Assert.AreEqual (3, item.ImageIndex, "#4");
  155. Assert.AreEqual (2, item.SubItems.Count, "#5");
  156. Assert.IsNotNull (item.SubItems [0].Text, "#6");
  157. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#7");
  158. Assert.IsNotNull (item.SubItems [1].Text, "#8");
  159. Assert.AreEqual (string.Empty, item.SubItems [1].Text, "#9");
  160. }
  161. [Test]
  162. public void Constructor7_Items_Null ()
  163. {
  164. Font font = new Font (FontFamily.GenericSansSerif, 6);
  165. ListViewItem item = new ListViewItem ((string []) null, 3, Color.Red,
  166. Color.Blue, font);
  167. Assert.AreEqual (Color.Blue, item.BackColor, "#1");
  168. Assert.AreEqual (Color.Red, item.ForeColor, "#2");
  169. Assert.AreSame (font, item.Font, "#3");
  170. Assert.AreEqual (3, item.ImageIndex, "#4");
  171. Assert.AreEqual (1, item.SubItems.Count, "#5");
  172. Assert.IsNotNull (item.SubItems [0].Text, "#6");
  173. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#7");
  174. }
  175. #if NET_2_0
  176. [Test]
  177. public void Constructor9_Text_Null ()
  178. {
  179. ListViewItem item = new ListViewItem ((string) null, "key");
  180. Assert.AreEqual (-1, item.ImageIndex, "#1");
  181. Assert.IsNotNull (item.ImageKey, "#2");
  182. Assert.AreEqual ("key", item.ImageKey, "#3");
  183. Assert.AreEqual (1, item.SubItems.Count, "#4");
  184. Assert.IsNotNull (item.SubItems [0].Text, "#5");
  185. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#6");
  186. }
  187. [Test]
  188. public void Constructor9_ImageKey_Null ()
  189. {
  190. ListViewItem item = new ListViewItem ("name", (string) null);
  191. Assert.AreEqual (-1, item.ImageIndex, "#1");
  192. Assert.IsNotNull (item.ImageKey, "#2");
  193. Assert.AreEqual (string.Empty, item.ImageKey, "#3");
  194. Assert.AreEqual (1, item.SubItems.Count, "#4");
  195. Assert.IsNotNull (item.SubItems [0].Text, "#5");
  196. Assert.AreEqual ("name", item.SubItems [0].Text, "#6");
  197. }
  198. [Test]
  199. [ExpectedException (typeof (NullReferenceException))]
  200. public void Constructor10_SubItems_Null ()
  201. {
  202. new ListViewItem ((ListViewItem.ListViewSubItem []) null, "key");
  203. }
  204. [Test]
  205. [ExpectedException (typeof (NullReferenceException))]
  206. public void Constructor10_SubItems_Empty ()
  207. {
  208. new ListViewItem (new ListViewItem.ListViewSubItem [2], "key");
  209. }
  210. [Test]
  211. public void Constructor10_ImageKey_Null ()
  212. {
  213. ListViewItem.ListViewSubItem subItemA = new ListViewItem.ListViewSubItem ();
  214. subItemA.Text = "A";
  215. ListViewItem.ListViewSubItem subItemB = new ListViewItem.ListViewSubItem ();
  216. subItemB.Text = "B";
  217. ListViewItem item = new ListViewItem (new ListViewItem.ListViewSubItem [] {
  218. subItemA, subItemB }, (string) null);
  219. Assert.AreEqual (-1, item.ImageIndex, "#1");
  220. Assert.IsNotNull (item.ImageKey, "#2");
  221. Assert.AreEqual (string.Empty, item.ImageKey, "#3");
  222. Assert.AreEqual (2, item.SubItems.Count, "#4");
  223. Assert.IsNotNull (item.SubItems [0].Text, "#5");
  224. Assert.AreEqual ("A", item.SubItems [0].Text, "#6");
  225. Assert.IsNotNull (item.SubItems [1].Text, "#7");
  226. Assert.AreEqual ("B", item.SubItems [1].Text, "#8");
  227. }
  228. [Test]
  229. public void Constructor_Groups ()
  230. {
  231. ListViewItem itemA = new ListViewItem ((ListViewGroup) null);
  232. Assert.AreEqual (null, itemA.Group, "#A1");
  233. ListViewGroup group = new ListViewGroup ("Group A");
  234. group.Items.Add (itemA);
  235. ListViewItem itemB = new ListViewItem ("B", group);
  236. Assert.AreEqual (group, itemB.Group, "#B1");
  237. Assert.AreEqual (2, group.Items.Count, "#B2");
  238. Assert.AreEqual (itemB, group.Items [1], "#B3");
  239. }
  240. [Test]
  241. public void Constructor_Serializable ()
  242. {
  243. ListViewItem item = new ListViewItem ("A");
  244. ListView lvw = new ListView ();
  245. lvw.Items.Add (item);
  246. lvw.CreateControl (); // Need to calculate layout
  247. item.SubItems.Add ("B");
  248. item.SubItems.Add ("C");
  249. item.SubItems.Add ("D");
  250. item.BackColor = Color.AliceBlue;
  251. item.Checked = true;
  252. item.Font = new Font (item.Font, FontStyle.Bold);
  253. item.ForeColor = Color.AntiqueWhite;
  254. item.ImageIndex = 1;
  255. item.Selected = true;
  256. item.Tag = "Tag";
  257. item.UseItemStyleForSubItems = false;
  258. ListViewGroup group = lvw.Groups.Add ("GroupKey", "MyGroup");
  259. group.Items.Add (item);
  260. item.ImageKey = "MyKey";
  261. item.IndentCount = 2;
  262. item.Name = "MyName";
  263. item.ToolTipText = "MyTooltipText";
  264. MemoryStream ms = new MemoryStream ();
  265. BinaryFormatter formatter = new BinaryFormatter ();
  266. formatter.Serialize (ms, item);
  267. ListViewItem item2 = null;
  268. ms.Position = 0;
  269. item2 = (ListViewItem) formatter.Deserialize (ms);
  270. Assert.AreEqual ("A", item2.Text, "#A1");
  271. Assert.AreEqual ("A", item2.SubItems [0].Text, "#A2");
  272. Assert.AreEqual ("B", item2.SubItems [1].Text, "#A3");
  273. Assert.AreEqual ("C", item2.SubItems [2].Text, "#A4");
  274. Assert.AreEqual (Color.AliceBlue, item2.BackColor, "#A4");
  275. Assert.AreEqual (null, item2.ListView, "#A5");
  276. Assert.AreEqual (Rectangle.Empty, item2.Bounds, "#A6");
  277. Assert.AreEqual (item.Checked, item2.Checked, "#A7");
  278. Assert.AreEqual (item.Font, item2.Font, "#A8");
  279. Assert.AreEqual (item.ForeColor, item2.ForeColor, "#A9");
  280. Assert.AreEqual (item.ImageIndex, item2.ImageIndex, "#A10");
  281. Assert.AreEqual (-1, item2.Index, "#A11");
  282. Assert.AreEqual (false, item2.Selected, "#A12");
  283. Assert.AreEqual (null, item2.Tag, "#A13");
  284. Assert.AreEqual (item.UseItemStyleForSubItems, item2.UseItemStyleForSubItems, "#A14");
  285. Assert.AreEqual (item.ImageKey, item2.ImageKey, "#A15");
  286. Assert.AreEqual (0, item2.IndentCount, "#A16");
  287. Assert.AreEqual (String.Empty, item2.Name, "#A17");
  288. Assert.AreEqual (new Point (-1, -1), item2.Position, "#A18");
  289. Assert.AreEqual (String.Empty, item2.ToolTipText, "#A19");
  290. Assert.AreEqual (item.Group.Header, item2.Group.Header, "#A20");
  291. }
  292. #endif
  293. [Test]
  294. public void ListViewItemDefaultValues ()
  295. {
  296. ListViewItem item = new ListViewItem ();
  297. Assert.IsFalse (item.Focused, "DefaultValues#3");
  298. Assert.IsFalse (item.Checked, "DefaultValues#4");
  299. Assert.AreEqual (string.Empty, item.Text, "DefaultValues#5");
  300. Assert.IsTrue (item.UseItemStyleForSubItems, "DefaultValues#6");
  301. Assert.AreEqual (-1, item.ImageIndex, "DefaultValues#7");
  302. #if NET_2_0
  303. Assert.AreEqual (String.Empty, item.Name, "DefaultValues#8");
  304. Assert.AreEqual(String.Empty, item.ImageKey, "DefaultValues#9");
  305. Assert.AreEqual (String.Empty, item.ToolTipText, "DefaultValues#10");
  306. Assert.AreEqual (0, item.IndentCount, "DefaultValues#11");
  307. #endif
  308. }
  309. [Test]
  310. public void ListViewItemBackColor ()
  311. {
  312. ListViewItem item = new ListViewItem ();
  313. ListView lv = new ListView ();
  314. lv.Items.Add (item);
  315. lv.BackColor = Color.Orange;
  316. Assert.AreEqual (lv.BackColor, item.BackColor, "BackColor#1");
  317. Assert.AreEqual (lv.BackColor, item.SubItems [0].BackColor, "BackColor#2");
  318. item.BackColor = Color.Navy;
  319. Assert.AreEqual (Color.Navy, item.BackColor, "BackColor#3");
  320. Assert.AreEqual (Color.Navy, item.SubItems [0].BackColor, "BackColor#4");
  321. item.SubItems [0].BackColor = Color.Green;
  322. Assert.AreEqual (Color.Green, item.BackColor, "BackColor#5");
  323. Assert.AreEqual (Color.Green, item.SubItems [0].BackColor, "BackColor#6");
  324. }
  325. [Test]
  326. public void ListViewItemForeColor ()
  327. {
  328. ListViewItem item = new ListViewItem ();
  329. ListView lv = new ListView ();
  330. lv.Items.Add (item);
  331. lv.ForeColor = Color.Orange;
  332. Assert.AreEqual (lv.ForeColor, item.ForeColor, "ForeColor#1");
  333. Assert.AreEqual (lv.ForeColor, item.SubItems [0].ForeColor, "ForeColor#2");
  334. item.ForeColor = Color.Navy;
  335. Assert.AreEqual (Color.Navy, item.ForeColor, "ForeColor#3");
  336. Assert.AreEqual (Color.Navy, item.SubItems [0].ForeColor, "ForeColor#4");
  337. item.SubItems [0].ForeColor = Color.Green;
  338. Assert.AreEqual (Color.Green, item.ForeColor, "ForeColor#5");
  339. Assert.AreEqual (Color.Green, item.SubItems [0].ForeColor, "ForeColor#6");
  340. }
  341. [Test]
  342. public void ListViewItemFocused ()
  343. {
  344. ListView lv = new ListView ();
  345. ListViewItem item1 = lv.Items.Add ("A");
  346. ListViewItem item2 = lv.Items.Add ("B");
  347. ListViewItem item3 = lv.Items.Add ("C");
  348. // Need to show form
  349. Form form = new Form ();
  350. lv.Parent = form;
  351. form.Show ();
  352. item1.Focused = true;
  353. Assert.IsTrue (item1.Focused, "#A1");
  354. Assert.IsFalse (item2.Focused, "#A2");
  355. Assert.IsFalse (item3.Focused, "#A3");
  356. Assert.AreEqual (item1, lv.FocusedItem, "#A4");
  357. item2.Focused = true;
  358. Assert.IsFalse (item1.Focused, "#B1");
  359. Assert.IsTrue (item2.Focused, "#B2");
  360. Assert.IsFalse (item3.Focused, "#B3");
  361. Assert.AreEqual (item2, lv.FocusedItem, "#B4");
  362. item3.Focused = true;
  363. Assert.IsFalse (item1.Focused, "#C1");
  364. Assert.IsFalse (item2.Focused, "#C2");
  365. Assert.IsTrue (item3.Focused, "#C3");
  366. Assert.AreEqual (item3, lv.FocusedItem, "#C4");
  367. item3.Focused = false;
  368. Assert.IsFalse (item1.Focused, "#D1");
  369. Assert.IsFalse (item2.Focused, "#D2");
  370. Assert.IsFalse (item3.Focused, "#D3");
  371. Assert.IsNull (lv.FocusedItem, "#D4");
  372. // Test Focused for Items without owner
  373. ListViewItem item4 = new ListViewItem ();
  374. Assert.IsFalse (item4.Focused);
  375. item4.Focused = true;
  376. Assert.IsFalse (item4.Focused, "#E1");
  377. form.Dispose ();
  378. }
  379. #if NET_2_0
  380. [Test]
  381. [ExpectedException (typeof (ArgumentOutOfRangeException))]
  382. public void ListViewItemIndent ()
  383. {
  384. ListViewItem item = new ListViewItem ();
  385. item.IndentCount = -1;
  386. }
  387. [Test]
  388. public void ListViewItemPosition ()
  389. {
  390. ListViewItem itemA = new ListViewItem ();
  391. ListViewItem itemB = new ListViewItem ();
  392. Point initial_pos = new Point (-1, -1);
  393. Assert.AreEqual (itemA.Position, initial_pos, "#A1");
  394. Assert.AreEqual (itemB.Position, initial_pos, "#A2");
  395. ListView lvw = new ListView ();
  396. lvw.Items.AddRange (new ListViewItem [] { itemA, itemB });
  397. Assert.AreEqual (itemA.Position, initial_pos, "#B1");
  398. Assert.AreEqual (itemB.Position, initial_pos, "#B2");
  399. // Create handle for lvw
  400. lvw.CreateControl ();
  401. Point itemA_pos = itemA.Position;
  402. Point itemB_pos = itemB.Position;
  403. Assert.IsTrue (itemA_pos != initial_pos, "#C1");
  404. Assert.IsTrue (itemB_pos != initial_pos, "#C2");
  405. // Now remove
  406. lvw.Items.Clear ();
  407. Assert.AreEqual (itemA_pos, itemA.Position, "#D1");
  408. Assert.AreEqual (itemB_pos, itemB.Position, "#D2");
  409. // Add in reverse order
  410. lvw.Items.AddRange (new ListViewItem [] { itemB, itemA });
  411. Assert.IsTrue (itemA_pos != itemA.Position, "#E1");
  412. Assert.IsTrue (itemB_pos != itemB.Position, "#E2");
  413. // Remove from ListView
  414. lvw.Items.Clear ();
  415. Assert.IsTrue (initial_pos != itemA.Position, "#F1");
  416. Assert.IsTrue (initial_pos != itemB.Position, "#F2");
  417. //
  418. // Now add them in other view (no effect)
  419. //
  420. lvw.Items.AddRange (new ListViewItem [] { itemA, itemB });
  421. lvw.Columns.Add ("Column A");
  422. lvw.View = View.Details;
  423. itemB_pos = itemB.Position;
  424. Assert.IsTrue (Point.Empty != itemB_pos, "#G1");
  425. Assert.IsTrue (initial_pos != itemB_pos, "#G2");
  426. itemB.Position = Point.Empty;
  427. Assert.AreEqual (itemB_pos, itemB.Position, "#H1");
  428. }
  429. #endif
  430. [Test] // bug #330415 and #331643
  431. public void RemoveFocusedItem ()
  432. {
  433. ListView lv = new ListView ();
  434. ListViewItem itemA = lv.Items.Add ("ItemA");
  435. ListViewItem itemB = lv.Items.Add ("ItemB");
  436. ListViewItem itemC = lv.Items.Add ("ItemC");
  437. ListViewItem itemD = lv.Items.Add ("ItemD");
  438. Form form = new Form ();
  439. form.ShowInTaskbar = false;
  440. form.Controls.Add (lv);
  441. form.Show ();
  442. // Calling Form.Show () doesn't fire
  443. // GotFocus event on child controls (asynch messages),
  444. // thus we can't get the first item focused,
  445. // but we DO when calling Application.Run ()
  446. //Assert.IsTrue (itemA.Focused, "#A1");
  447. Assert.IsFalse (itemB.Focused, "#A2");
  448. Assert.IsFalse (itemC.Focused, "#A3");
  449. Assert.IsFalse (itemD.Focused, "#A4");
  450. itemB.Focused = true;
  451. Assert.IsFalse (itemA.Focused, "#B1");
  452. Assert.IsTrue (itemB.Focused, "#B2");
  453. Assert.IsFalse (itemC.Focused, "#B3");
  454. Assert.IsFalse (itemD.Focused, "#B4");
  455. lv.Items.Remove (itemB);
  456. Assert.IsFalse (itemA.Focused, "#C1");
  457. Assert.IsFalse (itemB.Focused, "#C2");
  458. Assert.IsTrue (itemC.Focused, "#C3");
  459. Assert.IsFalse (itemD.Focused, "#C4");
  460. itemD.Focused = true;
  461. Assert.IsFalse (itemA.Focused, "#D1");
  462. Assert.IsFalse (itemB.Focused, "#D2");
  463. Assert.IsFalse (itemC.Focused, "#D3");
  464. Assert.IsTrue (itemD.Focused, "#D4");
  465. lv.Items.Remove (itemD);
  466. Assert.IsFalse (itemA.Focused, "#E1");
  467. Assert.IsFalse (itemB.Focused, "#E2");
  468. Assert.IsTrue (itemC.Focused, "#E3");
  469. Assert.IsFalse (itemD.Focused, "#E4");
  470. lv.Items.Remove (itemC);
  471. Assert.IsTrue (itemA.Focused, "#F1");
  472. Assert.IsFalse (itemB.Focused, "#F2");
  473. Assert.IsFalse (itemC.Focused, "#F3");
  474. Assert.IsFalse (itemD.Focused, "#F4");
  475. lv.Items.Remove (itemA);
  476. Assert.IsFalse (itemA.Focused, "#G1");
  477. Assert.IsFalse (itemB.Focused, "#G2");
  478. Assert.IsFalse (itemC.Focused, "#G3");
  479. Assert.IsFalse (itemD.Focused, "#G4");
  480. ListViewItem itemE = lv.Items.Add ("ItemE");
  481. Assert.IsFalse (itemA.Focused, "#H1");
  482. Assert.IsFalse (itemB.Focused, "#H2");
  483. Assert.IsFalse (itemC.Focused, "#H3");
  484. Assert.IsFalse (itemD.Focused, "#H4");
  485. Assert.IsFalse (itemE.Focused, "#H5");
  486. form.Dispose ();
  487. }
  488. #if NET_2_0
  489. [Test]
  490. public void ListViewItemGroup ()
  491. {
  492. ListViewGroup lvg1 = new ListViewGroup ();
  493. ListViewGroup lvg2 = new ListViewGroup ();
  494. ListViewItem lvi = new ListViewItem ();
  495. lvg1.Items.Add (lvi);
  496. Assert.AreEqual (1, lvg1.Items.Count, "#A1");
  497. Assert.AreEqual (lvg1, lvi.Group, "#A2");
  498. lvi.Group = lvg2;
  499. Assert.AreEqual (0, lvg1.Items.Count, "#B1");
  500. Assert.AreEqual (1, lvg2.Items.Count, "#B2");
  501. Assert.AreEqual (lvg2, lvi.Group, "#B3");
  502. }
  503. #endif
  504. [Test]
  505. public void ListViewItemUseItemStyleForSubItems ()
  506. {
  507. ListViewItem item = new ListViewItem ();
  508. Assert.AreEqual (1, item.SubItems.Count);
  509. // UseitemStyleForSubItems works at draw level
  510. item.UseItemStyleForSubItems = true;
  511. ListViewItem.ListViewSubItem subitem0 = item.SubItems [0];
  512. Color subitem0_back_color = subitem0.BackColor = Color.Black;
  513. Color subitem0_fore_color = subitem0.ForeColor = Color.White;
  514. Assert.AreEqual (subitem0_back_color, item.SubItems [0].BackColor, "UseItemStyleForSubItems#1");
  515. Assert.AreEqual (subitem0_fore_color, item.SubItems [0].ForeColor, "UseItemStyleForSubItems#2");
  516. Assert.AreEqual (item.BackColor, item.SubItems [0].BackColor, "UseItemStyleForSubItems#3");
  517. Assert.AreEqual (item.ForeColor, item.SubItems [0].ForeColor, "UseItemStyleForSubItems#4");
  518. ListViewItem.ListViewSubItem subitem1 = item.SubItems.Add ("SubItem");
  519. Color subitem1_back_color = subitem1.BackColor = Color.Blue;
  520. Color subitem1_fore_color = subitem1.ForeColor = Color.Gray;
  521. Assert.AreEqual (subitem1_back_color, subitem1.BackColor, "UseItemStyleForSubItem#5");
  522. Assert.AreEqual (subitem1_fore_color, subitem1.ForeColor, "UseItemStyleForSubItem#6");
  523. }
  524. [Test]
  525. public void ListViewItemTestClone ()
  526. {
  527. Form f = new Form ();
  528. ListView lv = new ListView ();
  529. lv.Parent = f;
  530. ListViewItem item1 = lv.Items.Add ("Hello");
  531. item1.ForeColor = Color.Blue;
  532. item1.BackColor = Color.Red;
  533. item1.Font = new Font ("Arial", 14);
  534. item1.SubItems.Add ("Element2");
  535. #if NET_2_0
  536. item1.ToolTipText = item1.Text;
  537. #endif
  538. f.Show ();
  539. ListViewItem item2 = (ListViewItem) item1.Clone ();
  540. Assert.AreEqual (Color.Blue, item2.ForeColor, "#1");
  541. Assert.AreEqual (Color.Red, item2.BackColor, "#2");
  542. Assert.AreEqual ("Hello", item2.Text, "#3");
  543. Assert.AreEqual (item1.Font, item2.Font, "#4");
  544. Assert.AreEqual (2, item2.SubItems.Count, "#5");
  545. Assert.AreEqual ("Hello", item2.SubItems [0].Text, "#6");
  546. Assert.AreEqual ("Element2", item2.SubItems[1].Text, "#7");
  547. #if NET_2_0
  548. Assert.AreEqual (item1.ToolTipText, item2.ToolTipText, "#8");
  549. #endif
  550. // Focused is not copied
  551. // These tests shoule be re-enabled when #333693
  552. /*Assert.IsTrue (item1.Focused, "#9");
  553. Assert.IsFalse (item2.Focused, "#10");*/
  554. f.Dispose ();
  555. }
  556. #if NET_2_0
  557. [Test]
  558. public void ListViewItemTestImageIndex()
  559. {
  560. ListViewItem item1 = new ListViewItem();
  561. item1.ImageKey = "Key1";
  562. item1.ImageIndex = 0;
  563. Assert.AreEqual(String.Empty, item1.ImageKey, "ImageIndex#1");
  564. item1.ImageIndex = 0;
  565. item1.ImageKey = "Key1";
  566. Assert.AreEqual (-1, item1.ImageIndex, "ImageIndex#2");
  567. item1.ImageKey = "Key1";
  568. item1.ImageIndex = -1;
  569. Assert.AreEqual (String.Empty, item1.ImageKey, "ImageIndex#3");
  570. item1.ImageIndex = 0;
  571. item1.ImageKey = String.Empty;
  572. Assert.AreEqual (-1, item1.ImageIndex, "ImageIndex#4");
  573. }
  574. [Test]
  575. public void ListViewItemToolTipText ()
  576. {
  577. ListViewItem item1 = new ListViewItem();
  578. item1.ToolTipText = null;
  579. Assert.AreEqual (String.Empty, item1.ToolTipText, "ToolTipText#1");
  580. }
  581. #endif
  582. }
  583. [TestFixture]
  584. public class ListViewSubItemTest : TestHelper
  585. {
  586. [Test] // ctor ()
  587. public void Constructor1 ()
  588. {
  589. ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
  590. Assert.AreEqual (string.Empty, subItem.Text, "#1");
  591. Assert.AreEqual (SystemColors.Window, subItem.BackColor, "#2");
  592. Assert.AreEqual (SystemColors.WindowText, subItem.ForeColor, "#3");
  593. Assert.AreEqual (SystemFonts.DefaultFont, subItem.Font, "#4");
  594. }
  595. [Test] // ctor (ListViewItem, String)
  596. public void Constructor2 ()
  597. {
  598. ListViewItem.ListViewSubItem subItem;
  599. ListViewItem item = new ListViewItem ();
  600. subItem = new ListViewItem.ListViewSubItem (null, null);
  601. Assert.IsNotNull (subItem.Font, "#A1");
  602. #if NET_2_0
  603. Assert.AreEqual (string.Empty, subItem.Name, "#A2");
  604. Assert.IsNull (subItem.Tag, "#A3");
  605. #endif
  606. Assert.AreEqual (String.Empty, subItem.Text, "#A4");
  607. subItem = new ListViewItem.ListViewSubItem (item, "SubItem2");
  608. Assert.IsNotNull (subItem.Font, "#B1");
  609. #if NET_2_0
  610. Assert.AreEqual (string.Empty, subItem.Name, "#B2");
  611. Assert.IsNull (subItem.Tag, "#B3");
  612. #endif
  613. Assert.AreEqual ("SubItem2", subItem.Text, "#B4");
  614. }
  615. [Test] // ctor (ListViewItem, String, Color, Color, Font)
  616. public void Constructor3 ()
  617. {
  618. ListViewItem.ListViewSubItem subItem;
  619. Font font = new Font ("Arial", 12);
  620. ListViewItem item = new ListViewItem ();
  621. subItem = new ListViewItem.ListViewSubItem (null, null,
  622. Color.Blue, Color.Red, null);
  623. Assert.AreEqual (Color.Red, subItem.BackColor, "#A1");
  624. Assert.IsNotNull (subItem.Font, "#A2");
  625. Assert.AreEqual (Color.Blue, subItem.ForeColor, "#A3");
  626. #if NET_2_0
  627. Assert.AreEqual (string.Empty, subItem.Name, "#A4");
  628. Assert.IsNull (subItem.Tag, "#A5");
  629. #endif
  630. Assert.AreEqual (string.Empty, subItem.Text, "#A6");
  631. subItem = new ListViewItem.ListViewSubItem (item, "SubItem3",
  632. Color.Blue, Color.Green, font);
  633. Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
  634. Assert.AreSame (font, subItem.Font, "#B2");
  635. Assert.AreEqual (Color.Blue, subItem.ForeColor, "#B3");
  636. #if NET_2_0
  637. Assert.AreEqual (string.Empty, subItem.Name, "#B4");
  638. Assert.IsNull (subItem.Tag, "#B5");
  639. #endif
  640. Assert.AreEqual ("SubItem3", subItem.Text, "#B6");
  641. }
  642. #if NET_2_0
  643. [Test]
  644. public void Name ()
  645. {
  646. ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
  647. subItem.Name = "foo";
  648. Assert.AreEqual ("foo", subItem.Name, "#1");
  649. subItem.Name = null;
  650. Assert.AreEqual (string.Empty, subItem.Name, "#2");
  651. subItem.Name = "bar";
  652. Assert.AreEqual ("bar", subItem.Name, "#3");
  653. subItem.Name = string.Empty;
  654. Assert.AreEqual (string.Empty, subItem.Name, "#4");
  655. subItem.Name = " \t ";
  656. Assert.AreEqual (" \t ", subItem.Name, "#5");
  657. }
  658. [Test]
  659. public void Tag ()
  660. {
  661. ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
  662. subItem.Tag = "foo";
  663. Assert.AreEqual ("foo", subItem.Tag, "#1");
  664. subItem.Tag = null;
  665. Assert.IsNull (subItem.Tag, "#2");
  666. subItem.Tag = 5;
  667. Assert.AreEqual (5, subItem.Tag, "#3");
  668. }
  669. #endif
  670. [Test]
  671. public void Text ()
  672. {
  673. ListViewItem.ListViewSubItem subItem = new ListViewItem.ListViewSubItem ();
  674. subItem.Text = "foo";
  675. Assert.AreEqual ("foo", subItem.Text, "#1");
  676. subItem.Text = null;
  677. Assert.AreEqual (string.Empty, subItem.Text, "#2");
  678. subItem.Text = "bar";
  679. Assert.AreEqual ("bar", subItem.Text, "#3");
  680. subItem.Text = string.Empty;
  681. Assert.AreEqual (string.Empty, subItem.Text, "#4");
  682. subItem.Text = " \t ";
  683. Assert.AreEqual (" \t ", subItem.Text, "#5");
  684. }
  685. [Test]
  686. public void Serialize ()
  687. {
  688. ListViewItem.ListViewSubItem subItem;
  689. Font font = new Font ("Arial", 12);
  690. ListViewItem item = new ListViewItem ();
  691. subItem = new ListViewItem.ListViewSubItem (item,
  692. "SubItemText", Color.Yellow, Color.Green,
  693. font);
  694. #if NET_2_0
  695. subItem.Name = "foo";
  696. subItem.Tag = "bar";
  697. #endif
  698. MemoryStream ms = new MemoryStream ();
  699. BinaryFormatter formatter = new BinaryFormatter ();
  700. formatter.Serialize (ms, subItem);
  701. ms.Position = 0;
  702. subItem = (ListViewItem.ListViewSubItem)
  703. formatter.Deserialize (ms);
  704. Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
  705. Assert.AreEqual (font, subItem.Font, "#A2");
  706. Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
  707. #if NET_2_0
  708. Assert.AreEqual (string.Empty, subItem.Name, "#A4");
  709. Assert.IsNull (subItem.Tag, "#A5");
  710. #endif
  711. Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
  712. ms.Position = 0;
  713. byte [] ser = new byte [ms.Length];
  714. ms.Read (ser, 0, ser.Length);
  715. }
  716. [Test]
  717. [Category ("NotDotNet")]
  718. [Category ("NotWorking")] // fails on buildbot
  719. public void SerializeExact_Mono ()
  720. {
  721. ListViewItem.ListViewSubItem subItem;
  722. Font font = new Font ("Arial", 12);
  723. ListViewItem item = new ListViewItem ();
  724. subItem = new ListViewItem.ListViewSubItem (item,
  725. "SubItemText", Color.Yellow, Color.Green,
  726. font);
  727. #if NET_2_0
  728. subItem.Name = "foo";
  729. subItem.Tag = "bar";
  730. #endif
  731. MemoryStream ms = new MemoryStream ();
  732. BinaryFormatter formatter = new BinaryFormatter ();
  733. formatter.AssemblyFormat = FormatterAssemblyStyle.Full;
  734. formatter.Serialize (ms, subItem);
  735. ms.Position = 0;
  736. byte [] ser = new byte [ms.Length];
  737. ms.Read (ser, 0, ser.Length);
  738. #if NET_2_0
  739. Assert.AreEqual (_serializedV20_Mono, ser);
  740. #else
  741. Assert.AreEqual (_serializedV11_Mono, ser);
  742. #endif
  743. }
  744. [Test]
  745. [Category ("NotWorking")]
  746. public void SerializeExact_MS ()
  747. {
  748. ListViewItem.ListViewSubItem subItem;
  749. Font font = new Font ("Arial", 12);
  750. ListViewItem item = new ListViewItem ();
  751. subItem = new ListViewItem.ListViewSubItem (item,
  752. "SubItemText", Color.Yellow, Color.Green,
  753. font);
  754. #if NET_2_0
  755. subItem.Name = "foo";
  756. subItem.Tag = "bar";
  757. #endif
  758. MemoryStream ms = new MemoryStream ();
  759. BinaryFormatter formatter = new BinaryFormatter ();
  760. formatter.Serialize (ms, subItem);
  761. ms.Position = 0;
  762. byte [] ser = new byte [ms.Length];
  763. ms.Read (ser, 0, ser.Length);
  764. #if NET_2_0
  765. Assert.AreEqual (_serializedV20_MS, ser);
  766. #else
  767. Assert.AreEqual (_serializedV11_MS, ser);
  768. #endif
  769. }
  770. [Test]
  771. public void Deserialize ()
  772. {
  773. ListViewItem.ListViewSubItem subItem;
  774. MemoryStream ms;
  775. BinaryFormatter formatter = new BinaryFormatter ();
  776. ms = new MemoryStream ();
  777. ms.Write (_serializedV11_Mono, 0, _serializedV11_Mono.Length);
  778. ms.Position = 0;
  779. subItem = (ListViewItem.ListViewSubItem)
  780. formatter.Deserialize (ms);
  781. // FIXME: bug #410693
  782. //Assert.AreEqual (Color.Green, subItem.BackColor, "#A1");
  783. Assert.AreEqual ("Green", subItem.BackColor.Name, "#A1");
  784. Assert.IsNotNull (subItem.Font, "#A2");
  785. // FIXME: bug #410693
  786. //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#A3");
  787. Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#A3");
  788. #if NET_2_0
  789. Assert.AreEqual (string.Empty, subItem.Name, "#A4");
  790. Assert.IsNull (subItem.Tag, "#A5");
  791. #endif
  792. Assert.AreEqual ("SubItemText", subItem.Text, "#A6");
  793. ms = new MemoryStream ();
  794. ms.Write (_serializedV11_MS, 0, _serializedV11_MS.Length);
  795. ms.Position = 0;
  796. subItem = (ListViewItem.ListViewSubItem)
  797. formatter.Deserialize (ms);
  798. // FIXME: bug #410693
  799. //Assert.AreEqual (Color.Green, subItem.BackColor, "#B1");
  800. Assert.AreEqual ("Green", subItem.BackColor.Name, "#B1");
  801. Assert.IsNotNull (subItem.Font, "#B2");
  802. // FIXME: bug #410693
  803. //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#B3");
  804. Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#B3");
  805. #if NET_2_0
  806. Assert.AreEqual (string.Empty, subItem.Name, "#B4");
  807. Assert.IsNull (subItem.Tag, "#B5");
  808. #endif
  809. Assert.AreEqual ("SubItemText", subItem.Text, "#B6");
  810. #if NET_2_0
  811. ms = new MemoryStream ();
  812. ms.Write (_serializedV20_Mono, 0, _serializedV20_Mono.Length);
  813. ms.Position = 0;
  814. subItem = (ListViewItem.ListViewSubItem)
  815. formatter.Deserialize (ms);
  816. // FIXME: bug #410693
  817. //Assert.AreEqual (Color.Green, subItem.BackColor, "#C1");
  818. Assert.AreEqual ("Green", subItem.BackColor.Name, "#C1");
  819. Assert.IsNotNull (subItem.Font, "#C2");
  820. // FIXME: bug #410693
  821. //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#C3");
  822. Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#C3");
  823. Assert.AreEqual (string.Empty, subItem.Name, "#C4");
  824. Assert.IsNull (subItem.Tag, "#C5");
  825. Assert.AreEqual ("SubItemText", subItem.Text, "#C6");
  826. ms = new MemoryStream ();
  827. ms.Write (_serializedV20_MS, 0, _serializedV20_MS.Length);
  828. ms.Position = 0;
  829. subItem = (ListViewItem.ListViewSubItem)
  830. formatter.Deserialize (ms);
  831. // FIXME: bug #410693
  832. //Assert.AreEqual (Color.Green, subItem.BackColor, "#D1");
  833. Assert.AreEqual ("Green", subItem.BackColor.Name, "#D1");
  834. Assert.IsNotNull (subItem.Font, "#D2");
  835. // FIXME: bug #410693
  836. //Assert.AreEqual (Color.Yellow, subItem.ForeColor, "#D3");
  837. Assert.AreEqual ("Yellow", subItem.ForeColor.Name, "#D3");
  838. Assert.AreEqual (string.Empty, subItem.Name, "#D4");
  839. Assert.IsNull (subItem.Tag, "#D5");
  840. Assert.AreEqual ("SubItemText", subItem.Text, "#D6");
  841. #endif
  842. }
  843. static byte [] _serializedV11_MS = {
  844. 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
  845. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
  846. 0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  847. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
  848. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
  849. 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
  850. 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
  851. 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
  852. 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
  853. 0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
  854. 0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
  855. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
  856. 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
  857. 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
  858. 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
  859. 0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
  860. 0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
  861. 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
  862. 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
  863. 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
  864. 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
  865. 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
  866. 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
  867. 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
  868. 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
  869. 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
  870. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
  871. 0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
  872. 0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
  873. 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
  874. 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
  875. 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
  876. 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
  877. 0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
  878. 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
  879. 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
  880. 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
  881. 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
  882. 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
  883. 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
  884. 0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
  885. 0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
  886. 0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
  887. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
  888. 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
  889. 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
  890. 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
  891. 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  892. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
  893. 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0xfa, 0xff, 0xff,
  894. 0xff, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  895. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  896. 0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
  897. 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
  898. 0x73, 0x74, 0x61, 0x74, 0x65, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
  899. 0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
  900. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00,
  901. 0x0a, 0x01, 0xf9, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, 0x00,
  902. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00,
  903. 0x0a, 0x09, 0x08, 0x00, 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00,
  904. 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
  905. 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00,
  906. 0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a,
  907. 0x65, 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69,
  908. 0x74, 0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74,
  909. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
  910. 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00,
  911. 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
  912. 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70,
  913. 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00,
  914. 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00, 0x05,
  915. 0x41, 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0xf6,
  916. 0xff, 0xff, 0xff, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e,
  917. 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e,
  918. 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07,
  919. 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
  920. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xf5, 0xff, 0xff, 0xff,
  921. 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
  922. 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69,
  923. 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07,
  924. 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00,
  925. 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
  926. static byte [] _serializedV20_MS = {
  927. 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
  928. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
  929. 0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  930. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
  931. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
  932. 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
  933. 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
  934. 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
  935. 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
  936. 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
  937. 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
  938. 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
  939. 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
  940. 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
  941. 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
  942. 0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
  943. 0x61, 0x6d, 0x65, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x08, 0x75,
  944. 0x73, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x01, 0x01, 0x04, 0x02,
  945. 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  946. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
  947. 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
  948. 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
  949. 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
  950. 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
  951. 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
  952. 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
  953. 0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x09, 0x05,
  954. 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x03, 0x62, 0x61,
  955. 0x72, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
  956. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
  957. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
  958. 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
  959. 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
  960. 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
  961. 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
  962. 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
  963. 0x05, 0x05, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
  964. 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
  965. 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
  966. 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
  967. 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
  968. 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
  969. 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
  970. 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
  971. 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
  972. 0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  973. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  974. 0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
  975. 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
  976. 0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
  977. 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
  978. 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
  979. 0x00, 0x00, 0x05, 0xf8, 0xff, 0xff, 0xff, 0x14, 0x53, 0x79, 0x73,
  980. 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
  981. 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x04,
  982. 0x6e, 0x61, 0x6d, 0x65, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a,
  983. 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05,
  984. 0x73, 0x74, 0x61, 0x74, 0x65, 0x01, 0x00, 0x00, 0x00, 0x09, 0x07,
  985. 0x07, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
  986. 0x00, 0x00, 0x00, 0x4f, 0x00, 0x01, 0x00, 0x01, 0xf7, 0xff, 0xff,
  987. 0xff, 0xf8, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
  988. 0x00, 0x00, 0x00, 0xa6, 0x00, 0x01, 0x00, 0x09, 0x0a, 0x00, 0x00,
  989. 0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74,
  990. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
  991. 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61,
  992. 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79,
  993. 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04,
  994. 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  995. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53,
  996. 0x74, 0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79,
  997. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
  998. 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55,
  999. 0x6e, 0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
  1000. 0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c,
  1001. 0x00, 0x00, 0x40, 0x41, 0x05, 0xf4, 0xff, 0xff, 0xff, 0x18, 0x53,
  1002. 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
  1003. 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c,
  1004. 0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
  1005. 0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1006. 0x00, 0x05, 0xf3, 0xff, 0xff, 0xff, 0x1b, 0x53, 0x79, 0x73, 0x74,
  1007. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
  1008. 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69,
  1009. 0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65,
  1010. 0x5f, 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
  1011. 0x00, 0x0b };
  1012. static byte [] _serializedV11_Mono = {
  1013. 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
  1014. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
  1015. 0x5a, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  1016. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
  1017. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x31, 0x2e,
  1018. 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43,
  1019. 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74,
  1020. 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
  1021. 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37,
  1022. 0x37, 0x61, 0x35, 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65,
  1023. 0x30, 0x38, 0x39, 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79,
  1024. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77,
  1025. 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73,
  1026. 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c,
  1027. 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49,
  1028. 0x74, 0x65, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78,
  1029. 0x74, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x04, 0x3e, 0x53,
  1030. 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f,
  1031. 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69,
  1032. 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b,
  1033. 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62,
  1034. 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65,
  1035. 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00, 0x00, 0x02,
  1036. 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x53, 0x75,
  1037. 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74, 0x09, 0x04,
  1038. 0x00, 0x00, 0x00, 0x0c, 0x05, 0x00, 0x00, 0x00, 0x54, 0x53, 0x79,
  1039. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
  1040. 0x67, 0x2c, 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
  1041. 0x31, 0x2e, 0x30, 0x2e, 0x35, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x2c,
  1042. 0x20, 0x43, 0x75, 0x6c, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65,
  1043. 0x75, 0x74, 0x72, 0x61, 0x6c, 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c,
  1044. 0x69, 0x63, 0x4b, 0x65, 0x79, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d,
  1045. 0x62, 0x30, 0x33, 0x66, 0x35, 0x66, 0x37, 0x66, 0x31, 0x31, 0x64,
  1046. 0x35, 0x30, 0x61, 0x33, 0x61, 0x05, 0x04, 0x00, 0x00, 0x00, 0x3e,
  1047. 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64,
  1048. 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c,
  1049. 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d,
  1050. 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53, 0x75,
  1051. 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74,
  1052. 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00,
  1053. 0x09, 0x62, 0x61, 0x63, 0x6b, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09,
  1054. 0x66, 0x6f, 0x72, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66,
  1055. 0x6f, 0x6e, 0x74, 0x04, 0x04, 0x04, 0x14, 0x53, 0x79, 0x73, 0x74,
  1056. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e,
  1057. 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00, 0x00, 0x14, 0x53,
  1058. 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69,
  1059. 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x05, 0x00, 0x00,
  1060. 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  1061. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x05,
  1062. 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x06, 0x00, 0x00,
  1063. 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  1064. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  1065. 0x04, 0x00, 0x00, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x05,
  1066. 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e,
  1067. 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00,
  1068. 0x00, 0x00, 0x01, 0x09, 0x07, 0x07, 0x05, 0x00, 0x00, 0x00, 0x00,
  1069. 0x80, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x4f, 0x00,
  1070. 0x06, 0x07, 0x00, 0x00, 0x00, 0x05, 0x47, 0x72, 0x65, 0x65, 0x6e,
  1071. 0x01, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xff,
  1072. 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0xa6, 0x00, 0x06,
  1073. 0x09, 0x00, 0x00, 0x00, 0x06, 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77,
  1074. 0x09, 0x0a, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 0x00, 0x13,
  1075. 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
  1076. 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00,
  1077. 0x00, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65,
  1078. 0x05, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74,
  1079. 0x01, 0x00, 0x04, 0x04, 0x0b, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65,
  1080. 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
  1081. 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x05, 0x00, 0x00,
  1082. 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  1083. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
  1084. 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74, 0x05, 0x00, 0x00, 0x00,
  1085. 0x05, 0x00, 0x00, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x05, 0x41,
  1086. 0x72, 0x69, 0x61, 0x6c, 0x00, 0x00, 0x40, 0x41, 0x05, 0x0c, 0x00,
  1087. 0x00, 0x00, 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44,
  1088. 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74,
  1089. 0x53, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
  1090. 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
  1091. 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0d, 0x00, 0x00, 0x00, 0x1b,
  1092. 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77,
  1093. 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63,
  1094. 0x73, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x00, 0x00, 0x07, 0x76,
  1095. 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x5f, 0x00, 0x08, 0x05, 0x00, 0x00,
  1096. 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b };
  1097. static byte [] _serializedV20_Mono = {
  1098. 0x00, 0x01, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00,
  1099. 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x00,
  1100. 0x57, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  1101. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2c,
  1102. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
  1103. 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
  1104. 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
  1105. 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
  1106. 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x37, 0x37, 0x61, 0x35,
  1107. 0x63, 0x35, 0x36, 0x31, 0x39, 0x33, 0x34, 0x65, 0x30, 0x38, 0x39,
  1108. 0x05, 0x01, 0x00, 0x00, 0x00, 0x31, 0x53, 0x79, 0x73, 0x74, 0x65,
  1109. 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
  1110. 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
  1111. 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
  1112. 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
  1113. 0x04, 0x00, 0x00, 0x00, 0x04, 0x74, 0x65, 0x78, 0x74, 0x04, 0x6e,
  1114. 0x61, 0x6d, 0x65, 0x08, 0x75, 0x73, 0x65, 0x72, 0x44, 0x61, 0x74,
  1115. 0x61, 0x05, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x01, 0x01, 0x02, 0x04,
  1116. 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x57, 0x69, 0x6e,
  1117. 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x73, 0x2e,
  1118. 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x49, 0x74, 0x65,
  1119. 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69, 0x65, 0x77, 0x53,
  1120. 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x53, 0x75, 0x62, 0x49,
  1121. 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x02, 0x00, 0x00,
  1122. 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x0b,
  1123. 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x65, 0x78, 0x74,
  1124. 0x06, 0x04, 0x00, 0x00, 0x00, 0x03, 0x66, 0x6f, 0x6f, 0x06, 0x05,
  1125. 0x00, 0x00, 0x00, 0x03, 0x62, 0x61, 0x72, 0x09, 0x06, 0x00, 0x00,
  1126. 0x00, 0x0c, 0x07, 0x00, 0x00, 0x00, 0x51, 0x53, 0x79, 0x73, 0x74,
  1127. 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2c,
  1128. 0x20, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x32, 0x2e,
  1129. 0x30, 0x2e, 0x30, 0x2e, 0x30, 0x2c, 0x20, 0x43, 0x75, 0x6c, 0x74,
  1130. 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x75, 0x74, 0x72, 0x61, 0x6c,
  1131. 0x2c, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
  1132. 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x62, 0x30, 0x33, 0x66, 0x35,
  1133. 0x66, 0x37, 0x66, 0x31, 0x31, 0x64, 0x35, 0x30, 0x61, 0x33, 0x61,
  1134. 0x05, 0x06, 0x00, 0x00, 0x00, 0x3e, 0x53, 0x79, 0x73, 0x74, 0x65,
  1135. 0x6d, 0x2e, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x73, 0x2e, 0x46,
  1136. 0x6f, 0x72, 0x6d, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x56, 0x69,
  1137. 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2b, 0x4c, 0x69, 0x73, 0x74,
  1138. 0x56, 0x69, 0x65, 0x77, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d,
  1139. 0x2b, 0x53, 0x75, 0x62, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x74, 0x79,
  1140. 0x6c, 0x65, 0x03, 0x00, 0x00, 0x00, 0x09, 0x62, 0x61, 0x63, 0x6b,
  1141. 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x09, 0x66, 0x6f, 0x72, 0x65, 0x43,
  1142. 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x66, 0x6f, 0x6e, 0x74, 0x04, 0x04,
  1143. 0x04, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72,
  1144. 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  1145. 0x07, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
  1146. 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x43, 0x6f,
  1147. 0x6c, 0x6f, 0x72, 0x07, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73,
  1148. 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
  1149. 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x07, 0x00, 0x00, 0x00, 0x02, 0x00,
  1150. 0x00, 0x00, 0x05, 0x08, 0x00, 0x00, 0x00, 0x14, 0x53, 0x79, 0x73,
  1151. 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
  1152. 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x04, 0x00, 0x00, 0x00, 0x05,
  1153. 0x76, 0x61, 0x6c, 0x75, 0x65, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65,
  1154. 0x0a, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
  1155. 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x00, 0x01, 0x09, 0x07,
  1156. 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0xff, 0x00, 0x00,
  1157. 0x00, 0x00, 0x07, 0x00, 0x4f, 0x00, 0x06, 0x09, 0x00, 0x00, 0x00,
  1158. 0x05, 0x47, 0x72, 0x65, 0x65, 0x6e, 0x01, 0x0a, 0x00, 0x00, 0x00,
  1159. 0x08, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
  1160. 0x00, 0x07, 0x00, 0xa6, 0x00, 0x06, 0x0b, 0x00, 0x00, 0x00, 0x06,
  1161. 0x59, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x09, 0x0c, 0x00, 0x00, 0x00,
  1162. 0x05, 0x0c, 0x00, 0x00, 0x00, 0x13, 0x53, 0x79, 0x73, 0x74, 0x65,
  1163. 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46,
  1164. 0x6f, 0x6e, 0x74, 0x04, 0x00, 0x00, 0x00, 0x04, 0x4e, 0x61, 0x6d,
  1165. 0x65, 0x04, 0x53, 0x69, 0x7a, 0x65, 0x05, 0x53, 0x74, 0x79, 0x6c,
  1166. 0x65, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x01, 0x00, 0x04, 0x04, 0x0b,
  1167. 0x18, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61,
  1168. 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74,
  1169. 0x79, 0x6c, 0x65, 0x07, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73,
  1170. 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67,
  1171. 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e,
  1172. 0x69, 0x74, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06,
  1173. 0x0d, 0x00, 0x00, 0x00, 0x05, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x00,
  1174. 0x00, 0x40, 0x41, 0x05, 0x0e, 0x00, 0x00, 0x00, 0x18, 0x53, 0x79,
  1175. 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e,
  1176. 0x67, 0x2e, 0x46, 0x6f, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65,
  1177. 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
  1178. 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1179. 0x05, 0x0f, 0x00, 0x00, 0x00, 0x1b, 0x53, 0x79, 0x73, 0x74, 0x65,
  1180. 0x6d, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x47,
  1181. 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x55, 0x6e, 0x69, 0x74,
  1182. 0x01, 0x00, 0x00, 0x00, 0x07, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
  1183. 0x5f, 0x00, 0x08, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
  1184. 0x0b };
  1185. }
  1186. [TestFixture]
  1187. public class ListViewSubItemCollectionTest : TestHelper
  1188. {
  1189. [Test]
  1190. public void Ctor ()
  1191. {
  1192. ListViewItem item = new ListViewItem ();
  1193. item.Text = "MAIN";
  1194. ListViewItem.ListViewSubItemCollection sub_items;
  1195. sub_items = new ListViewItem.ListViewSubItemCollection (item);
  1196. Assert.AreEqual (1, sub_items.Count, "#A1");
  1197. Assert.AreEqual ("MAIN", sub_items [0].Text, "#A2");
  1198. sub_items.Add ("A");
  1199. Assert.AreEqual (2, sub_items.Count, "#B1");
  1200. Assert.AreEqual ("A", sub_items [1].Text, "#B2");
  1201. }
  1202. [Test]
  1203. public void AddRange1 ()
  1204. {
  1205. ListViewItem item = new ListViewItem ();
  1206. ListViewItem.ListViewSubItem subItemA = item.SubItems.Add ("A");
  1207. Assert.AreEqual (2, item.SubItems.Count, "#A1");
  1208. Assert.IsNotNull (item.SubItems [0], "#A2");
  1209. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
  1210. ListViewItem.ListViewSubItem subItemB = new ListViewItem.ListViewSubItem ();
  1211. subItemB.Text = "B";
  1212. ListViewItem.ListViewSubItem subItemC = new ListViewItem.ListViewSubItem ();
  1213. subItemB.Text = "C";
  1214. item.SubItems.AddRange (new ListViewItem.ListViewSubItem [] {
  1215. subItemB, null, subItemC });
  1216. Assert.AreEqual (4, item.SubItems.Count, "#B1");
  1217. Assert.IsNotNull (item.SubItems [0], "#B2");
  1218. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
  1219. Assert.IsNotNull (item.SubItems [1], "#B3");
  1220. Assert.AreSame (subItemA, item.SubItems [1], "#B4");
  1221. Assert.IsNotNull (item.SubItems [2], "#B5");
  1222. Assert.AreSame (subItemB, item.SubItems [2], "#B6");
  1223. Assert.IsNotNull (item.SubItems [3], "#B7");
  1224. Assert.AreSame (subItemC, item.SubItems [3], "#B8");
  1225. }
  1226. [Test]
  1227. public void AddRange1_Null ()
  1228. {
  1229. ListViewItem item = new ListViewItem ();
  1230. try {
  1231. item.SubItems.AddRange ((ListViewItem.ListViewSubItem []) null);
  1232. Assert.Fail ("#1");
  1233. } catch (ArgumentNullException ex) {
  1234. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  1235. Assert.IsNotNull (ex.Message, "#3");
  1236. Assert.IsNotNull (ex.ParamName, "#4");
  1237. Assert.AreEqual ("items", ex.ParamName, "#5");
  1238. Assert.IsNull (ex.InnerException, "#6");
  1239. }
  1240. }
  1241. [Test]
  1242. public void AddRange2 ()
  1243. {
  1244. string subItemAText = "A";
  1245. string subItemBText = "B";
  1246. string subItemCText = "B";
  1247. ListViewItem item = new ListViewItem ();
  1248. item.SubItems.Add (subItemAText);
  1249. Assert.AreEqual (2, item.SubItems.Count, "#A1");
  1250. Assert.IsNotNull (item.SubItems [0], "#A2");
  1251. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
  1252. Assert.IsNotNull (item.SubItems [1], "#A4");
  1253. Assert.AreEqual (subItemAText, item.SubItems [1].Text, "#A5");
  1254. item.SubItems.AddRange (new string [] { subItemBText, null, subItemCText });
  1255. Assert.AreEqual (4, item.SubItems.Count, "#B1");
  1256. Assert.IsNotNull (item.SubItems [0], "#B2");
  1257. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
  1258. Assert.IsNotNull (item.SubItems [1], "#B4");
  1259. Assert.AreSame (subItemAText, item.SubItems [1].Text, "#B5");
  1260. Assert.IsNotNull (item.SubItems [2], "#B6");
  1261. Assert.AreSame (subItemBText, item.SubItems [2].Text, "#B7");
  1262. Assert.IsNotNull (item.SubItems [3], "#B8");
  1263. Assert.AreSame (subItemCText, item.SubItems [3].Text, "#B9");
  1264. }
  1265. [Test]
  1266. public void AddRange2_Null ()
  1267. {
  1268. ListViewItem item = new ListViewItem ();
  1269. try {
  1270. item.SubItems.AddRange ((string []) null);
  1271. Assert.Fail ("#1");
  1272. } catch (ArgumentNullException ex) {
  1273. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  1274. Assert.IsNotNull (ex.Message, "#3");
  1275. Assert.IsNotNull (ex.ParamName, "#4");
  1276. Assert.AreEqual ("items", ex.ParamName, "#5");
  1277. Assert.IsNull (ex.InnerException, "#6");
  1278. }
  1279. }
  1280. [Test]
  1281. public void AddRange3 ()
  1282. {
  1283. string subItemAText = "A";
  1284. string subItemBText = "B";
  1285. string subItemCText = "B";
  1286. Font font = new Font ("Arial", 14);
  1287. ListViewItem item = new ListViewItem ();
  1288. item.SubItems.Add (subItemAText);
  1289. Assert.AreEqual (2, item.SubItems.Count, "#A1");
  1290. Assert.IsNotNull (item.SubItems [0], "#A2");
  1291. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
  1292. Assert.IsNotNull (item.SubItems [1], "#A4");
  1293. Assert.AreEqual (subItemAText, item.SubItems [1].Text, "#A5");
  1294. item.SubItems.AddRange (new string [] { subItemBText, null, subItemCText },
  1295. Color.Blue, Color.Red, font);
  1296. Assert.AreEqual (4, item.SubItems.Count, "#B1");
  1297. Assert.IsNotNull (item.SubItems [0], "#B2");
  1298. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
  1299. Assert.IsNotNull (item.SubItems [1], "#C1");
  1300. Assert.AreSame (subItemAText, item.SubItems [1].Text, "#C2");
  1301. Assert.IsNotNull (item.SubItems [2], "#D1");
  1302. Assert.AreSame (subItemBText, item.SubItems [2].Text, "#D2");
  1303. Assert.AreEqual (Color.Blue, item.SubItems [2].ForeColor, "#D3");
  1304. Assert.AreEqual (Color.Red, item.SubItems [2].BackColor, "#D4");
  1305. Assert.AreSame (font, item.SubItems [2].Font, "#D5");
  1306. Assert.IsNotNull (item.SubItems [3], "#E1");
  1307. Assert.AreSame (subItemCText, item.SubItems [3].Text, "#E2");
  1308. Assert.AreEqual (Color.Blue, item.SubItems [3].ForeColor, "#E3");
  1309. Assert.AreEqual (Color.Red, item.SubItems [3].BackColor, "#E4");
  1310. Assert.AreSame (font, item.SubItems [3].Font, "#E6");
  1311. }
  1312. [Test]
  1313. public void AddRange3_Items_Null ()
  1314. {
  1315. ListViewItem item = new ListViewItem ();
  1316. try {
  1317. item.SubItems.AddRange ((string []) null, Color.Blue, Color.Red,
  1318. new Font ("Arial", 14));
  1319. Assert.Fail ("#1");
  1320. } catch (ArgumentNullException ex) {
  1321. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  1322. Assert.IsNotNull (ex.Message, "#3");
  1323. Assert.IsNotNull (ex.ParamName, "#4");
  1324. Assert.AreEqual ("items", ex.ParamName, "#5");
  1325. Assert.IsNull (ex.InnerException, "#6");
  1326. }
  1327. }
  1328. [Test]
  1329. public void AddRange4 ()
  1330. {
  1331. ListViewItem item = new ListViewItem ();
  1332. Assert.AreEqual (1, item.SubItems.Count, "#1");
  1333. item.SubItems.AddRange (new string [3]);
  1334. Assert.AreEqual (1, item.SubItems.Count, "#2");
  1335. item.SubItems.AddRange (new ListViewItem.ListViewSubItem [3]);
  1336. Assert.AreEqual (1, item.SubItems.Count, "#3");
  1337. }
  1338. [Test]
  1339. public void Clear ()
  1340. {
  1341. ListViewItem item = new ListViewItem ();
  1342. item.SubItems.AddRange (new string [] { "A", "B", "C" });
  1343. item.SubItems.Clear ();
  1344. Assert.AreEqual (1, item.SubItems.Count, "#1");
  1345. Assert.IsNotNull (item.SubItems [0].Text, "#2");
  1346. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#3");
  1347. }
  1348. [Test]
  1349. public void RemoveAt ()
  1350. {
  1351. ListViewItem item = new ListViewItem ();
  1352. item.SubItems.AddRange (new string [] { "A", "B" });
  1353. Assert.AreEqual (3, item.SubItems.Count, "#A1");
  1354. Assert.IsNotNull (item.SubItems [0].Text, "#A2");
  1355. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#A3");
  1356. Assert.IsNotNull (item.SubItems [1].Text, "#A4");
  1357. Assert.AreEqual ("A", item.SubItems [1].Text, "#A5");
  1358. Assert.IsNotNull (item.SubItems [2].Text, "#A6");
  1359. Assert.AreEqual ("B", item.SubItems [2].Text, "#A7");
  1360. item.SubItems.RemoveAt (1);
  1361. Assert.AreEqual (2, item.SubItems.Count, "#B1");
  1362. Assert.IsNotNull (item.SubItems [0].Text, "#B2");
  1363. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#B3");
  1364. Assert.IsNotNull (item.SubItems [1].Text, "#B4");
  1365. Assert.AreEqual ("B", item.SubItems [1].Text, "#B5");
  1366. item.SubItems.RemoveAt (0);
  1367. Assert.AreEqual (1, item.SubItems.Count, "#C1");
  1368. Assert.IsNotNull (item.SubItems [0].Text, "#C2");
  1369. Assert.AreEqual ("B", item.SubItems [0].Text, "#C3");
  1370. item.SubItems.RemoveAt (0);
  1371. Assert.AreEqual (1, item.SubItems.Count, "#D1");
  1372. Assert.IsNotNull (item.SubItems [0].Text, "#D2");
  1373. Assert.AreEqual (string.Empty, item.SubItems [0].Text, "#D3");
  1374. }
  1375. }
  1376. }