@@ -15,6 +15,7 @@ If the '/?' or '/help' option is provided then the help information is
15
15
printed to the console.
16
16
*/
17
17
18
+ // <Snippet1>
18
19
using System ;
19
20
using System . ComponentModel ;
20
21
using System . Collections ;
@@ -23,12 +24,9 @@ printed to the console.
23
24
24
25
public class TransactedInstaller_Example
25
26
{
27
+ // <Snippet2>
26
28
public static void Main ( String [ ] args )
27
29
{
28
- // <Snippet1>
29
- // <Snippet2>
30
- // <Snippet3>
31
- // <Snippet4>
32
30
ArrayList myOptions = new ArrayList ( ) ;
33
31
String myOption ;
34
32
bool toUnInstall = false ;
@@ -73,13 +71,13 @@ public static void Main(String[] args)
73
71
args [ i ] ) ;
74
72
return ;
75
73
}
76
-
74
+
77
75
// Create a instance of 'AssemblyInstaller' that installs the given assembly.
78
76
myAssemblyInstaller =
79
77
new AssemblyInstaller ( args [ i ] ,
80
78
( string [ ] ) myOptions . ToArray ( typeof ( string ) ) ) ;
81
79
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
82
- myTransactedInstaller . Installers . Add ( myAssemblyInstaller ) ;
80
+ myTransactedInstaller . Installers . Add ( myAssemblyInstaller ) ;
83
81
}
84
82
}
85
83
// If user requested help or didn't provide any assemblies to install
@@ -105,13 +103,9 @@ public static void Main(String[] args)
105
103
catch ( Exception e )
106
104
{
107
105
Console . WriteLine ( "\n Exception raised : {0}" , e . Message ) ;
108
- }
109
- // </Snippet4>
110
- // </Snippet3>
111
- // </Snippet2>
112
- // </Snippet1>
106
+ }
113
107
}
114
-
108
+
115
109
public static void PrintHelpMessage ( )
116
110
{
117
111
Console . WriteLine ( "Usage : TransactedInstaller [/u | /uninstall] [option [...]] assembly" +
@@ -120,4 +114,5 @@ public static void PrintHelpMessage()
120
114
" the given assembly. If /u or /uninstall option" +
121
115
" is given it uninstalls the assemblies." ) ;
122
116
}
123
- }
117
+ }
118
+ // </Snippet1>
0 commit comments