private void Write17_ListViewColumnInfo(string n, string ns, ListViewColumnInfo o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType && (o.GetType() != typeof(ListViewColumnInfo)))
         {
             throw base.CreateUnknownTypeException(o);
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("ListViewColumnInfo", "");
         }
         if (o.DefaultWidth != -1)
         {
             base.WriteAttribute("DefaultWidth", "", XmlConvert.ToString(o.DefaultWidth));
         }
         if (o.DisplayIndex != -1)
         {
             base.WriteAttribute("DisplayIndex", "", XmlConvert.ToString(o.DisplayIndex));
         }
         if (o.TextAlign != HorizontalAlignment.Left)
         {
             base.WriteAttribute("TextAlign", "", this.Write16_HorizontalAlignment(o.TextAlign));
         }
         if (o.Width != 0x48)
         {
             base.WriteAttribute("Width", "", XmlConvert.ToString(o.Width));
         }
         if (o.Visible)
         {
             base.WriteAttribute("Visible", "", XmlConvert.ToString(o.Visible));
         }
         base.WriteAttribute("Property", "", o.PropertyStr);
         base.WriteEndElement(o);
     }
 }
 private void PopulateColumnItems()
 {
     this.lvItems.ItemChecked -= new ItemCheckedEventHandler(this.lvItems_ItemChecked);
     this.lvItems.BeginUpdate();
     try
     {
         this.lvItems.Groups.Clear();
         this.lvItems.Items.Clear();
         this.GroupMap.Clear();
         this.lvItems.Groups.Add("grpVisible", Resources.sGroupVisible);
         foreach (VirtualProperty property in (IEnumerable<VirtualProperty>) VirtualProperty.Visible)
         {
             ListViewColumnInfo info;
             ListViewGroup group;
             ListViewItem item = new ListViewItem(property.LocalizedName);
             if (!this.ColumnInfoMap.TryGetValue(property.PropertyId, out info))
             {
                 info = new ListViewColumnInfo(property.PropertyId, VirtualFilePanelSettings.DefaultColumnWidth(property.PropertyId, this.lvItems.Font), false);
             }
             item.SubItems.Add(info.Width.ToString());
             item.Checked = info.Visible || (property.PropertyId == 0);
             item.Tag = info;
             if (!this.GroupMap.TryGetValue(property.GroupId, out group))
             {
                 group = new ListViewGroup(property.LocalizedGroupName);
                 this.lvItems.Groups.Add(group);
                 this.GroupMap.Add(property.GroupId, group);
             }
             item.Group = item.Checked ? this.lvItems.Groups[0] : group;
             item.ImageIndex = (int) info.TextAlign;
             if (!this.AvailableProperties[property.PropertyId])
             {
                 item.ForeColor = SystemColors.GrayText;
             }
             this.lvItems.Items.Add(item);
         }
         this.lvItems.Sort(new ListViewColumnInfoComparer());
         this.UpdateItemsListView();
     }
     finally
     {
         this.lvItems.ItemChecked += new ItemCheckedEventHandler(this.lvItems_ItemChecked);
         this.lvItems.EndUpdate();
     }
 }
 private ListViewColumnInfo Read17_ListViewColumnInfo(bool isNullable, bool checkType)
 {
     XmlQualifiedName type = checkType ? base.GetXsiType() : null;
     bool flag = false;
     if (isNullable)
     {
         flag = base.ReadNull();
     }
     if ((checkType && (type != null)) && ((type.Name != this.id11_ListViewColumnInfo) || (type.Namespace != this.id2_Item)))
     {
         throw base.CreateUnknownTypeException(type);
     }
     if (flag)
     {
         return null;
     }
     ListViewColumnInfo o = new ListViewColumnInfo();
     bool[] flagArray = new bool[6];
     while (base.Reader.MoveToNextAttribute())
     {
         if ((!flagArray[0] && (base.Reader.LocalName == this.id248_DefaultWidth)) && (base.Reader.NamespaceURI == this.id2_Item))
         {
             o.DefaultWidth = XmlConvert.ToInt32(base.Reader.Value);
             flagArray[0] = true;
         }
         else
         {
             if ((!flagArray[1] && (base.Reader.LocalName == this.id249_DisplayIndex)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.DisplayIndex = XmlConvert.ToInt32(base.Reader.Value);
                 flagArray[1] = true;
                 continue;
             }
             if ((!flagArray[2] && (base.Reader.LocalName == this.id250_TextAlign)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.TextAlign = this.Read16_HorizontalAlignment(base.Reader.Value);
                 flagArray[2] = true;
                 continue;
             }
             if ((!flagArray[3] && (base.Reader.LocalName == this.id251_Width)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.Width = XmlConvert.ToInt32(base.Reader.Value);
                 flagArray[3] = true;
                 continue;
             }
             if ((!flagArray[4] && (base.Reader.LocalName == this.id252_Visible)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.Visible = XmlConvert.ToBoolean(base.Reader.Value);
                 flagArray[4] = true;
                 continue;
             }
             if ((!flagArray[5] && (base.Reader.LocalName == this.id253_Property)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.PropertyStr = base.Reader.Value;
                 flagArray[5] = true;
                 continue;
             }
             if (!base.IsXmlnsAttribute(base.Reader.Name))
             {
                 base.UnknownNode(o, ":DefaultWidth, :DisplayIndex, :TextAlign, :Width, :Visible, :Property");
             }
         }
     }
     base.Reader.MoveToElement();
     if (base.Reader.IsEmptyElement)
     {
         base.Reader.Skip();
         return o;
     }
     base.Reader.ReadStartElement();
     base.Reader.MoveToContent();
     int whileIterations = 0;
     int readerCount = base.ReaderCount;
     while ((base.Reader.NodeType != XmlNodeType.EndElement) && (base.Reader.NodeType != XmlNodeType.None))
     {
         if (base.Reader.NodeType == XmlNodeType.Element)
         {
             base.UnknownNode(o, "");
         }
         else
         {
             base.UnknownNode(o, "");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }