@@ -93,7 +93,7 @@ public Assembly LoadAddinsToTempFolder(string originalFilePath, bool parsingOnly
9393
9494 private Assembly CopyAndLoadAddin ( string srcFilePath , bool onlyCopyRelated )
9595 {
96- var text = string . Empty ;
96+ var filePath = string . Empty ;
9797 if ( ! FileUtils . FileExistsInFolder ( srcFilePath , tempFolder ) )
9898 {
9999 var directoryName = Path . GetDirectoryName ( srcFilePath ) ;
@@ -102,8 +102,8 @@ private Assembly CopyAndLoadAddin(string srcFilePath, bool onlyCopyRelated)
102102 refedFolders . Add ( directoryName ) ;
103103 }
104104 var list = new List < FileInfo > ( ) ;
105- text = FileUtils . CopyFileToFolder ( srcFilePath , tempFolder , onlyCopyRelated , list ) ;
106- if ( string . IsNullOrEmpty ( text ) )
105+ filePath = FileUtils . CopyFileToFolder ( srcFilePath , tempFolder , onlyCopyRelated , list ) ;
106+ if ( string . IsNullOrEmpty ( filePath ) )
107107 {
108108 return null ;
109109 }
@@ -112,7 +112,7 @@ private Assembly CopyAndLoadAddin(string srcFilePath, bool onlyCopyRelated)
112112 copiedFiles . Add ( fileInfo . FullName , fileInfo . LastWriteTime ) ;
113113 }
114114 }
115- return LoadAddin ( text ) ;
115+ return LoadAddin ( filePath ) ;
116116 }
117117
118118 private Assembly LoadAddin ( string filePath )
@@ -135,47 +135,47 @@ private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs a
135135 {
136136 Assembly result ;
137137 new AssemblyName ( args . Name ) ;
138- var text = SearchAssemblyFileInTempFolder ( args . Name ) ;
139- if ( File . Exists ( text ) )
138+ var filePath = SearchAssemblyFileInTempFolder ( args . Name ) ;
139+ if ( File . Exists ( filePath ) )
140140 {
141- result = LoadAddin ( text ) ;
141+ result = LoadAddin ( filePath ) ;
142142 }
143143 else
144144 {
145- text = SearchAssemblyFileInOriginalFolders ( args . Name ) ;
146- if ( string . IsNullOrEmpty ( text ) )
145+ filePath = SearchAssemblyFileInOriginalFolders ( args . Name ) ;
146+ if ( string . IsNullOrEmpty ( filePath ) )
147147 {
148148 var array = args . Name . Split ( new char [ ]
149149 {
150150 ','
151151 } ) ;
152- var text2 = array [ 0 ] ;
152+ var ass = array [ 0 ] ;
153153 if ( array . Length > 1 )
154154 {
155155 var text3 = array [ 2 ] ;
156- if ( text2 . EndsWith ( ".resources" , StringComparison . CurrentCultureIgnoreCase ) && ! text3 . EndsWith ( "neutral" , StringComparison . CurrentCultureIgnoreCase ) )
156+ if ( ass . EndsWith ( ".resources" , StringComparison . CurrentCultureIgnoreCase ) && ! text3 . EndsWith ( "neutral" , StringComparison . CurrentCultureIgnoreCase ) )
157157 {
158- text2 = text2 . Substring ( 0 , text2 . Length - ".resources" . Length ) ;
158+ ass = ass . Substring ( 0 , ass . Length - ".resources" . Length ) ;
159159 }
160- text = SearchAssemblyFileInTempFolder ( text2 ) ;
161- if ( File . Exists ( text ) )
160+ filePath = SearchAssemblyFileInTempFolder ( ass ) ;
161+ if ( File . Exists ( filePath ) )
162162 {
163- return LoadAddin ( text ) ;
163+ return LoadAddin ( filePath ) ;
164164 }
165- text = SearchAssemblyFileInOriginalFolders ( text2 ) ;
165+ filePath = SearchAssemblyFileInOriginalFolders ( ass ) ;
166166 }
167167 }
168- if ( string . IsNullOrEmpty ( text ) )
168+ if ( string . IsNullOrEmpty ( filePath ) )
169169 {
170170 var loader = new AssemblyLoader ( args . Name ) ;
171171 loader . WindowStartupLocation = WindowStartupLocation . CenterScreen ;
172172 if ( loader . ShowDialog ( ) != true )
173173 {
174174 return null ;
175175 }
176- text = loader . resultPath ;
176+ filePath = loader . resultPath ;
177177 }
178- result = CopyAndLoadAddin ( text , true ) ;
178+ result = CopyAndLoadAddin ( filePath , true ) ;
179179 }
180180
181181 return result ;
@@ -186,16 +186,16 @@ private string SearchAssemblyFileInTempFolder(string assemName)
186186 try
187187 {
188188 var array = new string [ ] { ".dll" , ".exe" } ;
189- var text = string . Empty ;
189+ var filePath = string . Empty ;
190190 if ( string . IsNullOrEmpty ( assemName ) ) return String . Empty ;
191191 var str = assemName . Substring ( 0 , assemName . IndexOf ( ',' ) ) ;
192192 foreach ( var str2 in array )
193193 {
194- text = tempFolder + "\\ " + str + str2 ;
194+ filePath = tempFolder + "\\ " + str + str2 ;
195195
196- if ( File . Exists ( text ) )
196+ if ( File . Exists ( filePath ) )
197197 {
198- return text ;
198+ return filePath ;
199199 }
200200 }
201201 }
@@ -208,29 +208,29 @@ private string SearchAssemblyFileInTempFolder(string assemName)
208208
209209 private string SearchAssemblyFileInOriginalFolders ( string assemName )
210210 {
211- var array = new string [ ]
211+ var extensions = new string [ ]
212212 {
213213 ".dll" ,
214214 ".exe"
215215 } ;
216- string text ;
217- var text2 = assemName . Substring ( 0 , assemName . IndexOf ( ',' ) ) ;
218- foreach ( var str in array )
216+ string filePath ;
217+ var ass = assemName . Substring ( 0 , assemName . IndexOf ( ',' ) ) ;
218+ foreach ( var str in extensions )
219219 {
220- text = dotnetDir + "\\ " + text2 + str ;
221- if ( File . Exists ( text ) )
220+ filePath = dotnetDir + "\\ " + ass + str ;
221+ if ( File . Exists ( filePath ) )
222222 {
223- return text ;
223+ return filePath ;
224224 }
225225 }
226- foreach ( var str2 in array )
226+ foreach ( var ex in extensions )
227227 {
228- foreach ( var str3 in refedFolders )
228+ foreach ( var folder in refedFolders )
229229 {
230- text = str3 + "\\ " + text2 + str2 ;
231- if ( File . Exists ( text ) )
230+ filePath = folder + "\\ " + ass + ex ;
231+ if ( File . Exists ( filePath ) )
232232 {
233- return text ;
233+ return filePath ;
234234 }
235235 }
236236 }
@@ -240,11 +240,11 @@ private string SearchAssemblyFileInOriginalFolders(string assemName)
240240 var path = directoryInfo . Parent ? . FullName + "\\ Regression\\ _RegressionTools\\ " ;
241241 if ( Directory . Exists ( path ) )
242242 {
243- foreach ( var text3 in Directory . GetFiles ( path , "*.*" , SearchOption . AllDirectories ) )
243+ foreach ( var fileName in Directory . GetFiles ( path , "*.*" , SearchOption . AllDirectories ) )
244244 {
245- if ( Path . GetFileNameWithoutExtension ( text3 ) . Equals ( text2 , StringComparison . OrdinalIgnoreCase ) )
245+ if ( Path . GetFileNameWithoutExtension ( fileName ) . Equals ( ass , StringComparison . OrdinalIgnoreCase ) )
246246 {
247- return text3 ;
247+ return fileName ;
248248 }
249249 }
250250 }
0 commit comments