This file contains hidden or 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
private void btnLoad_Click(object sender, EventArgs e) | |
{ | |
listView1.Items.Clear(); | |
var fileName = txtFileName.Text; | |
using (var fs = new FileStream(fileName, FileMode.Open)) | |
{ | |
var reader = XmlReader.Create(fs); | |
while (reader.Read()) | |
{ | |
if (reader.Name != "product") continue; |
This file contains hidden or 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
class ProductRepository : IProductRepository | |
{ | |
public IEnumerable<Product> GetByFileName(string fileName) | |
{ | |
var products = new List<Product>(); | |
using (var fs = new FileStream(fileName, FileMode.Open)) | |
{ | |
var reader = XmlReader.Create(fs); | |
while (reader.Read()) | |
{ |
This file contains hidden or 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
class FileLoader : IFileLoader | |
{ | |
public Stream Load(string fileName) | |
{ | |
return new FileStream(fileName, FileMode.Open); | |
} | |
} |
This file contains hidden or 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
class ProductRepository : IProductRepository | |
{ | |
private readonly IFileLoader loader; | |
private readonly IProductsMapper mapper; | |
public ProductRepository() | |
{ | |
loader = new FileLoader(); | |
mapper = new ProductsMapper(); | |
} |
This file contains hidden or 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
[TestFixture] | |
class FilterTest | |
{ | |
[Test] | |
public void filterByBlue_return_2() | |
{ | |
// arrange | |
ProductFilter filter = new ProductFilter(); | |
IList<Product> products = BuildProducts(); |
This file contains hidden or 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
[TestFixture] | |
class FilterTest | |
{ | |
[Test] | |
public void filterByBlue_return_2() | |
{ | |
// arrange | |
ProductFilter filter = new ProductFilter(); | |
IList<Product> products = BuildProducts(); |
This file contains hidden or 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
ready: function (element, options) { | |
backColor = options.item.BackColor; | |
var detailHeader = element.querySelector('#detailHeader'); | |
detailHeader.style.msGridColumns = '80px 1fr 325px;'; //'1fr 300px'; | |
detailHeader.style.backgroundColor = backColor; | |
backButton.className = "win-backbutton backbutton"; | |
var zoomIn = document.querySelector("#zoomIn"); |
This file contains hidden or 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
ready: function (element, options) { | |
currentSection = options.item; | |
setHeader(element, currentSection.BackColor); | |
setAppbarButton(currentSection); | |
this.updateLayout(element, Windows.UI.ViewManagement.ApplicationView.value); | |
buildNews(feedToShow); | |
}, |
This file contains hidden or 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
(function () { | |
"use strict"; | |
var feedNewsMapper; | |
// constructor function | |
function init() { | |
feedNewsMapper = new Mappers.FeedNewsMapper; | |
} |
This file contains hidden or 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
(function () { | |
"use strict"; | |
function pinByElementAsync(element, newTileID, newTileShortName, newTileDisplayName, tileActivationArguments) { | |
// Sometimes it's convenient to create our tile and pin it, all in a single asynchronous call. | |
// We're pinning a secondary tile, so let's build up the tile just like we did in pinByElement | |
var uriLogo = new Windows.Foundation.Uri("ms-appx:///images/30x30.png"); | |
//var uriSmallLogo = new Windows.Foundation.Uri("ms-appx:///images/pin/smallLogoSecondaryTile-sdk.png"); |
OlderNewer