'Imports System.Text.RegularExpressions

'Imports Stax.UI

'Public Class FileAssociationsForm
'    Inherits Form

'#Region " Designer "

'    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
'        If disposing Then
'            If Not (components Is Nothing) Then
'                components.Dispose()
'            End If
'        End If
'        MyBase.Dispose(disposing)
'    End Sub
'    Friend WithEvents bClose As System.Windows.Forms.Button
'    Friend WithEvents bAddContextMenu As System.Windows.Forms.Button
'    Friend WithEvents bAddAssociation As System.Windows.Forms.Button
'    Friend WithEvents bRemove As System.Windows.Forms.Button
'    Friend WithEvents tbAssoc As System.Windows.Forms.TextBox
'    Friend WithEvents GroupBox3 As System.Windows.Forms.GroupBox
'    Friend WithEvents ValidationProvider As Stax.UI.ValidationProvider
'    Friend WithEvents SmartTagProvider As Stax.UI.Design.SmartTagProvider
'    Friend WithEvents lFileExtension As System.Windows.Forms.Label

'    Private components As System.ComponentModel.IContainer

'    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'        Me.bClose = New System.Windows.Forms.Button
'        Me.bAddContextMenu = New System.Windows.Forms.Button
'        Me.bAddAssociation = New System.Windows.Forms.Button
'        Me.bRemove = New System.Windows.Forms.Button
'        Me.tbAssoc = New System.Windows.Forms.TextBox
'        Me.GroupBox3 = New System.Windows.Forms.GroupBox
'        Me.SmartTagProvider = New Stax.UI.Design.SmartTagProvider
'        Me.ValidationProvider = New Stax.UI.ValidationProvider
'        Me.lFileExtension = New System.Windows.Forms.Label
'        Me.GroupBox3.SuspendLayout()
'        Me.SuspendLayout()
'        '
'        'bClose
'        '
'        Me.bClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
'        Me.bClose.DialogResult = System.Windows.Forms.DialogResult.Cancel
'        Me.bClose.Location = New System.Drawing.Point(178, 168)
'        Me.bClose.Name = "bClose"
'        Me.bClose.Size = New System.Drawing.Size(75, 24)
'        Me.bClose.TabIndex = 1
'        Me.bClose.Text = "Close"
'        '
'        'bAddContextMenu
'        '
'        Me.bAddContextMenu.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
'                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
'        Me.bAddContextMenu.Location = New System.Drawing.Point(6, 69)
'        Me.bAddContextMenu.Name = "bAddContextMenu"
'        Me.bAddContextMenu.Size = New System.Drawing.Size(229, 24)
'        Me.bAddContextMenu.TabIndex = 1
'        Me.bAddContextMenu.Text = "Add Context Menu"
'        '
'        'bAddAssociation
'        '
'        Me.bAddAssociation.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
'                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
'        Me.bAddAssociation.Location = New System.Drawing.Point(6, 39)
'        Me.bAddAssociation.Name = "bAddAssociation"
'        Me.bAddAssociation.Size = New System.Drawing.Size(229, 24)
'        Me.bAddAssociation.TabIndex = 0
'        Me.bAddAssociation.Text = "Add Association"
'        '
'        'bRemove
'        '
'        Me.bRemove.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
'                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
'        Me.bRemove.Location = New System.Drawing.Point(6, 99)
'        Me.bRemove.Name = "bRemove"
'        Me.bRemove.Size = New System.Drawing.Size(229, 24)
'        Me.bRemove.TabIndex = 3
'        Me.bRemove.Text = "Remove"
'        '
'        'tbAssoc
'        '
'        Me.tbAssoc.Location = New System.Drawing.Point(94, 13)
'        Me.tbAssoc.Name = "tbAssoc"
'        Me.ValidationProvider.SetPattern(Me.tbAssoc, "^[a-z0-9]+$")
'        Me.tbAssoc.Size = New System.Drawing.Size(54, 20)
'        Me.tbAssoc.TabIndex = 6
'        Me.tbAssoc.TextAlign = System.Windows.Forms.HorizontalAlignment.Center
'        '
'        'GroupBox3
'        '
'        Me.GroupBox3.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
'                    Or System.Windows.Forms.AnchorStyles.Left) _
'                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
'        Me.GroupBox3.Controls.Add(Me.lFileExtension)
'        Me.GroupBox3.Controls.Add(Me.bAddContextMenu)
'        Me.GroupBox3.Controls.Add(Me.bRemove)
'        Me.GroupBox3.Controls.Add(Me.tbAssoc)
'        Me.GroupBox3.Controls.Add(Me.bAddAssociation)
'        Me.GroupBox3.Location = New System.Drawing.Point(12, 13)
'        Me.GroupBox3.Name = "GroupBox3"
'        Me.GroupBox3.Size = New System.Drawing.Size(241, 149)
'        Me.GroupBox3.TabIndex = 7
'        Me.GroupBox3.TabStop = False
'        '
'        'lFileExtension
'        '
'        Me.lFileExtension.AutoSize = True
'        Me.lFileExtension.Location = New System.Drawing.Point(17, 16)
'        Me.lFileExtension.Name = "lFileExtension"
'        Me.lFileExtension.Size = New System.Drawing.Size(71, 13)
'        Me.lFileExtension.TabIndex = 7
'        Me.lFileExtension.Text = "File Extension:"
'        '
'        'FileAssociationsForm
'        '
'        Me.ClientSize = New System.Drawing.Size(265, 204)
'        Me.Controls.Add(Me.GroupBox3)
'        Me.Controls.Add(Me.bClose)
'        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
'        Me.HelpButton = True
'        Me.MaximizeBox = False
'        Me.MinimizeBox = False
'        Me.Name = "FileAssociationsForm"
'        Me.ShowIcon = False
'        Me.ShowInTaskbar = False
'        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
'        Me.Text = "File Associations"
'        Me.GroupBox3.ResumeLayout(False)
'        Me.GroupBox3.PerformLayout()
'        Me.ResumeLayout(False)

'    End Sub

'#End Region

'    Public Sub New()
'        MyBase.New()
'        InitializeComponent()
'        UpdateControls()
'    End Sub

'    Private Sub bAddAssociation_Click(ByVal sender As Object, ByVal e As EventArgs) Handles bAddAssociation.Click
'        RegistryHelp.SetAssociation(tbAssoc.Text)
'        ButtonHelp.ShowBold(bAddAssociation)
'    End Sub

'    Private Sub bAddContextMenu_Click(ByVal sender As Object, ByVal e As EventArgs) Handles bAddContextMenu.Click
'        RegistryHelp.SetContextMenu(tbAssoc.Text)
'        ButtonHelp.ShowBold(bAddContextMenu)
'    End Sub

'    Private Sub bRemove_Click(ByVal sender As Object, ByVal e As EventArgs) Handles bRemove.Click
'        RegistryHelp.SetContextMenu(tbAssoc.Text)
'        ButtonHelp.ShowBold(bRemove)
'    End Sub

'    Private Sub tbAssoc_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles tbAssoc.TextChanged
'        UpdateControls()
'    End Sub

'    Private Sub UpdateControls()
'        Dim m As Match = Regex.Match(tbAssoc.Text, "^[a-z0-9]+$")

'        bAddAssociation.Enabled = m.Success
'        bAddContextMenu.Enabled = m.Success
'        bRemove.Enabled = m.Success
'    End Sub

'    Private Sub bAddAssociation_HelpRequested(ByVal sender As Object, ByVal hlpevent As HelpEventArgs) Handles bAddAssociation.HelpRequested
'        Process.Start("http://en.wikipedia.org/wiki/File_association")
'    End Sub

'    Private Sub bRemove_HelpRequested(ByVal sender As Object, ByVal hlpevent As HelpEventArgs) Handles bRemove.HelpRequested
'        Process.Start("http://en.wikipedia.org/wiki/File_association")
'    End Sub

'    Private Sub bAddContextMenu_HelpRequested(ByVal sender As Object, ByVal hlpevent As HelpEventArgs) Handles bAddContextMenu.HelpRequested
'        Process.Start("http://en.wikipedia.org/wiki/Context_menu")
'    End Sub
'End Class