private void Write69_DateFilter(string n, string ns, DateFilter 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(DateFilter)) { if (type != typeof(VirtualItemDateFilter)) { throw base.CreateUnknownTypeException(o); } this.Write99_VirtualItemDateFilter(n, ns, (VirtualItemDateFilter) o, isNullable, true); return; } } base.WriteStartElement(n, ns, o, false, null); if (needType) { base.WriteXsiType("DateFilter", ""); } base.WriteElementString("DateComparision", "", this.Write67_DateComparision(o.DateComparision)); if (o.NotOlderThan != 1) { base.WriteElementStringRaw("NotOlderThan", "", XmlConvert.ToString(o.NotOlderThan)); } if (o.DateMeasure != DateUnit.Day) { base.WriteElementString("DateMeasure", "", this.Write68_DateUnit(o.DateMeasure)); } base.WriteElementStringRaw("FromDate", "", XmlSerializationWriter.FromDate(o.FromDate)); base.WriteElementStringRaw("ToDate", "", XmlSerializationWriter.FromDate(o.ToDate)); base.WriteEndElement(o); } }
private void SetFilter(DateFilter filter) { base.CanRaiseFilterChanged = false; try { CustomFilterControl.PerformDropDownClick(this.tsddDateOperation, filter.DateComparision); this.tscbDateFrom.Tag = filter.FromDate; this.tscbDateFrom.Text = filter.FromDate.ToShortDateString(); this.tscbDateTo.Tag = filter.ToDate; this.tscbDateTo.Text = filter.ToDate.ToShortDateString(); this.tstbNotOlderThan.Tag = filter.NotOlderThan; this.tstbNotOlderThan.Text = filter.NotOlderThan.ToString(); CustomFilterControl.PerformDropDownClick(this.tsddDateUnit, filter.DateMeasure); } finally { base.CanRaiseFilterChanged = true; } }
private DateFilter Read69_DateFilter(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.id184_DateFilter) || (type.Namespace != this.id2_Item))) { if ((type.Name != this.id64_VirtualItemDateFilter) || (type.Namespace != this.id2_Item)) { throw base.CreateUnknownTypeException(type); } return this.Read99_VirtualItemDateFilter(isNullable, false); } if (flag) { return null; } DateFilter o = new DateFilter(); bool[] flagArray = new bool[5]; 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.id194_DateComparision)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.DateComparision = this.Read67_DateComparision(base.Reader.ReadElementString()); flagArray[0] = true; } else if ((!flagArray[1] && (base.Reader.LocalName == this.id195_NotOlderThan)) && (base.Reader.NamespaceURI == this.id2_Item)) { if (base.Reader.IsEmptyElement) { base.Reader.Skip(); } else { o.NotOlderThan = XmlConvert.ToInt32(base.Reader.ReadElementString()); } flagArray[1] = true; } else if ((!flagArray[2] && (base.Reader.LocalName == this.id196_DateMeasure)) && (base.Reader.NamespaceURI == this.id2_Item)) { if (base.Reader.IsEmptyElement) { base.Reader.Skip(); } else { o.DateMeasure = this.Read68_DateUnit(base.Reader.ReadElementString()); } flagArray[2] = true; } else if ((!flagArray[3] && (base.Reader.LocalName == this.id197_FromDate)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.FromDate = XmlSerializationReader.ToDate(base.Reader.ReadElementString()); flagArray[3] = true; } else if ((!flagArray[4] && (base.Reader.LocalName == this.id198_ToDate)) && (base.Reader.NamespaceURI == this.id2_Item)) { o.ToDate = XmlSerializationReader.ToDate(base.Reader.ReadElementString()); flagArray[4] = true; } else { base.UnknownNode(o, ":DateComparision, :NotOlderThan, :DateMeasure, :FromDate, :ToDate"); } } else { base.UnknownNode(o, ":DateComparision, :NotOlderThan, :DateMeasure, :FromDate, :ToDate"); } base.Reader.MoveToContent(); base.CheckReaderCount(ref whileIterations, ref readerCount); } base.ReadEndElement(); return o; }