Option Strict Off Option Explicit On Friend Class EnvForm Inherits System.Windows.Forms.Form #Region "Windows Form Designer generated code " Public Sub New() MyBase.New() If m_vb6FormDefInstance Is Nothing Then If m_InitializingDefInstance Then m_vb6FormDefInstance = Me Else Try 'For the start-up form, the first instance created is the default instance. If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then m_vb6FormDefInstance = Me End If Catch End Try End If End If 'This call is required by the Windows Form Designer. InitializeComponent() End Sub 'Form overrides dispose to clean up the component list. 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 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer Public ToolTip1 As System.Windows.Forms.ToolTip Public WithEvents cmdUpdate As System.Windows.Forms.Button Public WithEvents txtUser As System.Windows.Forms.TextBox Public WithEvents txtPassword As System.Windows.Forms.TextBox Public WithEvents txtLanguage As System.Windows.Forms.TextBox Public WithEvents txtHost As System.Windows.Forms.TextBox Public WithEvents txtCwd As System.Windows.Forms.TextBox Public WithEvents txtCharset As System.Windows.Forms.TextBox Public WithEvents txtClient As System.Windows.Forms.TextBox Public WithEvents txtPort As System.Windows.Forms.TextBox Public WithEvents cmdClose As System.Windows.Forms.Button Public WithEvents _Label2_7 As System.Windows.Forms.Label Public WithEvents _Label2_6 As System.Windows.Forms.Label Public WithEvents _Label2_5 As System.Windows.Forms.Label Public WithEvents _Label2_4 As System.Windows.Forms.Label Public WithEvents _Label2_3 As System.Windows.Forms.Label Public WithEvents _Label2_2 As System.Windows.Forms.Label Public WithEvents _Label2_1 As System.Windows.Forms.Label Public WithEvents _Label2_0 As System.Windows.Forms.Label Public WithEvents Label2 As Microsoft.VisualBasic.Compatibility.VB6.LabelArray 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.cmdUpdate = New System.Windows.Forms.Button() Me.txtUser = New System.Windows.Forms.TextBox() Me.txtPassword = New System.Windows.Forms.TextBox() Me.txtLanguage = New System.Windows.Forms.TextBox() Me.txtHost = New System.Windows.Forms.TextBox() Me.txtCwd = New System.Windows.Forms.TextBox() Me.txtCharset = New System.Windows.Forms.TextBox() Me.txtClient = New System.Windows.Forms.TextBox() Me.txtPort = New System.Windows.Forms.TextBox() Me.cmdClose = New System.Windows.Forms.Button() Me._Label2_7 = New System.Windows.Forms.Label() Me._Label2_6 = New System.Windows.Forms.Label() Me._Label2_5 = New System.Windows.Forms.Label() Me._Label2_4 = New System.Windows.Forms.Label() Me._Label2_3 = New System.Windows.Forms.Label() Me._Label2_2 = New System.Windows.Forms.Label() Me._Label2_1 = New System.Windows.Forms.Label() Me._Label2_0 = New System.Windows.Forms.Label() Me.Label2 = New Microsoft.VisualBasic.Compatibility.VB6.LabelArray(Me.components) CType(Me.Label2, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'cmdUpdate ' Me.cmdUpdate.BackColor = System.Drawing.SystemColors.Control Me.cmdUpdate.Cursor = System.Windows.Forms.Cursors.Default Me.cmdUpdate.ForeColor = System.Drawing.SystemColors.ControlText Me.cmdUpdate.Location = New System.Drawing.Point(160, 280) Me.cmdUpdate.Name = "cmdUpdate" Me.cmdUpdate.RightToLeft = System.Windows.Forms.RightToLeft.No Me.cmdUpdate.Size = New System.Drawing.Size(97, 33) Me.cmdUpdate.TabIndex = 17 Me.cmdUpdate.Text = "&Update" ' 'txtUser ' Me.txtUser.AcceptsReturn = True Me.txtUser.AutoSize = False Me.txtUser.BackColor = System.Drawing.SystemColors.Window Me.txtUser.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtUser.ForeColor = System.Drawing.SystemColors.WindowText Me.txtUser.Location = New System.Drawing.Point(96, 240) Me.txtUser.MaxLength = 0 Me.txtUser.Name = "txtUser" Me.txtUser.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtUser.Size = New System.Drawing.Size(289, 25) Me.txtUser.TabIndex = 9 Me.txtUser.Text = "" ' 'txtPassword ' Me.txtPassword.AcceptsReturn = True Me.txtPassword.AutoSize = False Me.txtPassword.BackColor = System.Drawing.SystemColors.Window Me.txtPassword.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtPassword.ForeColor = System.Drawing.SystemColors.WindowText Me.txtPassword.Location = New System.Drawing.Point(96, 208) Me.txtPassword.MaxLength = 0 Me.txtPassword.Name = "txtPassword" Me.txtPassword.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtPassword.Size = New System.Drawing.Size(289, 25) Me.txtPassword.TabIndex = 8 Me.txtPassword.Text = "" ' 'txtLanguage ' Me.txtLanguage.AcceptsReturn = True Me.txtLanguage.AutoSize = False Me.txtLanguage.BackColor = System.Drawing.SystemColors.Window Me.txtLanguage.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtLanguage.ForeColor = System.Drawing.SystemColors.WindowText Me.txtLanguage.Location = New System.Drawing.Point(96, 176) Me.txtLanguage.MaxLength = 0 Me.txtLanguage.Name = "txtLanguage" Me.txtLanguage.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtLanguage.Size = New System.Drawing.Size(289, 25) Me.txtLanguage.TabIndex = 7 Me.txtLanguage.Text = "" ' 'txtHost ' Me.txtHost.AcceptsReturn = True Me.txtHost.AutoSize = False Me.txtHost.BackColor = System.Drawing.SystemColors.Window Me.txtHost.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtHost.ForeColor = System.Drawing.SystemColors.WindowText Me.txtHost.Location = New System.Drawing.Point(96, 144) Me.txtHost.MaxLength = 0 Me.txtHost.Name = "txtHost" Me.txtHost.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtHost.Size = New System.Drawing.Size(289, 25) Me.txtHost.TabIndex = 6 Me.txtHost.Text = "" ' 'txtCwd ' Me.txtCwd.AcceptsReturn = True Me.txtCwd.AutoSize = False Me.txtCwd.BackColor = System.Drawing.SystemColors.Window Me.txtCwd.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtCwd.ForeColor = System.Drawing.SystemColors.WindowText Me.txtCwd.Location = New System.Drawing.Point(96, 112) Me.txtCwd.MaxLength = 0 Me.txtCwd.Name = "txtCwd" Me.txtCwd.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtCwd.Size = New System.Drawing.Size(289, 25) Me.txtCwd.TabIndex = 5 Me.txtCwd.Text = "" ' 'txtCharset ' Me.txtCharset.AcceptsReturn = True Me.txtCharset.AutoSize = False Me.txtCharset.BackColor = System.Drawing.SystemColors.Window Me.txtCharset.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtCharset.ForeColor = System.Drawing.SystemColors.WindowText Me.txtCharset.Location = New System.Drawing.Point(96, 80) Me.txtCharset.MaxLength = 0 Me.txtCharset.Name = "txtCharset" Me.txtCharset.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtCharset.Size = New System.Drawing.Size(289, 25) Me.txtCharset.TabIndex = 4 Me.txtCharset.Text = "" ' 'txtClient ' Me.txtClient.AcceptsReturn = True Me.txtClient.AutoSize = False Me.txtClient.BackColor = System.Drawing.SystemColors.Window Me.txtClient.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtClient.ForeColor = System.Drawing.SystemColors.WindowText Me.txtClient.Location = New System.Drawing.Point(96, 48) Me.txtClient.MaxLength = 0 Me.txtClient.Name = "txtClient" Me.txtClient.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtClient.Size = New System.Drawing.Size(289, 25) Me.txtClient.TabIndex = 3 Me.txtClient.Text = "" ' 'txtPort ' Me.txtPort.AcceptsReturn = True Me.txtPort.AutoSize = False Me.txtPort.BackColor = System.Drawing.SystemColors.Window Me.txtPort.Cursor = System.Windows.Forms.Cursors.IBeam Me.txtPort.ForeColor = System.Drawing.SystemColors.WindowText Me.txtPort.Location = New System.Drawing.Point(96, 16) Me.txtPort.MaxLength = 0 Me.txtPort.Name = "txtPort" Me.txtPort.RightToLeft = System.Windows.Forms.RightToLeft.No Me.txtPort.Size = New System.Drawing.Size(289, 25) Me.txtPort.TabIndex = 1 Me.txtPort.Text = "" ' 'cmdClose ' Me.cmdClose.BackColor = System.Drawing.SystemColors.Control Me.cmdClose.Cursor = System.Windows.Forms.Cursors.Default Me.cmdClose.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.cmdClose.ForeColor = System.Drawing.SystemColors.ControlText Me.cmdClose.Location = New System.Drawing.Point(272, 280) Me.cmdClose.Name = "cmdClose" Me.cmdClose.RightToLeft = System.Windows.Forms.RightToLeft.No Me.cmdClose.Size = New System.Drawing.Size(97, 33) Me.cmdClose.TabIndex = 0 Me.cmdClose.Text = "Close" ' '_Label2_7 ' Me._Label2_7.BackColor = System.Drawing.SystemColors.Control Me._Label2_7.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_7.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_7, CType(7, Short)) Me._Label2_7.Location = New System.Drawing.Point(24, 240) Me._Label2_7.Name = "_Label2_7" Me._Label2_7.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_7.Size = New System.Drawing.Size(65, 25) Me._Label2_7.TabIndex = 16 Me._Label2_7.Text = "User:" Me._Label2_7.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_6 ' Me._Label2_6.BackColor = System.Drawing.SystemColors.Control Me._Label2_6.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_6.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_6, CType(6, Short)) Me._Label2_6.Location = New System.Drawing.Point(24, 208) Me._Label2_6.Name = "_Label2_6" Me._Label2_6.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_6.Size = New System.Drawing.Size(65, 25) Me._Label2_6.TabIndex = 15 Me._Label2_6.Text = "Password:" Me._Label2_6.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_5 ' Me._Label2_5.BackColor = System.Drawing.SystemColors.Control Me._Label2_5.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_5.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_5, CType(5, Short)) Me._Label2_5.Location = New System.Drawing.Point(24, 176) Me._Label2_5.Name = "_Label2_5" Me._Label2_5.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_5.Size = New System.Drawing.Size(65, 25) Me._Label2_5.TabIndex = 14 Me._Label2_5.Text = "Language:" Me._Label2_5.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_4 ' Me._Label2_4.BackColor = System.Drawing.SystemColors.Control Me._Label2_4.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_4.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_4, CType(4, Short)) Me._Label2_4.Location = New System.Drawing.Point(24, 144) Me._Label2_4.Name = "_Label2_4" Me._Label2_4.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_4.Size = New System.Drawing.Size(65, 25) Me._Label2_4.TabIndex = 13 Me._Label2_4.Text = "Host:" Me._Label2_4.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_3 ' Me._Label2_3.BackColor = System.Drawing.SystemColors.Control Me._Label2_3.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_3.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_3, CType(3, Short)) Me._Label2_3.Location = New System.Drawing.Point(24, 112) Me._Label2_3.Name = "_Label2_3" Me._Label2_3.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_3.Size = New System.Drawing.Size(65, 25) Me._Label2_3.TabIndex = 12 Me._Label2_3.Text = "Cwd:" Me._Label2_3.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_2 ' Me._Label2_2.BackColor = System.Drawing.SystemColors.Control Me._Label2_2.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_2.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_2, CType(2, Short)) Me._Label2_2.Location = New System.Drawing.Point(24, 80) Me._Label2_2.Name = "_Label2_2" Me._Label2_2.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_2.Size = New System.Drawing.Size(65, 25) Me._Label2_2.TabIndex = 11 Me._Label2_2.Text = "Charset:" Me._Label2_2.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_1 ' Me._Label2_1.BackColor = System.Drawing.SystemColors.Control Me._Label2_1.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_1.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_1, CType(1, Short)) Me._Label2_1.Location = New System.Drawing.Point(24, 48) Me._Label2_1.Name = "_Label2_1" Me._Label2_1.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_1.Size = New System.Drawing.Size(65, 25) Me._Label2_1.TabIndex = 10 Me._Label2_1.Text = "Client:" Me._Label2_1.TextAlign = System.Drawing.ContentAlignment.TopRight ' '_Label2_0 ' Me._Label2_0.BackColor = System.Drawing.SystemColors.Control Me._Label2_0.Cursor = System.Windows.Forms.Cursors.Default Me._Label2_0.ForeColor = System.Drawing.SystemColors.ControlText Me.Label2.SetIndex(Me._Label2_0, CType(0, Short)) Me._Label2_0.Location = New System.Drawing.Point(24, 16) Me._Label2_0.Name = "_Label2_0" Me._Label2_0.RightToLeft = System.Windows.Forms.RightToLeft.No Me._Label2_0.Size = New System.Drawing.Size(65, 25) Me._Label2_0.TabIndex = 2 Me._Label2_0.Text = "Port:" Me._Label2_0.TextAlign = System.Drawing.ContentAlignment.TopRight ' 'EnvForm ' Me.AcceptButton = Me.cmdClose Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.CancelButton = Me.cmdClose Me.ClientSize = New System.Drawing.Size(499, 319) Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdUpdate, Me.txtUser, Me.txtPassword, Me.txtLanguage, Me.txtHost, Me.txtCwd, Me.txtCharset, Me.txtClient, Me.txtPort, Me.cmdClose, Me._Label2_7, Me._Label2_6, Me._Label2_5, Me._Label2_4, Me._Label2_3, Me._Label2_2, Me._Label2_1, Me._Label2_0}) Me.Location = New System.Drawing.Point(4, 30) Me.Name = "EnvForm" Me.Text = "p4 Environment" CType(Me.Label2, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region #Region "Upgrade Support " Private Shared m_vb6FormDefInstance As EnvForm Private Shared m_InitializingDefInstance As Boolean Public Shared Property DefInstance() As EnvForm Get If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then m_InitializingDefInstance = True m_vb6FormDefInstance = New EnvForm() m_InitializingDefInstance = False End If DefInstance = m_vb6FormDefInstance End Get Set m_vb6FormDefInstance = Value End Set End Property #End Region '******************************************************************************* ' ' Copyright (c) 2003, Robert Cowham and Vaccaperna Systems Ltd. All rights reserved. ' ' Redistribution and use in source and binary forms, with or without ' modification, are permitted provided that the following conditions are met: ' ' 1. Redistributions of source code must retain the above copyright ' notice, this list of conditions and the following disclaimer. ' ' 2. Redistributions in binary form must reproduce the above copyright ' notice, this list of conditions and the following disclaimer in the ' documentation and/or other materials provided with the distribution. ' ' THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ' IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ' ARE DISCLAIMED. IN NO EVENT SHALL VACCAPERNA SYSTEMS LTD. BE LIABLE FOR ANY ' DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ' (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ' LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ' ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ' (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ' SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ' ' ******************************************************************************* ' ' Name: EnvForm.frm ' ' Author: Robert Cowham ' ' Description: ' Show and update environment. ' No error handling! ' ****************************************************************************** Dim m_p4 As P4COM.p4 Public Sub ShowEnv(ByRef p As P4COM.p4) m_p4 = p txtCharset.Text = m_p4.Charset txtClient.Text = m_p4.Client txtCwd.Text = m_p4.Cwd txtHost.Text = m_p4.Host txtLanguage.Text = m_p4.Language txtPassword.Text = m_p4.Password txtPort.Text = m_p4.Port txtUser.Text = m_p4.User Me.ShowDialog() End Sub Private Sub cmdClose_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdClose.Click Me.Close() End Sub Private Sub cmdUpdate_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdUpdate.Click m_p4.Charset = txtCharset.Text m_p4.Client = txtClient.Text m_p4.Cwd = txtCwd.Text m_p4.Host = txtHost.Text m_p4.Language = txtLanguage.Text m_p4.Password = txtPassword.Text m_p4.Port = txtPort.Text m_p4.User = txtUser.Text Me.Close() End Sub End Class