Skip to content

Instantly share code, notes, and snippets.

@urasandesu
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save urasandesu/9070203 to your computer and use it in GitHub Desktop.

Select an option

Save urasandesu/9070203 to your computer and use it in GitHub Desktop.
using Urasandesu.Prig.Framework;
[assembly: Indirectable(0x060002D2)]
namespace System.Prig
{
public class PDateTime
{
public class NowGet
{
NowGet() { }
Func<bool> m_predicate;
public static NowGet When(Func<bool> predicate)
{
return new NowGet() { m_predicate = predicate };
}
public IndirectionFunc<DateTime> Body
{
set
{
var info = new IndirectionInfo();
info.AssemblyName = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
info.Token = 0x060002D2;
var holder = LooseCrossDomainAccessor.GetOrRegister<IndirectionHolder<IndirectionFunc<IndirectionFunc<DateTime>>>>();
holder.AddOrUpdate(info, () => m_predicate() ? value : null);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment