Skip to content

Instantly share code, notes, and snippets.

View christiannagel's full-sized avatar
💭
working on the new book Pragmatic Microservices with C# and Azure

Christian Nagel christiannagel

💭
working on the new book Pragmatic Microservices with C# and Azure
View GitHub Profile
@christiannagel
christiannagel / Lambdas.cpp
Created April 5, 2013 08:09
C++11 Lambda 1
[] {
std::cout << "hello, lambda" << std::endl;
}();
@christiannagel
christiannagel / Program.cs
Created April 5, 2013 15:01
C# simple lambda expression
Action l1 = () => Console.WriteLine("Hello, Lambda!");
l1();
@christiannagel
christiannagel / Lambdas.cpp
Created April 5, 2013 15:35
C++11 lambda no return no parameter
auto l1 = [] {
std::cout << "hello, lambda" << std::endl;
};
l1();
@christiannagel
christiannagel / Program.cs
Created April 5, 2013 16:03
C# Lambda - returning a value
Func<int> l2 = () => 42;
int x2 = l2();
@christiannagel
christiannagel / Program.cs
Created April 5, 2013 16:06
C# Lambda returning a value
Func<int> l2b = () => { return 42; };
int x2b = l2b();
@christiannagel
christiannagel / Lambdas.cpp
Created April 5, 2013 19:38
C++11 lambda returning a value
auto l2 = [] {
return 42;
};
int x2 = l2();
private enum PageMode
{
NormalMode,
SelectionMode,
EditMode,
ProgressMode,
SelectionProgressMode
}
this.pageModeChanger = new VisualStateModeChanger<PageMode>(this);
@christiannagel
christiannagel / SampleDataGroup
Created August 24, 2013 07:47
Windows Store App - SampleDataGroup
public class SampleDataGroup
{
public SampleDataGroup(String uniqueId, String title, String subtitle, String imagePath, String description)
{
this.UniqueId = uniqueId;
this.Title = title;
this.Subtitle = subtitle;
this.Description = description;
this.ImagePath = imagePath;
this.Items = new ObservableCollection<SampleDataItem>();
@christiannagel
christiannagel / SampleDataItem
Created August 24, 2013 07:49
Windows Store App, Visual Studio Template Code, SampleDataItem
public class SampleDataItem
{
public SampleDataItem(String uniqueId, String title, String subtitle, String imagePath, String description, String content)
{
this.UniqueId = uniqueId;
this.Title = title;
this.Subtitle = subtitle;
this.Description = description;
this.ImagePath = imagePath;
this.Content = content;