File tree 2 files changed +5
-32
lines changed
docs/samples/Microsoft.ML.Samples
2 files changed +5
-32
lines changed Original file line number Diff line number Diff line change 4
4
<TargetFramework >netcoreapp2.1</TargetFramework >
5
5
<OutputType >Exe</OutputType >
6
6
<SignAssembly >false</SignAssembly >
7
+ <!-- This ensures that we can never make the mistake of adding this as a friend assembly. Please don't remove.-->
7
8
<PublicSign >false</PublicSign >
8
9
<RootNamespace >Samples</RootNamespace >
9
- <StartupObject >Microsoft.ML.Samples.Program</StartupObject >
10
+ <StartupObject >Microsoft.ML.Samples.Program</StartupObject >
10
11
</PropertyGroup >
11
12
12
13
<ItemGroup >
Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Reflection ;
3
- using Samples . Dynamic ;
1
+ using System . Reflection ;
4
2
5
3
namespace Microsoft . ML . Samples
6
4
{
7
5
public static class Program
8
6
{
9
- public static void Main ( string [ ] args )
10
- {
11
- CalculateFeatureContribution . Example ( ) ;
12
-
13
- if ( args . Length > 0 && args [ 0 ] == "-runall" )
14
- RunAll ( ) ;
15
- }
7
+ public static void Main ( string [ ] args ) => RunAll ( ) ;
16
8
17
9
internal static void RunAll ( )
18
10
{
19
11
foreach ( var type in Assembly . GetExecutingAssembly ( ) . GetTypes ( ) )
20
- {
21
- var method = type . GetMethod ( "Example" , BindingFlags . NonPublic | BindingFlags . Public
22
- | BindingFlags . Static | BindingFlags . FlattenHierarchy ) ;
23
-
24
- if ( method != null )
25
- {
26
- try
27
- {
28
- method . Invoke ( null , null ) ;
29
- }
30
- catch ( Exception ex )
31
- {
32
- // Print the exception for debugging.
33
- Console . Write ( type ) ;
34
- Console . Write ( ex ) ;
35
-
36
- // Throw to fail.
37
- throw ex ;
38
- }
39
- }
40
- }
12
+ type . GetMethod ( "Example" , BindingFlags . Public | BindingFlags . Static | BindingFlags . FlattenHierarchy ) ? . Invoke ( null , null ) ;
41
13
}
42
14
}
43
15
}
You can’t perform that action at this time.
0 commit comments