This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Linq; | |
namespace OCP.Filter.Model | |
{ | |
class ProductFilter | |
{ | |
public IEnumerable<Product> ByCriteria(IList<Product> products, ICriteria criteria) | |
{ | |
foreach (var product in products) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal class MyFileReader | |
{ | |
public void ReadFile(string fileName, Action<string, string, string, string> callback) | |
{ | |
using (var fs = new FileStream(fileName, FileMode.Open)) | |
{ | |
var reader = XmlReader.Create(fs); | |
while (reader.Read()) | |
{ | |
if (reader.Name != "product") continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void btnBrowse_Click(object sender, EventArgs e) | |
{ | |
openFileDialog1.Filter = "XML Document (*.xml)|*.xml|All Files (*.*)|*.*"; |