public NameFilterControl(NameFilter filter)
 {
     this.components = null;
     if (filter == null)
     {
         throw new ArgumentNullException("filter");
     }
     this.InitializeComponent();
     this.InitializeToolStripItems();
     base.CanRaiseFilterChanged = false;
     CustomFilterControl.PerformDropDownClick(this.tsddNameCondition, filter.NameCondition);
     this.tstbMask.Text = filter.ToString();
     base.CanRaiseFilterChanged = true;
 }
 private void Write102_NameFilter(string n, string ns, NameFilter o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else
     {
         if (!needType)
         {
             System.Type type = o.GetType();
             if (type != typeof(NameFilter))
             {
                 if (type == typeof(VirtualItemFullNameFilter))
                 {
                     this.Write112_VirtualItemFullNameFilter(n, ns, (VirtualItemFullNameFilter) o, isNullable, true);
                     return;
                 }
                 if (type != typeof(VirtualItemNameFilter))
                 {
                     throw base.CreateUnknownTypeException(o);
                 }
                 this.Write103_VirtualItemNameFilter(n, ns, (VirtualItemNameFilter) o, isNullable, true);
                 return;
             }
         }
         base.WriteStartElement(n, ns, o, false, null);
         if (needType)
         {
             base.WriteXsiType("NameFilter", "");
         }
         if (o.NameCondition != NamePatternCondition.Equal)
         {
             base.WriteElementString("NameCondition", "", this.Write100_NamePatternCondition(o.NameCondition));
         }
         base.WriteElementString("NameComparision", "", this.Write101_NamePatternComparision(o.NameComparision));
         base.WriteElementString("NamePattern", "", o.NamePattern);
         base.WriteEndElement(o);
     }
 }
 private NameFilter Read102_NameFilter(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.id177_NameFilter) || (type.Namespace != this.id2_Item)))
     {
         if ((type.Name == this.id60_VirtualItemFullNameFilter) && (type.Namespace == this.id2_Item))
         {
             return this.Read112_VirtualItemFullNameFilter(isNullable, false);
         }
         if ((type.Name != this.id59_VirtualItemNameFilter) || (type.Namespace != this.id2_Item))
         {
             throw base.CreateUnknownTypeException(type);
         }
         return this.Read103_VirtualItemNameFilter(isNullable, false);
     }
     if (flag)
     {
         return null;
     }
     NameFilter o = new NameFilter();
     bool[] flagArray = new bool[3];
     while (base.Reader.MoveToNextAttribute())
     {
         if (!base.IsXmlnsAttribute(base.Reader.Name))
         {
             base.UnknownNode(o);
         }
     }
     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)
         {
             if ((!flagArray[0] && (base.Reader.LocalName == this.id228_NameCondition)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 if (base.Reader.IsEmptyElement)
                 {
                     base.Reader.Skip();
                 }
                 else
                 {
                     o.NameCondition = this.Read100_NamePatternCondition(base.Reader.ReadElementString());
                 }
                 flagArray[0] = true;
             }
             else if ((!flagArray[1] && (base.Reader.LocalName == this.id229_NameComparision)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.NameComparision = this.Read101_NamePatternComparision(base.Reader.ReadElementString());
                 flagArray[1] = true;
             }
             else if ((!flagArray[2] && (base.Reader.LocalName == this.id230_NamePattern)) && (base.Reader.NamespaceURI == this.id2_Item))
             {
                 o.NamePattern = base.Reader.ReadElementString();
                 flagArray[2] = true;
             }
             else
             {
                 base.UnknownNode(o, ":NameCondition, :NameComparision, :NamePattern");
             }
         }
         else
         {
             base.UnknownNode(o, ":NameCondition, :NameComparision, :NamePattern");
         }
         base.Reader.MoveToContent();
         base.CheckReaderCount(ref whileIterations, ref readerCount);
     }
     base.ReadEndElement();
     return o;
 }