private static List <FilterParams> ReadFilter(XmlElement startNode) { List <FilterParams> filterList = new List <FilterParams>(); XmlNode filtersNode = startNode.SelectSingleNode("filters"); if (filtersNode != null) { XmlNodeList filterNodeList = filtersNode.ChildNodes; // all "filter" nodes foreach (XmlNode node in filterNodeList) { foreach (XmlNode subNode in node.ChildNodes) { if (subNode.Name.Equals("params")) { string base64Text = subNode.InnerText; byte[] data = System.Convert.FromBase64String(base64Text); BinaryFormatter formatter = new BinaryFormatter(); MemoryStream stream = new MemoryStream(data); FilterParams filterParams = (FilterParams)formatter.Deserialize(stream); filterParams.Init(); filterList.Add(filterParams); } } } } return(filterList); }
public FilterParams CreateCopy2() { FilterParams newParams = CreateCopy(); newParams.Init(); // removed cloning of columnizer for filtering, because this causes issues with columnizers that hold internal states (like CsvColumnizer) // newParams.currentColumnizer = Util.CloneColumnizer(this.currentColumnizer); newParams.currentColumnizer = this.currentColumnizer; return(newParams); }