| | | 1 | | // |
| | | 2 | | // Copyright 2010 Ekon Benefits |
| | | 3 | | // |
| | | 4 | | // Licensed under the Apache License, Version 2.0 (the "License"); |
| | | 5 | | // you may not use this file except in compliance with the License. |
| | | 6 | | // You may obtain a copy of the License at |
| | | 7 | | // |
| | | 8 | | // http://www.apache.org/licenses/LICENSE-2.0 |
| | | 9 | | // |
| | | 10 | | // Unless required by applicable law or agreed to in writing, software |
| | | 11 | | // distributed under the License is distributed on an "AS IS" BASIS, |
| | | 12 | | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | 13 | | // See the License for the specific language governing permissions and |
| | | 14 | | // limitations under the License. |
| | | 15 | | |
| | | 16 | | using System.IO; |
| | | 17 | | |
| | | 18 | | namespace ImpromptuInterface.Build |
| | | 19 | | { |
| | | 20 | | using System; |
| | | 21 | | using System.Reflection; |
| | | 22 | | using System.Reflection.Emit; |
| | | 23 | | |
| | | 24 | | |
| | | 25 | | #if NETFRAMEWORK |
| | | 26 | | internal static class CompatHelper |
| | | 27 | | { |
| | | 28 | | public static Type GetTypeInfo(this Type type) => type; |
| | | 29 | | |
| | | 30 | | public static Type CreateTypeInfo(this TypeBuilder builder) => builder.CreateType(); |
| | | 31 | | |
| | | 32 | | public static AssemblyBuilder DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) => AppDomai |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | #else |
| | | 36 | | internal static class CompatHelper |
| | | 37 | | { |
| | | 38 | | public static AssemblyBuilder DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access) => Assembly |
| | | 39 | | |
| | | 40 | | } |
| | | 41 | | |
| | | 42 | | #endif |
| | | 43 | | |
| | | 44 | | ///<summary> |
| | | 45 | | /// Does most of the work buiding and caching proxies |
| | | 46 | | ///</summary> |
| | | 47 | | public static class BuildProxy |
| | | 48 | | { |
| | | 49 | | public static ActLikeMaker DefaultProxyMaker { get; } = new ActLikeMaker(); |
| | | 50 | | |
| | 1 | 51 | | public static ActLikeMaker CollectableProxyMaker() => new ActLikeMaker(AssemblyBuilderAccess.RunAndCollect); |
| | | 52 | | |
| | | 53 | | #if NETFRAMEWORK |
| | | 54 | | public static SaveableActLikeMaker SaveableProxyMaker(string assemblyName = null) => new SaveableActLikeMaker(As |
| | | 55 | | #endif |
| | | 56 | | } |
| | | 57 | | |
| | | 58 | | |
| | | 59 | | } |