Last active
August 29, 2015 13:56
-
-
Save urasandesu/9166630 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace System | |
{ | |
public struct DateTime | |
{ | |
public static DateTime Now | |
{ | |
get | |
{ | |
// スタブでやっていたことの逆が挿入される。 | |
var holder = default(IndirectionHolder<IndirectionFunc<DateTime>>); | |
if (LooseCrossDomainAccessor.TryGet(out holder)) | |
{ | |
var info = new IndirectionInfo(); | |
info.AssemblyName = "mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; | |
info.Token = 0x060002D2; | |
var get_Now = default(IndirectionFunc<DateTime>); | |
if (holder.TryGet(info, out get_Now)) | |
{ | |
return get_Now(); | |
} | |
} | |
// 元の処理がそのままコピーされる。 | |
return DateTime.UtcNow.ToLocalTime(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment