Updaing project types, adding test programs

This commit is contained in:
Andrew Forster
2016-12-12 10:34:28 -08:00
parent 73662ebf83
commit 38867679bb
91 changed files with 4005 additions and 130 deletions

View File

@@ -0,0 +1,47 @@
using Facebook.Yoga;
using System;
using System.Windows;
namespace Facebook.Yoga.App
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
this.Loaded += MainWindow_Loaded;
}
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
string result = "Success";
try
{
var node = new YogaNode();
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => MeasureOutput.Make(100f, 150f));
node.CalculateLayout();
if (Math.Abs(100f - node.LayoutWidth) > 0.01)
{
throw new Exception("Unexpected Width");
}
if (Math.Abs(150f - node.LayoutHeight) > 0.01)
{
throw new Exception("Unexpected Height");
}
}
catch (Exception ex)
{
result = ex.Message + Environment.NewLine + ex.StackTrace;
}
if (textBlock != null)
{
textBlock.Text = result;
}
}
}
}