27
27
using System ;
28
28
using System . ComponentModel ;
29
29
using System . IO ;
30
+ using System . Linq ;
30
31
using System . Reflection ;
31
32
using System . Threading ;
32
33
@@ -43,8 +44,6 @@ public partial class ExcelAdapter : BHoMAdapter
43
44
[ Output ( "adapter" , "Adapter to Excel." ) ]
44
45
public ExcelAdapter ( BH . oM . Adapter . FileSettings fileSettings = null )
45
46
{
46
- AppDomain . CurrentDomain . AssemblyResolve += new ResolveEventHandler ( PackagingAssemblyResolve ) ;
47
-
48
47
if ( fileSettings == null )
49
48
{
50
49
BH . Engine . Base . Compute . RecordError ( "Please set the File Settings to enable the Excel Adapter to work correctly." ) ;
@@ -67,8 +66,6 @@ public ExcelAdapter(BH.oM.Adapter.FileSettings fileSettings = null)
67
66
[ Output ( "outputStream" , "Defines the content of the new Excel file. This will be generated on a push and is not required for a pull." ) ]
68
67
public ExcelAdapter ( Stream inputStream , Stream outputStream = null )
69
68
{
70
- AppDomain . CurrentDomain . AssemblyResolve += new ResolveEventHandler ( PackagingAssemblyResolve ) ;
71
-
72
69
if ( inputStream == null )
73
70
{
74
71
BH . Engine . Base . Compute . RecordError ( "Please set the Stream for the template to enable the Excel Adapter to work correctly." ) ;
@@ -80,24 +77,6 @@ public ExcelAdapter(Stream inputStream, Stream outputStream = null)
80
77
}
81
78
82
79
83
- /***************************************************/
84
- /**** Private Methods ****/
85
- /***************************************************/
86
-
87
- private Assembly PackagingAssemblyResolve ( object sender , ResolveEventArgs args )
88
- {
89
- string [ ] split = args . Name . Split ( ',' ) ;
90
- if ( split . Length > 1 )
91
- {
92
- string assemblyPath = Path . Combine ( BH . Engine . Base . Query . BHoMFolder ( ) , $ "{ split [ 0 ] } .dll") ;
93
- if ( File . Exists ( assemblyPath ) )
94
- return Assembly . LoadFrom ( assemblyPath ) ;
95
- }
96
-
97
- return null ;
98
- }
99
-
100
-
101
80
/***************************************************/
102
81
/**** Override Methods ****/
103
82
/***************************************************/
0 commit comments