Initial
This commit is contained in:
172
EDOKA/DiverseFormulare/frmEdoka_Import_TextEditor.vb
Normal file
172
EDOKA/DiverseFormulare/frmEdoka_Import_TextEditor.vb
Normal file
@@ -0,0 +1,172 @@
|
||||
Imports System.IO
|
||||
Public Class frmEdoka_Import_TextEditor
|
||||
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 ToolBar1 As System.Windows.Forms.ToolBar
|
||||
Friend WithEvents ToolBarButton1 As System.Windows.Forms.ToolBarButton
|
||||
Friend WithEvents ToolBarButton2 As System.Windows.Forms.ToolBarButton
|
||||
Friend WithEvents txtxml As System.Windows.Forms.TextBox
|
||||
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
|
||||
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmEdoka_Import_TextEditor))
|
||||
Me.ToolBar1 = New System.Windows.Forms.ToolBar()
|
||||
Me.ToolBarButton1 = New System.Windows.Forms.ToolBarButton()
|
||||
Me.ToolBarButton2 = New System.Windows.Forms.ToolBarButton()
|
||||
Me.ImageList1 = New System.Windows.Forms.ImageList(Me.components)
|
||||
Me.txtxml = New System.Windows.Forms.TextBox()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'ToolBar1
|
||||
'
|
||||
Me.ToolBar1.Buttons.AddRange(New System.Windows.Forms.ToolBarButton() {Me.ToolBarButton1, Me.ToolBarButton2})
|
||||
Me.ToolBar1.DropDownArrows = True
|
||||
Me.ToolBar1.ImageList = Me.ImageList1
|
||||
Me.ToolBar1.Name = "ToolBar1"
|
||||
Me.ToolBar1.ShowToolTips = True
|
||||
Me.ToolBar1.Size = New System.Drawing.Size(752, 25)
|
||||
Me.ToolBar1.TabIndex = 0
|
||||
'
|
||||
'ToolBarButton1
|
||||
'
|
||||
Me.ToolBarButton1.ImageIndex = 0
|
||||
'
|
||||
'ToolBarButton2
|
||||
'
|
||||
Me.ToolBarButton2.ImageIndex = 1
|
||||
'
|
||||
'ImageList1
|
||||
'
|
||||
Me.ImageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit
|
||||
Me.ImageList1.ImageSize = New System.Drawing.Size(16, 16)
|
||||
Me.ImageList1.ImageStream = CType(resources.GetObject("ImageList1.ImageStream"), System.Windows.Forms.ImageListStreamer)
|
||||
Me.ImageList1.TransparentColor = System.Drawing.Color.Transparent
|
||||
'
|
||||
'txtxml
|
||||
'
|
||||
Me.txtxml.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.txtxml.Location = New System.Drawing.Point(0, 25)
|
||||
Me.txtxml.Multiline = True
|
||||
Me.txtxml.Name = "txtxml"
|
||||
Me.txtxml.Size = New System.Drawing.Size(752, 596)
|
||||
Me.txtxml.TabIndex = 1
|
||||
Me.txtxml.Text = ""
|
||||
'
|
||||
'frmEdoka_Import_TextEditor
|
||||
'
|
||||
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
|
||||
Me.ClientSize = New System.Drawing.Size(752, 621)
|
||||
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.txtxml, Me.ToolBar1})
|
||||
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
|
||||
Me.Name = "frmEdoka_Import_TextEditor"
|
||||
Me.ShowInTaskbar = False
|
||||
Me.Text = "XML-Indexdaten-Editor"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
Dim m_xmlstring As String
|
||||
Property xmlstring() As String
|
||||
Get
|
||||
Return m_xmlstring
|
||||
End Get
|
||||
Set(ByVal Value As String)
|
||||
m_xmlstring = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_saved As Boolean = False
|
||||
Property Saved() As Boolean
|
||||
Get
|
||||
Return m_saved
|
||||
End Get
|
||||
Set(ByVal Value As Boolean)
|
||||
m_saved = Value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_inputfile As Boolean = False
|
||||
Property Als_Datei() As Boolean
|
||||
Get
|
||||
Return m_inputfile
|
||||
End Get
|
||||
Set(ByVal Value As Boolean)
|
||||
m_inputfile = Value
|
||||
End Set
|
||||
End Property
|
||||
Dim ds As New DataSet()
|
||||
Dim tmpxmlfile As String
|
||||
Dim s As String
|
||||
|
||||
|
||||
Private Sub frmEdoka_Import_TextEditor_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
|
||||
Me.txtxml.Text = ""
|
||||
tmpxmlfile = Globals.Applikationsdaten.Rows(Globals.AppldataRow).Item("pfad_temporaer_dokumente") + "tmpxml.xml"
|
||||
FileOpen(1, tmpxmlfile, OpenMode.Output)
|
||||
PrintLine(1, Me.xmlstring)
|
||||
FileClose(1)
|
||||
If Als_Datei Then
|
||||
Dim tr As TextReader
|
||||
tr = File.OpenText(tmpxmlfile)
|
||||
Me.txtxml.AppendText(tr.ReadToEnd)
|
||||
tr.Close()
|
||||
Else
|
||||
ds.ReadXml(tmpxmlfile)
|
||||
ds.WriteXml(tmpxmlfile)
|
||||
Dim sReader As StreamReader = New StreamReader(tmpxmlfile)
|
||||
Me.txtxml.AppendText(sReader.ReadToEnd)
|
||||
Try
|
||||
sReader.Close()
|
||||
Catch
|
||||
End Try
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
|
||||
Select Case ToolBar1.Buttons.IndexOf(e.Button)
|
||||
Case 0 'close button
|
||||
Me.Close()
|
||||
Me.DialogResult = DialogResult.Abort
|
||||
Me.Close()
|
||||
Case 1
|
||||
Dim i As Integer
|
||||
Me.Saved = True
|
||||
Me.xmlstring = Me.txtxml.Text
|
||||
Me.DialogResult = DialogResult.OK
|
||||
Me.Close()
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user