Created
February 1, 2014 12:06
-
-
Save urasandesu/8751409 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
| using System; | |
| using System.Prig; | |
| using System.Reflection; | |
| using Urasandesu.Prig.Framework; | |
| namespace program1 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("★入れ替え前: {0}", InternalToString()); | |
| using (new IndirectionsContext()) | |
| { | |
| PException.InternalToString.Body = () => "にゃんぱすー"; | |
| Console.WriteLine("★入れ替え中: {0}", InternalToString()); | |
| } | |
| Console.WriteLine("★戻し: {0}", InternalToString()); | |
| } | |
| static string InternalToString() | |
| { | |
| var e = new NotImplementedException(); | |
| var internalToStringInfo = typeof(NotImplementedException).GetMethod("InternalToString", BindingFlags.Instance | BindingFlags.NonPublic); | |
| return (string)internalToStringInfo.Invoke(e, new object[0]); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment