C# Класс SingleFileGenerator.InstallForm

Installer window designed to for Single-File Generators. This code works for *any* SFG defined in the assembly given to the constructor; it does not depend on LLLPG specifically and it will work without changes on any other assembly that contains SFGs.
NOTE: correct registration requires that this installer be run from an x86 executable. Although a program written in .NET for "AnyCPU" works in both 32-bit and 64-bit, we use the System.Runtime.InteropServices.RegistrationServices class to register the assembly with COM. Unfortunately, if the installer is built as AnyCPU, RegistrationServices will only register the module as 64-bit, not 32-bit. Since Visual Studio is 32-bit, it won't be able to find our SFG. To fix this problem, build the installer as "x86" (32-bit). An alternate solution would be to invoke the 32-bit version of the command-line tool regasm.exe /codebase. This may be installed at C:\Windows\Microsoft.NET\Framework\v4.0.30319 but this could vary by Windows version (and certainly varies by .NET version).
Наследование: System.Windows.Forms.Form
Показать файл Открыть проект

Открытые методы

Метод Описание
InstallForm ( Assembly sfgAssembly ) : System
RegisterSingleFileGenerators ( IMessageSink sink, Assembly assembly, RegistryKey rootKey, string generatorsKey, bool unregister = false ) : bool

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Clean up any resources being used.

OnLoad ( EventArgs e ) : void

Приватные методы

Метод Описание
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

InstallForm_Load ( object sender, EventArgs e ) : void
Main ( ) : void
MessageBoxWriter ( Severity type, object context, string msg, object args ) : void
PathForWow64 ( string path ) : string
RegisterOrUnregister ( IMessageSink sink, bool unregister ) : int
SetValue ( RegistryKey key, string name, object value ) : void
btnRegister_Click ( object sender, EventArgs e ) : void
btnUnregister_Click ( object sender, EventArgs e ) : void

Описание методов

Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Результат void

InstallForm() публичный Метод

public InstallForm ( Assembly sfgAssembly ) : System
sfgAssembly System.Reflection.Assembly
Результат System

OnLoad() защищенный Метод

protected OnLoad ( EventArgs e ) : void
e System.EventArgs
Результат void

RegisterSingleFileGenerators() публичный статический Метод

public static RegisterSingleFileGenerators ( IMessageSink sink, Assembly assembly, RegistryKey rootKey, string generatorsKey, bool unregister = false ) : bool
sink IMessageSink
assembly System.Reflection.Assembly
rootKey Microsoft.Win32.RegistryKey
generatorsKey string
unregister bool
Результат bool