- Timestamp:
- 03/28/12 15:47:26 (12 years ago)
- Location:
- branches/HeuristicLab.Hive.Azure
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive.Azure
- Property svn:ignore
-
old new 3 3 *.resharper 4 4 *.suo 5 *.user 5 6 *.vsp 6 7 Doxygen 8 FxCopResults.txt 7 9 Google.ProtocolBuffers-0.9.1.dll 8 10 HeuristicLab 3.3.5.1.ReSharper.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HeuristicLab.Hive.Azure/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj
r6866 r7669 102 102 </PropertyGroup> 103 103 <ItemGroup> 104 <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL" /> 104 <Reference Include="ICSharpCode.SharpZipLib, Version=0.85.4.369, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL"> 105 <Private>False</Private> 106 </Reference> 105 107 <Reference Include="System" /> 106 108 <Reference Include="System.Core"> … … 309 311 <ItemGroup> 310 312 <Content Include="ICSharpCode.SharpZipLib License.txt"> 311 <CopyToOutputDirectory> PreserveNewest</CopyToOutputDirectory>313 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 312 314 </Content> 313 315 <Content Include="ICSharpCode.SharpZipLib.dll"> 314 <CopyToOutputDirectory> PreserveNewest</CopyToOutputDirectory>316 <CopyToOutputDirectory>Always</CopyToOutputDirectory> 315 317 </Content> 316 318 <EmbeddedResource Include="Advanced\DeploymentService\services.heuristiclab.com.cer" /> -
branches/HeuristicLab.Hive.Azure/HeuristicLab.PluginInfrastructure/3.3/LightweightApplicationManager.cs
r7270 r7669 75 75 foreach (Type t in GetTypes(type)) { 76 76 object instance = null; 77 try { instance = Activator.CreateInstance(t); } 78 catch { } 77 try { instance = Activator.CreateInstance(t); } catch { } 79 78 if (instance != null) instances.Add(instance); 80 79 } … … 124 123 private static IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable = true, bool includeGenericTypeDefinitions = false) { 125 124 try { 125 // necessary to make sure the exception is immediately thrown 126 // instead of later when the enumerable is iterated? 126 127 var assemblyTypes = assembly.GetTypes(); 127 128 128 var buildTypes = from t in assemblyTypes 129 var buildTypes = from t in assembly.GetTypes() 130 where CheckTypeCompatibility(type, t) 129 131 where !IsNonDiscoverableType(t) 130 where CheckTypeCompatibility(type, t)131 where onlyInstantiable == false ||(!t.IsAbstract && !t.IsInterface && !t.HasElementType)132 where onlyInstantiable == false || 133 (!t.IsAbstract && !t.IsInterface && !t.HasElementType) 132 134 select BuildType(t, type); 133 135 … … 135 137 where includeGenericTypeDefinitions || !t.IsGenericTypeDefinition 136 138 select t; 137 } 138 catch (TypeLoadException) { 139 } catch (TypeLoadException) { 139 140 return Enumerable.Empty<Type>(); 140 } 141 catch (ReflectionTypeLoadException) { 141 } catch (ReflectionTypeLoadException) { 142 142 return Enumerable.Empty<Type>(); 143 143 } … … 152 152 return true; 153 153 if (type.IsGenericType && other.IsGenericType) { 154 var otherGenericArguments = other.GetGenericArguments(); 155 var typeGenericArguments = type.GetGenericArguments(); 156 157 //check type arguments count 158 if (otherGenericArguments.Length != typeGenericArguments.Length) 159 return false; 160 161 //check type arguments & constraints 162 int i = 0; 163 foreach (var genericArgument in typeGenericArguments) { 164 if (otherGenericArguments[i].IsGenericParameter) { 165 foreach (var constraint in otherGenericArguments[i].GetGenericParameterConstraints()) 166 if (!constraint.IsAssignableFrom(genericArgument)) return false; 167 } else if (genericArgument != otherGenericArguments[i]) return false; 168 i++; 169 } 170 //check types 154 171 try { 155 if (type.IsAssignableFrom(other.GetGenericTypeDefinition().MakeGenericType(type.GetGenericArguments()))) 172 var otherGenericTypeDefinition = other.GetGenericTypeDefinition(); 173 if (type.IsAssignableFrom(otherGenericTypeDefinition.MakeGenericType(typeGenericArguments))) 156 174 return true; 157 } 158 catch (Exception) { } 175 } catch (Exception) { } 159 176 } 160 177 return false; -
branches/HeuristicLab.Hive.Azure/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs
r7270 r7669 235 235 PluginDescription pluginDesc = (PluginDescription)pluginDescription; 236 236 return from asm in AppDomain.CurrentDomain.GetAssemblies() 237 where ! IsDynamicAssembly(asm)237 where !asm.IsDynamic && !string.IsNullOrEmpty(asm.Location) 238 238 where pluginDesc.AssemblyLocations.Any(location => location.Equals(Path.GetFullPath(asm.Location), StringComparison.CurrentCultureIgnoreCase)) 239 239 from t in GetTypes(type, asm, onlyInstantiable, includeGenericTypeDefinitions) … … 249 249 } 250 250 return result; 251 }252 253 private static bool IsDynamicAssembly(Assembly asm) {254 return (asm is System.Reflection.Emit.AssemblyBuilder) || string.IsNullOrEmpty(asm.Location);255 251 } 256 252 … … 266 262 private static IEnumerable<Type> GetTypes(Type type, Assembly assembly, bool onlyInstantiable, bool includeGenericTypeDefinitions) { 267 263 var buildTypes = from t in assembly.GetTypes() 264 where CheckTypeCompatibility(type, t) 268 265 where !IsNonDiscoverableType(t) 269 where CheckTypeCompatibility(type, t)270 266 where onlyInstantiable == false || 271 267 (!t.IsAbstract && !t.IsInterface && !t.HasElementType) … … 286 282 return true; 287 283 if (type.IsGenericType && other.IsGenericType) { 284 var otherGenericArguments = other.GetGenericArguments(); 285 var typeGenericArguments = type.GetGenericArguments(); 286 287 //check type arguments count 288 if (otherGenericArguments.Length != typeGenericArguments.Length) 289 return false; 290 291 //check type arguments & constraints 292 int i = 0; 293 foreach (var genericArgument in typeGenericArguments) { 294 if (otherGenericArguments[i].IsGenericParameter) { 295 foreach (var constraint in otherGenericArguments[i].GetGenericParameterConstraints()) 296 if (!constraint.IsAssignableFrom(genericArgument)) return false; 297 } else if (genericArgument != otherGenericArguments[i]) return false; 298 i++; 299 } 300 //check types 288 301 try { 289 if (type.IsAssignableFrom(other.GetGenericTypeDefinition().MakeGenericType(type.GetGenericArguments()))) 302 var otherGenericTypeDefinition = other.GetGenericTypeDefinition(); 303 if (type.IsAssignableFrom(otherGenericTypeDefinition.MakeGenericType(typeGenericArguments))) 290 304 return true; 291 305 } -
branches/HeuristicLab.Hive.Azure/HeuristicLab.PluginInfrastructure/3.3/app.config
r4495 r7669 35 35 maxBufferPoolSize="524288" maxReceivedMessageSize="200000000" messageEncoding="Text" 36 36 textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 37 <readerQuotas maxDepth="32" maxStringContentLength=" 32000" maxArrayLength="200000000"37 <readerQuotas maxDepth="32" maxStringContentLength="200000000" maxArrayLength="200000000" 38 38 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 39 39 <reliableSession ordered="true" inactivityTimeout="00:10:00" … … 52 52 maxBufferPoolSize="524288" maxReceivedMessageSize="200000000" messageEncoding="Text" 53 53 textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 54 <readerQuotas maxDepth="32" maxStringContentLength=" 32000" maxArrayLength="200000000"54 <readerQuotas maxDepth="32" maxStringContentLength="200000000" maxArrayLength="200000000" 55 55 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 56 56 <reliableSession ordered="true" inactivityTimeout="00:10:00"
Note: See TracChangeset
for help on using the changeset viewer.