Skip to content

Change Snippet in transactedinstaller.cs #3997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ If the '/?' or '/help' option is provided then the help information is
printed to the console.
*/

// <Snippet1>
using System;
using System.ComponentModel;
using System.Collections;
Expand All @@ -23,12 +24,9 @@ printed to the console.

public class TransactedInstaller_Example
{
// <Snippet2>
public static void Main(String[] args)
{
// <Snippet1>
// <Snippet2>
// <Snippet3>
// <Snippet4>
ArrayList myOptions = new ArrayList();
String myOption;
bool toUnInstall = false;
Expand Down Expand Up @@ -73,13 +71,13 @@ public static void Main(String[] args)
args[i]);
return;
}

// Create a instance of 'AssemblyInstaller' that installs the given assembly.
myAssemblyInstaller =
new AssemblyInstaller(args[i],
(string[]) myOptions.ToArray(typeof(string)));
// Add the instance of 'AssemblyInstaller' to the 'TransactedInstaller'.
myTransactedInstaller.Installers.Add(myAssemblyInstaller);
myTransactedInstaller.Installers.Add(myAssemblyInstaller);
}
}
// If user requested help or didn't provide any assemblies to install
Expand All @@ -105,13 +103,9 @@ public static void Main(String[] args)
catch(Exception e)
{
Console.WriteLine("\nException raised : {0}", e.Message);
}
// </Snippet4>
// </Snippet3>
// </Snippet2>
// </Snippet1>
}
}

public static void PrintHelpMessage()
{
Console.WriteLine("Usage : TransactedInstaller [/u | /uninstall] [option [...]] assembly" +
Expand All @@ -120,4 +114,5 @@ public static void PrintHelpMessage()
" the given assembly. If /u or /uninstall option" +
" is given it uninstalls the assemblies.");
}
}
}
// </Snippet1>