-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lokale Kopien von ProvideToolboxControlAttribute.vb hinzugefügt
Verweise auf ProvideToolboxControlAttribute.vb in den Projektdateien AniGifControl.vbproj, DriveWatcherControl.vbproj, IniFileControl.vbproj, NotifyFormControl.vbproj, SevenSegmentControl.vbproj, ShapeControl.vbproj, TransparentLabelControl.vbproj und WizardControl.vbproj von einem gemeinsamen Speicherort entfernt und durch lokale Kopien ersetzt. Neue Diagrammdateien (.cd) wurden zu den Projektdateien hinzugefügt. In ProvideToolboxControlAttribute.vb wurden umfangreiche Änderungen vorgenommen, einschließlich der Implementierung der Klasse ProvideToolboxControlAttribute und der Hinzufügung von Kommentaren. Verweise auf ProvideToolboxControlAttribute.vb aus dem CommonCodes-Projekt in SchlumpfSoft Controls.sln entfernt. Nicht mehr benötigte Verweise auf Dokumentationsdateien (.md) in den Projektdateien ShapeControl.vbproj, TransparentLabelControl.vbproj und WizardControl.vbproj entfernt.
- Loading branch information
1 parent
5ce8e9a
commit 667bed9
Showing
18 changed files
with
947 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
' **************************************************************************************************************** | ||
' ProvideToolboxControlAttribute.vb | ||
' © 2024 by Andreas Sauer | ||
' **************************************************************************************************************** | ||
' | ||
|
||
Imports System | ||
Imports System.Collections.Generic | ||
Imports System.Globalization | ||
Imports System.Linq | ||
Imports System.Runtime.InteropServices | ||
Imports System.Text | ||
Imports Microsoft.VisualStudio.Shell | ||
|
||
''' <summary> | ||
''' Dieses Attribut fügt der Assembly einen Toolbox Controls Installer-Schlüssel hinzu, | ||
''' um Toolbox Controls aus der Assembly zu installieren. | ||
''' </summary> | ||
''' <remarks> | ||
''' Zum Beispiel: | ||
''' [$(Rootkey)\ToolboxControlsInstaller\$FullAssemblyName$] | ||
''' "Codebase"="$path$" | ||
''' "WpfControls"="1" | ||
''' </remarks> | ||
<AttributeUsage(AttributeTargets.Class, AllowMultiple:=False, Inherited:=True)> | ||
<System.Runtime.InteropServices.ComVisibleAttribute(False)> | ||
Public NotInheritable Class ProvideToolboxControlAttribute : Inherits RegistrationAttribute | ||
|
||
Private Const ToolboxControlsInstallerPath As String = "ToolboxControlsInstaller" | ||
Private _isWpfControls As Boolean | ||
Private _name As String | ||
|
||
''' <summary> | ||
''' Erstellt ein neues Attribut „Provide Toolbox Control“, um die Assembly für das | ||
''' Toolbox Controls-Installationsprogramm zu registrieren. | ||
''' </summary> | ||
''' <param name="isWpfControls"> | ||
''' </param> | ||
Public Sub New(name As String, isWpfControls As Boolean) | ||
|
||
If name Is Nothing Then | ||
Throw New ArgumentException("name") | ||
End If | ||
Me.Name = name | ||
Me.IsWpfControls = isWpfControls | ||
|
||
End Sub | ||
|
||
''' <summary> | ||
''' Ruft ab, ob die Toolbox-Steuerelemente für WPF gelten. | ||
''' </summary> | ||
Private Property IsWpfControls As Boolean | ||
Get | ||
Return Me._isWpfControls | ||
End Get | ||
Set(value As Boolean) | ||
Me._isWpfControls = value | ||
End Set | ||
End Property | ||
|
||
''' <summary> | ||
''' Ruft den Namen für die Steuerelemente ab. | ||
''' </summary> | ||
Private Property Name As String | ||
Get | ||
Return Me._name | ||
End Get | ||
Set(value As String) | ||
Me._name = value | ||
End Set | ||
End Property | ||
|
||
''' <summary> | ||
''' Wird aufgerufen, um dieses Attribut im angegebenen Kontext zu registrieren. | ||
''' Der Kontext enthält den Ort, an dem die Registrierungsinformationen | ||
''' platziert werden sollen. | ||
''' Es enthält auch andere Informationen wie den zu registrierenden Typ und Pfadinformationen. | ||
''' </summary> | ||
''' <param name="context"> | ||
''' Vorgegebener Kontext für die Registrierung. | ||
''' </param> | ||
Public Overrides Sub Register(context As RegistrationAttribute.RegistrationContext) | ||
|
||
If context Is Nothing Then | ||
Throw New ArgumentNullException("context") | ||
End If | ||
Using key As Key = context.CreateKey( | ||
String.Format( | ||
CultureInfo.InvariantCulture, | ||
"{0}\{1}", | ||
ToolboxControlsInstallerPath, | ||
context.ComponentType.Assembly.FullName)) | ||
|
||
key.SetValue(String.Empty, Me.Name) | ||
key.SetValue("Codebase", context.CodeBase) | ||
If Me.IsWpfControls Then | ||
key.SetValue("WPFControls", "1") | ||
End If | ||
|
||
End Using | ||
|
||
End Sub | ||
|
||
''' <summary> | ||
''' Wird aufgerufen, um die Registrierung dieses Attributs im angegebenen Kontext aufzuheben. | ||
''' </summary> | ||
''' <param name="context"> | ||
''' Ein Registrierungskontext, der von einem externen Registrierungstool bereitgestellt wird. | ||
''' Der Kontext kann verwendet werden, um Registrierungsschlüssel zu entfernen, | ||
''' Registrierungsaktivitäten zu protokollieren und Informationen | ||
''' über die registrierte Komponente abzurufen. | ||
''' </param> | ||
Public Overrides Sub Unregister(context As RegistrationAttribute.RegistrationContext) | ||
|
||
If context IsNot Nothing Then | ||
|
||
context.RemoveKey( | ||
String.Format( | ||
CultureInfo.InvariantCulture, | ||
"{0}\{1}", | ||
ToolboxControlsInstallerPath, | ||
context.ComponentType.Assembly.FullName)) | ||
|
||
End If | ||
|
||
End Sub | ||
|
||
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
' **************************************************************************************************************** | ||
' ProvideToolboxControlAttribute.vb | ||
' © 2024 by Andreas Sauer | ||
' **************************************************************************************************************** | ||
' | ||
|
||
Imports System | ||
Imports System.Collections.Generic | ||
Imports System.Globalization | ||
Imports System.Linq | ||
Imports System.Runtime.InteropServices | ||
Imports System.Text | ||
Imports Microsoft.VisualStudio.Shell | ||
|
||
''' <summary> | ||
''' Dieses Attribut fügt der Assembly einen Toolbox Controls Installer-Schlüssel hinzu, | ||
''' um Toolbox Controls aus der Assembly zu installieren. | ||
''' </summary> | ||
''' <remarks> | ||
''' Zum Beispiel: | ||
''' [$(Rootkey)\ToolboxControlsInstaller\$FullAssemblyName$] | ||
''' "Codebase"="$path$" | ||
''' "WpfControls"="1" | ||
''' </remarks> | ||
<AttributeUsage(AttributeTargets.Class, AllowMultiple:=False, Inherited:=True)> | ||
<System.Runtime.InteropServices.ComVisibleAttribute(False)> | ||
Public NotInheritable Class ProvideToolboxControlAttribute : Inherits RegistrationAttribute | ||
|
||
Private Const ToolboxControlsInstallerPath As String = "ToolboxControlsInstaller" | ||
Private _isWpfControls As Boolean | ||
Private _name As String | ||
|
||
''' <summary> | ||
''' Erstellt ein neues Attribut „Provide Toolbox Control“, um die Assembly für das | ||
''' Toolbox Controls-Installationsprogramm zu registrieren. | ||
''' </summary> | ||
''' <param name="isWpfControls"> | ||
''' </param> | ||
Public Sub New(name As String, isWpfControls As Boolean) | ||
|
||
If name Is Nothing Then | ||
Throw New ArgumentException("name") | ||
End If | ||
Me.Name = name | ||
Me.IsWpfControls = isWpfControls | ||
|
||
End Sub | ||
|
||
''' <summary> | ||
''' Ruft ab, ob die Toolbox-Steuerelemente für WPF gelten. | ||
''' </summary> | ||
Private Property IsWpfControls As Boolean | ||
Get | ||
Return Me._isWpfControls | ||
End Get | ||
Set(value As Boolean) | ||
Me._isWpfControls = value | ||
End Set | ||
End Property | ||
|
||
''' <summary> | ||
''' Ruft den Namen für die Steuerelemente ab. | ||
''' </summary> | ||
Private Property Name As String | ||
Get | ||
Return Me._name | ||
End Get | ||
Set(value As String) | ||
Me._name = value | ||
End Set | ||
End Property | ||
|
||
''' <summary> | ||
''' Wird aufgerufen, um dieses Attribut im angegebenen Kontext zu registrieren. | ||
''' Der Kontext enthält den Ort, an dem die Registrierungsinformationen | ||
''' platziert werden sollen. | ||
''' Es enthält auch andere Informationen wie den zu registrierenden Typ und Pfadinformationen. | ||
''' </summary> | ||
''' <param name="context"> | ||
''' Vorgegebener Kontext für die Registrierung. | ||
''' </param> | ||
Public Overrides Sub Register(context As RegistrationAttribute.RegistrationContext) | ||
|
||
If context Is Nothing Then | ||
Throw New ArgumentNullException("context") | ||
End If | ||
Using key As Key = context.CreateKey( | ||
String.Format( | ||
CultureInfo.InvariantCulture, | ||
"{0}\{1}", | ||
ToolboxControlsInstallerPath, | ||
context.ComponentType.Assembly.FullName)) | ||
|
||
key.SetValue(String.Empty, Me.Name) | ||
key.SetValue("Codebase", context.CodeBase) | ||
If Me.IsWpfControls Then | ||
key.SetValue("WPFControls", "1") | ||
End If | ||
|
||
End Using | ||
|
||
End Sub | ||
|
||
''' <summary> | ||
''' Wird aufgerufen, um die Registrierung dieses Attributs im angegebenen Kontext aufzuheben. | ||
''' </summary> | ||
''' <param name="context"> | ||
''' Ein Registrierungskontext, der von einem externen Registrierungstool bereitgestellt wird. | ||
''' Der Kontext kann verwendet werden, um Registrierungsschlüssel zu entfernen, | ||
''' Registrierungsaktivitäten zu protokollieren und Informationen | ||
''' über die registrierte Komponente abzurufen. | ||
''' </param> | ||
Public Overrides Sub Unregister(context As RegistrationAttribute.RegistrationContext) | ||
|
||
If context IsNot Nothing Then | ||
|
||
context.RemoveKey( | ||
String.Format( | ||
CultureInfo.InvariantCulture, | ||
"{0}\{1}", | ||
ToolboxControlsInstallerPath, | ||
context.ComponentType.Assembly.FullName)) | ||
|
||
End If | ||
|
||
End Sub | ||
|
||
End Class |
Oops, something went wrong.