-Build
This commit is contained in:
+1
-3
@@ -1,4 +1,2 @@
|
|||||||
cls
|
cls
|
||||||
powershell -Command "& { [Console]::WindowWidth = 150; [Console]::WindowHeight = 50; Start-Transcript runbuild.txt; Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake ..\Build\build.ps1 %*; Stop-Transcript; }"
|
powershell -Command "& { [Console]::WindowWidth = 150; [Console]::WindowHeight = 50; Start-Transcript runbuild.txt; Import-Module ..\Tools\PSake\psake.psm1; Invoke-psake ..\Build\build.ps1 %*; Stop-Transcript; }"
|
||||||
|
|
||||||
pause
|
|
||||||
@@ -246,5 +246,29 @@ namespace Newtonsoft.Json.Tests.Linq
|
|||||||
Uri i = o.Annotation<Uri>();
|
Uri i = o.Annotation<Uri>();
|
||||||
Assert.AreEqual(new Uri("http://www.google.com/"), i);
|
Assert.AreEqual(new Uri("http://www.google.com/"), i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Example()
|
||||||
|
{
|
||||||
|
JObject o = JObject.Parse(@"{
|
||||||
|
'name': 'Bill G',
|
||||||
|
'age': 58,
|
||||||
|
'country': 'United States',
|
||||||
|
'employer': 'Microsoft'
|
||||||
|
}");
|
||||||
|
|
||||||
|
o.AddAnnotation(new HashSet<string>());
|
||||||
|
o.PropertyChanged += (sender, args) => o.Annotation<HashSet<string>>().Add(args.PropertyName);
|
||||||
|
|
||||||
|
o["age"] = 59;
|
||||||
|
o["employer"] = "Bill & Melinda Gates Foundation";
|
||||||
|
|
||||||
|
|
||||||
|
HashSet<string> changedProperties = o.Annotation<HashSet<string>>();
|
||||||
|
// age
|
||||||
|
// employer
|
||||||
|
|
||||||
|
Assert.AreEqual(2, changedProperties.Count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user