如何从一个自定义路由事件中取消注册.
我有以下代码(自定义路由事件非常标准)
//Dispatch the Video Detection Movements
public delegate void MovementRoutedEventHandler( object sender
, MovementRoutedEventArgs e);
public class MovementRoutedEventArgs : RoutedEventArgs
{
private readonly DahuaDevice _device;
private readonly byte[] _canals;
private readonly DateTime _when;
public MovementRoutedEventArgs(DahuaDevice device, byte[] canals, DateTime when)
{
_device = device;
_canals = canals;
_when = when;
}
public DahuaDevice Device
{
get { return _device; }
}
public Byte[] Canals
{
get { return _canals; }
}
public DateTime When
{
get { return _when; …Run Code Online (Sandbox Code Playgroud) 我有一个“严格模式”Json 字符串,其中日期以“$date”为前缀
"DateCreated\":{\"$date\":1444835457460}
Run Code Online (Sandbox Code Playgroud)
我现在需要“mongo shell 模式”中的字符串,其中
"DateCreated" : ISODate("2015-10-14T15:10:57.460+0000")
Run Code Online (Sandbox Code Playgroud)
为了实现我使用的“严格模式”
.ToJson((new JsonWriterSettings { OutputMode = JsonOutputMode.Strict })
Run Code Online (Sandbox Code Playgroud)
要转换回“mongo shell 模式”,我尝试
.ToJson((new JsonWriterSettings { OutputMode = JsonOutputMode.Shell})
Run Code Online (Sandbox Code Playgroud)
不走运,字符串未转换并且 '$date' 仍然存在(我期待 ISODate ......)
任何的想法 ?