You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

191 lines
9.5 KiB

Imports System.Xml
Imports System.Data
Public Class MainForm
Inherits System.Windows.Forms.Form
#Region " Vom Windows Form Designer generierter Code "
Public Sub New()
MyBase.New()
' Dieser Aufruf ist für den Windows Form-Designer erforderlich.
InitializeComponent()
' Initialisierungen nach dem Aufruf InitializeComponent() hinzufügen
End Sub
' Die Form überschreibt den Löschvorgang der Basisklasse, um Komponenten zu bereinigen.
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
' Für Windows Form-Designer erforderlich
Private components As System.ComponentModel.IContainer
'HINWEIS: Die folgende Prozedur ist für den Windows Form-Designer erforderlich
'Sie kann mit dem Windows Form-Designer modifiziert werden.
'Verwenden Sie nicht den Code-Editor zur Bearbeitung.
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents grdFile As C1.Win.C1TrueDBGrid.C1TrueDBGrid
Friend WithEvents txtFilePath As System.Windows.Forms.TextBox
Friend WithEvents cmdBrowse As System.Windows.Forms.Button
Friend WithEvents openFileDialog As System.Windows.Forms.OpenFileDialog
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MainForm))
Dim GridLines1 As C1.Win.C1TrueDBGrid.Util.GridLines = New C1.Win.C1TrueDBGrid.Util.GridLines
Me.grdFile = New C1.Win.C1TrueDBGrid.C1TrueDBGrid
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.txtFilePath = New System.Windows.Forms.TextBox
Me.cmdBrowse = New System.Windows.Forms.Button
Me.openFileDialog = New System.Windows.Forms.OpenFileDialog
CType(Me.grdFile, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'grdFile
'
Me.grdFile.AllowFilter = True
Me.grdFile.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.AllRows
Me.grdFile.AllowSort = True
Me.grdFile.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.grdFile.CaptionHeight = 17
Me.grdFile.CollapseColor = System.Drawing.Color.Black
Me.grdFile.DataChanged = False
Me.grdFile.DeadAreaBackColor = System.Drawing.Color.Empty
Me.grdFile.ExpandColor = System.Drawing.Color.Black
Me.grdFile.FilterBar = True
Me.grdFile.GroupByCaption = "Drag a column header here to group by that column"
Me.grdFile.Images.Add(CType(resources.GetObject("resource"), System.Drawing.Image))
Me.grdFile.Location = New System.Drawing.Point(40, 112)
Me.grdFile.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder
Me.grdFile.Name = "grdFile"
Me.grdFile.PreviewInfo.Location = New System.Drawing.Point(0, 0)
Me.grdFile.PreviewInfo.Size = New System.Drawing.Size(0, 0)
Me.grdFile.PreviewInfo.ZoomFactor = 75
Me.grdFile.PrintInfo.ShowOptionsDialog = False
Me.grdFile.RecordSelectorWidth = 17
GridLines1.Color = System.Drawing.Color.DarkGray
GridLines1.Style = C1.Win.C1TrueDBGrid.LineStyleEnum.Single
Me.grdFile.RowDivider = GridLines1
Me.grdFile.RowHeight = 15
Me.grdFile.RowSubDividerColor = System.Drawing.Color.DarkGray
Me.grdFile.ScrollTips = False
Me.grdFile.Size = New System.Drawing.Size(528, 368)
Me.grdFile.TabIndex = 0
Me.grdFile.Text = "C1TrueDBGrid1"
Me.grdFile.PropBag = "<?xml version=""1.0""?><Blob><Styles type=""C1.Win.C1TrueDBGrid.Design.ContextWrappe" & _
"r""><Data>Group{AlignVert:Center;Border:None,,0, 0, 0, 0;BackColor:ControlDark;}E" & _
"ditor{}Style2{}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{" & _
"ForeColor:HighlightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:Inactive" & _
"CaptionText;BackColor:InactiveCaption;}FilterBar{}Footer{}Caption{AlignHorz:Cent" & _
"er;}Normal{}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style1{}Od" & _
"dRow{}RecordSelector{AlignImage:Center;}Heading{Wrap:True;BackColor:Control;Bord" & _
"er:Raised,,1, 1, 1, 1;ForeColor:ControlText;AlignVert:Center;}Style8{}Style10{Al" & _
"ignHorz:Near;}Style11{}Style12{}Style13{}Style9{}</Data></Styles><Splits><C1.Win" & _
".C1TrueDBGrid.MergeView Name="""" CaptionHeight=""17"" ColumnCaptionHeight=""17"" Colu" & _
"mnFooterHeight=""17"" FilterBar=""True"" MarqueeStyle=""DottedCellBorder"" RecordSelec" & _
"torWidth=""17"" DefRecSelWidth=""17"" VerticalScrollGroup=""1"" HorizontalScrollGroup=" & _
"""1""><ClientRect>0, 0, 524, 364</ClientRect><BorderSide>0</BorderSide><CaptionSty" & _
"le parent=""Style2"" me=""Style10"" /><EditorStyle parent=""Editor"" me=""Style5"" /><Ev" & _
"enRowStyle parent=""EvenRow"" me=""Style8"" /><FilterBarStyle parent=""FilterBar"" me=" & _
"""Style13"" /><FooterStyle parent=""Footer"" me=""Style3"" /><GroupStyle parent=""Group" & _
""" me=""Style12"" /><HeadingStyle parent=""Heading"" me=""Style2"" /><HighLightRowStyle" & _
" parent=""HighlightRow"" me=""Style7"" /><InactiveStyle parent=""Inactive"" me=""Style4" & _
""" /><OddRowStyle parent=""OddRow"" me=""Style9"" /><RecordSelectorStyle parent=""Reco" & _
"rdSelector"" me=""Style11"" /><SelectedStyle parent=""Selected"" me=""Style6"" /><Style" & _
" parent=""Normal"" me=""Style1"" /></C1.Win.C1TrueDBGrid.MergeView></Splits><NamedSt" & _
"yles><Style parent="""" me=""Normal"" /><Style parent=""Normal"" me=""Heading"" /><Style" & _
" parent=""Heading"" me=""Footer"" /><Style parent=""Heading"" me=""Caption"" /><Style pa" & _
"rent=""Heading"" me=""Inactive"" /><Style parent=""Normal"" me=""Selected"" /><Style par" & _
"ent=""Normal"" me=""Editor"" /><Style parent=""Normal"" me=""HighlightRow"" /><Style par" & _
"ent=""Normal"" me=""EvenRow"" /><Style parent=""Normal"" me=""OddRow"" /><Style parent=""" & _
"Heading"" me=""RecordSelector"" /><Style parent=""Normal"" me=""FilterBar"" /><Style pa" & _
"rent=""Caption"" me=""Group"" /></NamedStyles><vertSplits>1</vertSplits><horzSplits>" & _
"1</horzSplits><Layout>None</Layout><DefaultRecSelWidth>17</DefaultRecSelWidth><C" & _
"lientArea>0, 0, 524, 364</ClientArea></Blob>"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(16, 16)
Me.Label1.Name = "Label1"
Me.Label1.TabIndex = 1
Me.Label1.Text = "Info"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(40, 40)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(536, 32)
Me.Label2.TabIndex = 2
Me.Label2.Text = "Mit diesem Tool können die vom EDKB05 erstellten XML Dateien angezeigt werden. Üb" & _
"er ""Laden..."" können Sie eine solche XML Datei laden."
'
'txtFilePath
'
Me.txtFilePath.Location = New System.Drawing.Point(40, 80)
Me.txtFilePath.Name = "txtFilePath"
Me.txtFilePath.ReadOnly = True
Me.txtFilePath.Size = New System.Drawing.Size(248, 20)
Me.txtFilePath.TabIndex = 3
Me.txtFilePath.Text = ""
'
'cmdBrowse
'
Me.cmdBrowse.Location = New System.Drawing.Point(296, 80)
Me.cmdBrowse.Name = "cmdBrowse"
Me.cmdBrowse.TabIndex = 4
Me.cmdBrowse.Text = "Laden..."
'
'openFileDialog
'
Me.openFileDialog.Title = "Load EDKB05 XML Files"
'
'MainForm
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(576, 486)
Me.Controls.Add(Me.cmdBrowse)
Me.Controls.Add(Me.txtFilePath)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.grdFile)
Me.Name = "MainForm"
Me.Text = "EDKB05 - XML Visualizer"
CType(Me.grdFile, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub cmdBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdBrowse.Click
Try
If openFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
txtFilePath.Text = openFileDialog.FileName
Windows.Forms.Cursor.Current = Cursors.WaitCursor
Dim ds As New DataSet
ds.ReadXml(txtFilePath.Text)
grdFile.DataSource = ds.Tables(0)
Windows.Forms.Cursor.Current = Cursors.Default
End If
Catch ex As Exception
MessageBox.Show(ex.Message + Environment.NewLine + Environment.NewLine + ex.StackTrace)
End Try
End Sub
End Class