internal static void SerializeFilterRecord(FileStream fs, OverviewFilter overviewFilter) { // Construct a BinaryFormatter and use it to serialize the data to the stream. BinaryFormatter formatter = new BinaryFormatter(); try { formatter.Serialize(fs, overviewFilter); } catch (SerializationException e) { Helper.Log("Error", "Failed to serialize. Reason: " + e.Message); throw; } }
private void dgViewFilters_CellClick(object sender, DataGridViewCellEventArgs e) { if (dgViewFilters.Columns[e.ColumnIndex].DataPropertyName == "CompareKind") { //toggle the comparison kind OverviewFilter ovFilter = ((OverviewFilter)dgViewFilters.Rows[e.RowIndex].DataBoundItem); if (ovFilter.CompareKind == Comparison.GreaterThan) { ovFilter.CompareKind = Comparison.LessThan; } else { ovFilter.CompareKind = Comparison.GreaterThan; } } }