|
|
Imports System.ComponentModel
|
|
|
|
|
|
Imports MindFusion.Diagramming
|
|
|
Imports MindFusion.Diagramming.WinForms
|
|
|
Imports MindFusion.Diagramming.Export.VisioExporter
|
|
|
Imports SolidBrush = MindFusion.Drawing.SolidBrush
|
|
|
Imports System
|
|
|
Imports System.IO
|
|
|
Imports System.Data
|
|
|
Imports System.Data.SqlTypes
|
|
|
Imports System.Data.SqlClient
|
|
|
Imports System.Diagnostics
|
|
|
Imports System.Reflection
|
|
|
|
|
|
Public Class DiagramControl
|
|
|
#Region "Properties"
|
|
|
Dim m_applikationnr As Integer
|
|
|
Property ApplikationNr() As Integer
|
|
|
Get
|
|
|
Return m_applikationnr
|
|
|
End Get
|
|
|
Set(ByVal value As Integer)
|
|
|
m_applikationnr = value
|
|
|
Try
|
|
|
Me.ImageNo = 1
|
|
|
For Each x As Object In Me.ToolStrip1.Items
|
|
|
Try
|
|
|
x.checked = False
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
Next
|
|
|
Me.ToolStripButton9.Checked = True
|
|
|
Me.ToolStripButton8.Checked = True
|
|
|
Me.Diagram1.LoadFromFile(Me.Get_Architekturfile(m_applikationnr))
|
|
|
Me.Load_Data()
|
|
|
Me.Diagram1.Dirty = False
|
|
|
Me.Diagram1.LinkHeadShape = ArrowHead.None
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Dim m_mitarbeiternr As Integer
|
|
|
Property Mitarbeiternr() As Integer
|
|
|
Get
|
|
|
Return m_mitarbeiternr
|
|
|
End Get
|
|
|
Set(ByVal value As Integer)
|
|
|
m_mitarbeiternr = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Dim m_Applicationdb As TKB.VV.DB.clsApplication
|
|
|
Property Applicationdb() As TKB.VV.DB.clsApplication
|
|
|
Get
|
|
|
Return m_Applicationdb
|
|
|
End Get
|
|
|
Set(ByVal value As TKB.VV.DB.clsApplication)
|
|
|
m_Applicationdb = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Dim m_connectionstring As String
|
|
|
Property ConnectionString() As String
|
|
|
Get
|
|
|
Return m_connectionstring
|
|
|
End Get
|
|
|
Set(ByVal value As String)
|
|
|
m_connectionstring = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Dim m_TempFilepath As String
|
|
|
Property TempFilePath() As String
|
|
|
Get
|
|
|
Return m_TempFilepath
|
|
|
End Get
|
|
|
Set(ByVal value As String)
|
|
|
m_TempFilepath = value
|
|
|
End Set
|
|
|
End Property
|
|
|
Dim M_FormReadOnly As Boolean
|
|
|
Property FormReadOnly() As Boolean
|
|
|
Get
|
|
|
Return M_FormReadOnly
|
|
|
End Get
|
|
|
Set(ByVal value As Boolean)
|
|
|
M_FormReadOnly = value
|
|
|
If M_FormReadOnly = True Then
|
|
|
Me.ToolStripButton1.Enabled = False
|
|
|
End If
|
|
|
End Set
|
|
|
End Property
|
|
|
#End Region
|
|
|
|
|
|
#Region "Deklarationen"
|
|
|
Dim icons As New IconHelper
|
|
|
Dim Node_Selected As Boolean = False
|
|
|
Dim NodeType As Integer '0=Link, 1=ContainerNode, 2=ShapeNode, 3=IconNode
|
|
|
Dim TmpNode As Object
|
|
|
Dim ImageNo As Integer = 1
|
|
|
Friend selectPoint As New System.Drawing.Point()
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "Formular"
|
|
|
Sub New()
|
|
|
|
|
|
' Dieser Aufruf ist f<>r den Windows Form-Designer erforderlich.
|
|
|
InitializeComponent()
|
|
|
Me.Diagram1.Dirty = False
|
|
|
Try
|
|
|
'Diagram.RegisterItemClass(GetType(MyShapeNode), "MyShapeNode", 1)
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
' Let users draw IconNode objects
|
|
|
'DiagramView1.CustomNodeType = GetType(IconNode)
|
|
|
|
|
|
' F<>gen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Public Sub Init_Diagram()
|
|
|
Me.TreeObjekte.BeginUpdate()
|
|
|
Try
|
|
|
Try
|
|
|
If Me.TreeObjekte.Nodes.Count = 0 Then
|
|
|
icons.Load_Treeview(Me.TreeObjekte, Me.ImageList1, Me.ImageList2)
|
|
|
End If
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Load_Connectors()
|
|
|
Dim library As New MindFusion.Diagramming.ShapeLibrary
|
|
|
library.LoadFromXml(GetAppPath() + "stdsymbols.shl")
|
|
|
Me.ShapeListBox1.Shapes = library.Shapes
|
|
|
Me.DiagramView1.Width = Me.Diagram1.BackgroundImage.Width
|
|
|
Me.DiagramView1.Height = Me.Diagram1.BackgroundImage.Height
|
|
|
|
|
|
Me.TreeObjekte.ExpandAll()
|
|
|
Me.TreeObjekte.SelectedNode = Me.TreeObjekte.Nodes(0)
|
|
|
Me.ShapeListBox1.AddShape(Me.New_Line)
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.TreeObjekte.EndUpdate()
|
|
|
Try
|
|
|
' Diagram.RegisterItemClass(GetType(MyShapeNode), "MyShapeNode", 1)
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Nodes.Clear()
|
|
|
Me.Diagram1.Links.Clear()
|
|
|
Try
|
|
|
icons.Background_Images(Me.ToolStripComboBox1)
|
|
|
Me.Diagram1.BackgroundImage = icons.Load_Backgroundimage("Background_Image2.png")
|
|
|
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Dirty = False
|
|
|
End Sub
|
|
|
#End Region
|
|
|
|
|
|
#Region "Treeview"
|
|
|
Private Sub treeobjekte_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles TreeObjekte.ItemDrag
|
|
|
If Not Me.TreeObjekte.SelectedNode.Tag Is System.DBNull.Value Then
|
|
|
If Me.TreeObjekte.SelectedNode.Tag <> "" Then
|
|
|
Dim strItem As String = e.Item.ToString()
|
|
|
DoDragDrop(strItem, DragDropEffects.Copy Or DragDropEffects.Move)
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub TreeObjekte_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TreeObjekte.MouseDown
|
|
|
Try
|
|
|
Dim mouseEvents As MouseEventArgs
|
|
|
mouseEvents = e
|
|
|
selectPoint.Y = mouseEvents.Y
|
|
|
selectPoint.X = mouseEvents.X
|
|
|
Me.TreeObjekte.SelectedNode = Me.TreeObjekte.GetNodeAt(selectPoint)
|
|
|
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "Connectors"
|
|
|
Private Class Connector
|
|
|
Public Sub New(ByVal head As ArrowHead, ByVal name As String)
|
|
|
_head = head
|
|
|
_name = name
|
|
|
End Sub
|
|
|
|
|
|
Public ReadOnly Property Head() As ArrowHead
|
|
|
Get
|
|
|
Return _head
|
|
|
End Get
|
|
|
End Property
|
|
|
|
|
|
Public ReadOnly Property Name() As String
|
|
|
Get
|
|
|
Return _name
|
|
|
End Get
|
|
|
End Property
|
|
|
|
|
|
Private _head As ArrowHead
|
|
|
Private _name As String
|
|
|
End Class
|
|
|
|
|
|
|
|
|
Private Shared _connectors As Connector()
|
|
|
Private Sub Load_Connectors()
|
|
|
_connectors = New Connector() _
|
|
|
{ _
|
|
|
New Connector( _
|
|
|
ArrowHead.None, _
|
|
|
"None"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Arrow, _
|
|
|
"DiagramLink"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.BackSlash, _
|
|
|
"Back slash"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.BowArrow, _
|
|
|
"Bow arrow"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Circle, _
|
|
|
"Circle"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.DoubleArrow, _
|
|
|
"Double arrow"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Pentagon, _
|
|
|
"Pentagon"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.PointerArrow, _
|
|
|
"Pointer"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Quill, _
|
|
|
"Quill"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Reversed, _
|
|
|
"Reversed"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.RevTriangle, _
|
|
|
"Reversed triangle"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.RevWithCirc, _
|
|
|
"Reversed with Circle"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.RevWithLine, _
|
|
|
"Reversed with Line"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Rhombus, _
|
|
|
"Rhombus"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Slash, _
|
|
|
"Slash"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Tetragon, _
|
|
|
"Tetragon"), _
|
|
|
New Connector( _
|
|
|
ArrowHead.Triangle, _
|
|
|
"Triangle")}
|
|
|
|
|
|
Dim c As Connector
|
|
|
For Each c In _connectors
|
|
|
Me._connectorList.Items.Add(c.Name)
|
|
|
Next c
|
|
|
|
|
|
_connectorTypeCombo.SelectedIndex = 0
|
|
|
Me._connectorList.SelectedIndex = 0
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub _connectorList_MeasureItem(ByVal sender As Object, ByVal e As System.Windows.Forms.MeasureItemEventArgs) Handles _connectorList.MeasureItem
|
|
|
e.ItemHeight = 32
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub ListBox_DrawItem(ByVal lb As ListBox, ByVal e As System.Windows.Forms.DrawItemEventArgs)
|
|
|
Dim rcc As Rectangle
|
|
|
Dim rc As RectangleF
|
|
|
|
|
|
Dim brush As System.Drawing.SolidBrush
|
|
|
Dim selPen As System.Drawing.Pen
|
|
|
Dim selBrush As System.Drawing.SolidBrush
|
|
|
Dim sf As StringFormat
|
|
|
|
|
|
rcc = e.Bounds
|
|
|
rcc.Inflate(-1, -1)
|
|
|
rc = New RectangleF(e.Bounds.Left + 32, _
|
|
|
e.Bounds.Top, e.Bounds.Width - 32, _
|
|
|
e.Bounds.Height)
|
|
|
|
|
|
brush = New System.Drawing.SolidBrush(Color.Black)
|
|
|
selPen = New System.Drawing.Pen(Color.Goldenrod)
|
|
|
selBrush = New System.Drawing.SolidBrush(Color.LightYellow)
|
|
|
|
|
|
sf = StringFormat.GenericDefault
|
|
|
sf.LineAlignment = StringAlignment.Center
|
|
|
|
|
|
' Draw the selection if any
|
|
|
If (e.State And DrawItemState.Selected) > 0 Then
|
|
|
e.Graphics.FillRectangle(selBrush, rcc)
|
|
|
e.Graphics.DrawRectangle(selPen, rcc)
|
|
|
Else
|
|
|
Dim tb As System.Drawing.SolidBrush = New _
|
|
|
System.Drawing.SolidBrush(Color.White)
|
|
|
e.Graphics.FillRectangle(tb, e.Bounds)
|
|
|
tb.Dispose()
|
|
|
End If
|
|
|
|
|
|
'e.Graphics.DrawString(lb.Items(e.Index), _
|
|
|
' _nodeList.Font, brush, rc, sf)
|
|
|
|
|
|
brush.Dispose()
|
|
|
selPen.Dispose()
|
|
|
selBrush.Dispose()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub _connectorList_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles _connectorList.DrawItem
|
|
|
Try
|
|
|
If (e.Index < 0) Then Return
|
|
|
|
|
|
' Draw the item
|
|
|
ListBox_DrawItem(_connectorList, e)
|
|
|
|
|
|
If (e.State And DrawItemState.Selected) > 0 Then
|
|
|
_hidden.BackBrush = New SolidBrush(Color.LightYellow)
|
|
|
Else
|
|
|
_hidden.BackBrush = New SolidBrush(Color.White)
|
|
|
End If
|
|
|
|
|
|
' Draw the node
|
|
|
Dim b1 As ShapeNode, b2 As ShapeNode
|
|
|
Dim a As DiagramLink
|
|
|
_hidden.ClearAll()
|
|
|
b1 = _hidden.Factory.CreateShapeNode(-4, 1, 5, 24)
|
|
|
b2 = _hidden.Factory.CreateShapeNode(18, 1, 5, 24)
|
|
|
a = _hidden.Factory.CreateDiagramLink(b1, b2)
|
|
|
b1.Visible = False
|
|
|
b2.Visible = False
|
|
|
a.HeadShape = _connectors(e.Index).Head
|
|
|
|
|
|
Dim bmp As Bitmap = _hidden.CreateImage()
|
|
|
Dim rci As Rectangle = New Rectangle(e.Bounds.Left + 3, _
|
|
|
e.Bounds.Top + 4, 24, 24)
|
|
|
e.Graphics.DrawImage(bmp, rci, 1, 1, 26, 26, _
|
|
|
GraphicsUnit.Pixel)
|
|
|
bmp.Dispose()
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub _connectorList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles _connectorList.SelectedIndexChanged
|
|
|
Dim si As Integer = _connectorList.SelectedIndex
|
|
|
If si < 0 Or si >= _connectors.Length Then Return
|
|
|
|
|
|
Me.Diagram1.LinkHeadShape = _connectors(si).Head
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub _connectorTypeCombo_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles _connectorTypeCombo.SelectedValueChanged
|
|
|
Dim ast As LinkStyle = LinkStyle.Polyline
|
|
|
Dim segments As Short = 1
|
|
|
|
|
|
Select Case _connectorTypeCombo.SelectedIndex
|
|
|
Case 0
|
|
|
ast = LinkStyle.Polyline
|
|
|
Case 1
|
|
|
ast = LinkStyle.Bezier
|
|
|
Case 2
|
|
|
ast = LinkStyle.Cascading
|
|
|
segments = 3
|
|
|
Case Else
|
|
|
|
|
|
End Select
|
|
|
|
|
|
Me.Diagram1.LinkStyle = ast
|
|
|
Me.Diagram1.LinkSegments = segments
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
|
|
#Region "DiagramView"
|
|
|
|
|
|
Private Sub DiagramView1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DiagramView1.Click
|
|
|
Me.Node_Selected = False
|
|
|
|
|
|
End Sub
|
|
|
Private Function GetAppPath() As String
|
|
|
Dim l_intCharPos As Integer = 0, l_intReturnPos As Integer
|
|
|
Dim l_strAppPath As String
|
|
|
|
|
|
l_strAppPath = System.Reflection.Assembly.GetExecutingAssembly.Location()
|
|
|
|
|
|
While (1)
|
|
|
l_intCharPos = InStr(l_intCharPos + 1, l_strAppPath, "\", CompareMethod.Text)
|
|
|
If l_intCharPos = 0 Then
|
|
|
If Microsoft.VisualBasic.Right(Mid(l_strAppPath, 1, l_intReturnPos), 1) <> "\" Then
|
|
|
Return Mid(l_strAppPath, 1, l_intReturnPos) & "\"
|
|
|
Else
|
|
|
Return Mid(l_strAppPath, 1, l_intReturnPos)
|
|
|
End If
|
|
|
Exit Function
|
|
|
End If
|
|
|
l_intReturnPos = l_intCharPos
|
|
|
End While
|
|
|
End Function
|
|
|
|
|
|
|
|
|
Private Sub DiagramView1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DiagramView1.DragEnter
|
|
|
If e.Data.GetDataPresent(DataFormats.Text) Then
|
|
|
e.Effect = DragDropEffects.Copy
|
|
|
Else
|
|
|
e.Effect = DragDropEffects.None
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Function news() As Shape
|
|
|
Return New Shape( _
|
|
|
New ElementTemplate() _
|
|
|
{ _
|
|
|
New LineTemplate(0, 0, 100, 0), _
|
|
|
New LineTemplate(100, 0, 100, 100), _
|
|
|
New LineTemplate(100, 100, 0, 100), _
|
|
|
New LineTemplate(0, 100, 0, 0) _
|
|
|
}, _
|
|
|
New ElementTemplate() _
|
|
|
{ _
|
|
|
}, _
|
|
|
New ElementTemplate() _
|
|
|
{ _
|
|
|
New LineTemplate(5, 71, 95, 71), _
|
|
|
New LineTemplate(95, 71, 95, 95), _
|
|
|
New LineTemplate(95, 95, 5, 95), _
|
|
|
New LineTemplate(5, 95, 5, 71) _
|
|
|
}, Drawing2D.FillMode.Winding, "123123")
|
|
|
End Function
|
|
|
|
|
|
Private Function New_Line() As Shape
|
|
|
|
|
|
' VB.NET ShapeTemplate definition
|
|
|
|
|
|
|
|
|
Dim x As New Shape( _
|
|
|
New ElementTemplate() _
|
|
|
{ _
|
|
|
New LineTemplate(0, 0, 100, 2), _
|
|
|
New LineTemplate(100, 0, 100, 2), _
|
|
|
New LineTemplate(100, 2, 0, 2), _
|
|
|
New LineTemplate(0, 2, 0, 0) _
|
|
|
}, _
|
|
|
New ElementTemplate() _
|
|
|
{ _
|
|
|
}, _
|
|
|
Nothing, Drawing2D.FillMode.Winding, "test")
|
|
|
|
|
|
Return x
|
|
|
|
|
|
|
|
|
End Function
|
|
|
Private Sub DiagramView1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles DiagramView1.DragDrop
|
|
|
If Me.Navigator.SelectedIndex = 1 Then
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
|
|
|
Try
|
|
|
'Diagram.RegisterItemClass(GetType(MyShapeNode), "MyShapeNode", 1)
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
Dim p As Point
|
|
|
Dim o As PointF
|
|
|
Dim pp As Point = DiagramView1.PointToClient(New Point(e.X, e.Y))
|
|
|
Dim pt As PointF = DiagramView1.ClientToDoc(New Point(pp.X, pp.Y))
|
|
|
|
|
|
|
|
|
|
|
|
Dim sn As New ShapeNode(Me.Diagram1)
|
|
|
Diagram1.Nodes.Add(sn)
|
|
|
sn.Image = Me.ImageList2.Images(Me.TreeObjekte.SelectedNode.SelectedImageIndex)
|
|
|
sn.ImageAlign = MindFusion.Drawing.ImageAlign.TopCenter
|
|
|
sn.Tag = New ShapeTagData(Me.TreeObjekte.SelectedNode.Text)
|
|
|
Dim sntag As ShapeTagData = sn.Tag
|
|
|
'sn.ToolTip = sntag.Guid
|
|
|
sn.HyperLink = sntag.Guid
|
|
|
sn.Text = sntag.Name
|
|
|
sn.Tag = sntag
|
|
|
sn.Shape.Id = sntag.Guid
|
|
|
'sn.GUID = sntag.Guid
|
|
|
sn.Shape = news()
|
|
|
|
|
|
sn.Brush = New MindFusion.Drawing.SolidBrush(Color.Transparent)
|
|
|
sn.ShadowOffsetX = 0
|
|
|
sn.ShadowOffsetY = 0
|
|
|
sn.ShadowColor = Color.Transparent
|
|
|
|
|
|
p.X = e.X - (Me.Left + Me.Navigator.Width)
|
|
|
p.Y = e.Y - (Me.Top)
|
|
|
|
|
|
o = Me.DiagramView1.ClientToDoc(p)
|
|
|
sn.Move(o.X, o.Y)
|
|
|
|
|
|
sn.Move(pt.X, pt.Y)
|
|
|
|
|
|
Exit Sub
|
|
|
|
|
|
' shapenode node = new shapenode(diagram);
|
|
|
' Diagram.Nodes.add(node)
|
|
|
'node.Image = Image.FromFile(...);
|
|
|
'node.Transparent = true; // show just the image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
If Me.TreeObjekte.SelectedNode.Tag = "90" Then
|
|
|
Dim n As New ContainerNode
|
|
|
n.ShadowColor = Color.LightGray
|
|
|
n.AllowIncomingLinks = True
|
|
|
n.AllowOutgoingLinks = True
|
|
|
n.EnabledHandles = AdjustmentHandles.Move
|
|
|
n.Expandable = True
|
|
|
n.Expanded = True
|
|
|
Diagram1.Nodes.Add(n)
|
|
|
n.Folded = False
|
|
|
n.Locked = False
|
|
|
n.Obstacle = True
|
|
|
|
|
|
'n.EnabledHandles = AdjustmentHandles.Rotate
|
|
|
|
|
|
'p.X = e.X - (Me.Left + Me.SplitContainer1.Panel1.Width)
|
|
|
'p.Y = e.Y - (Me.Top)
|
|
|
Dim f As New Font(n.Font.FontFamily, 8)
|
|
|
n.Font = f
|
|
|
|
|
|
o = Me.DiagramView1.ClientToDoc(p)
|
|
|
n.Move(pt.X, pt.Y)
|
|
|
n.Brush = New MindFusion.Drawing.LinearGradientBrush(Color.Gray, Color.Transparent, 30)
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_LinkClicked(ByVal sender As Object, ByVal e As MindFusion.Diagramming.LinkEventArgs) Handles Diagram1.LinkClicked
|
|
|
Me.TmpNode = e.Link
|
|
|
Me.NodeType = 0
|
|
|
e.Link.TextStyle = LinkTextStyle.Rotate
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_LinkDeselected(ByVal sender As Object, ByVal e As MindFusion.Diagramming.LinkEventArgs) Handles Diagram1.LinkDeselected
|
|
|
Me.Node_Selected = False
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_LinkSelected(ByVal sender As Object, ByVal e As MindFusion.Diagramming.LinkEventArgs) Handles Diagram1.LinkSelected
|
|
|
Me.Node_Selected = True
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub Diagram1_NodeClicked(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles Diagram1.NodeClicked
|
|
|
e.Node.HandlesStyle = HandlesStyle.HatchHandles3
|
|
|
Try
|
|
|
Dim s As MindFusion.Diagramming.ShapeNode = e.Node
|
|
|
e.Node.EnabledHandles = e.Node.EnabledHandles + AdjustmentHandles.Rotate
|
|
|
s.RotateText = True
|
|
|
Catch
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_NodeCreated(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles Diagram1.NodeCreated
|
|
|
|
|
|
If TypeOf e.Node Is ControlNode Then
|
|
|
Dim node As ControlNode = DirectCast(e.Node, ControlNode)
|
|
|
If TypeOf node.Control Is Button Then
|
|
|
Dim button As Button = DirectCast(node.Control, Button)
|
|
|
button.Text = "Button" & Diagram1.Nodes.Count.ToString()
|
|
|
End If
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_NodeDeselected(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles Diagram1.NodeDeselected
|
|
|
Me.Node_Selected = False
|
|
|
End Sub
|
|
|
|
|
|
Private Sub diagram_NodeDoubleClicked(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles Diagram1.NodeDoubleClicked
|
|
|
Try
|
|
|
Dim f As frmColorDialog
|
|
|
Select Case Me.NodeType
|
|
|
Case 0, 1, 2
|
|
|
Dim p As PointF
|
|
|
|
|
|
f = New frmColorDialog(Me.TmpNode, Me.NodeType)
|
|
|
f.Top = Me.DiagramView1.DocToClient(New Point(e.MousePosition.X, e.MousePosition.Y)).X
|
|
|
f.Left = Me.DiagramView1.DocToClient(New Point(e.MousePosition.X, e.MousePosition.Y)).Y
|
|
|
f.ShowDialog()
|
|
|
Case 3
|
|
|
Dim stagdata As ShapeTagData = TmpNode.tag
|
|
|
TmpNode.text = stagdata.Edit_Attributes
|
|
|
End Select
|
|
|
Catch
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Diagram1_NodeSelected(ByVal sender As Object, ByVal e As MindFusion.Diagramming.NodeEventArgs) Handles Diagram1.NodeSelected
|
|
|
Me.Node_Selected = True
|
|
|
If e.Node.ToString.IndexOf("ContainerNode") > 0 Then
|
|
|
TmpNode = e.Node
|
|
|
Me.NodeType = 1
|
|
|
e.Node.EnabledHandles = -513
|
|
|
End If
|
|
|
If e.Node.ToString.IndexOf("ShapeNode") > 0 Then
|
|
|
TmpNode = e.Node
|
|
|
Try
|
|
|
Dim x As String = TmpNode.shape.id
|
|
|
Dim sntag As ShapeTagData = TmpNode.tag
|
|
|
If TmpNode.tag Is Nothing Then Me.NodeType = 2 Else Me.NodeType = 3
|
|
|
Catch ex As Exception
|
|
|
Me.NodeType = 2
|
|
|
End Try
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Private Sub DiagramView1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DiagramView1.MouseMove
|
|
|
Me.selectPoint.X = e.X
|
|
|
Me.selectPoint.Y = e.Y
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
#Region "ContextMenu"
|
|
|
Private Sub EigenschaftenToolStripMeuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EigenschaftenToolStripMenuItem.Click
|
|
|
Try
|
|
|
Dim f As frmColorDialog
|
|
|
Select Case Me.NodeType
|
|
|
Case 0, 1, 2
|
|
|
f = New frmColorDialog(Me.TmpNode, Me.NodeType)
|
|
|
f.ShowDialog()
|
|
|
Case 3
|
|
|
Dim stagdata As ShapeTagData = TmpNode.tag
|
|
|
|
|
|
TmpNode.text = stagdata.Edit_Attributes
|
|
|
|
|
|
' TmpNode.Edit_Attributes()
|
|
|
End Select
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub InDenHintergrundToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InDenHintergrundToolStripMenuItem.Click
|
|
|
Me.TmpNode.zbottom()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub InDenVordergrundToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InDenVordergrundToolStripMenuItem.Click
|
|
|
Me.TmpNode.ztop()
|
|
|
End Sub
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
#Region "Toolbar"
|
|
|
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
|
|
|
Save_All()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Save_All()
|
|
|
Me.Diagram1.SaveToFile(Me.TempFilePath + "Architekturfile.xml")
|
|
|
Me.Save_Architekturfile(Me.ApplikationNr, Me.TempFilePath + "Architekturfile.xml")
|
|
|
|
|
|
Dim r As New RectangleF(Me.DiagramView1.Top, Me.DiagramView1.Left, Me.Diagram1.BackgroundImage.Width, Me.Diagram1.BackgroundImage.Height)
|
|
|
Dim w As Integer = Me.Diagram1.BackgroundImage.Width / 3.79
|
|
|
Dim h As Integer = Me.Diagram1.BackgroundImage.Height / 3.79
|
|
|
Dim di As Image = Me.Diagram1.CreateImage(New Rectangle(1, 1, w, h), 100)
|
|
|
|
|
|
'Dim di As Image = Me.Diagram1.CreateImage(New Rectangle(1, 1, 264, 180), 100)
|
|
|
Dim fn As String = UCase(Me.TempFilePath + "Architekturfile.jpg")
|
|
|
di.Save(fn, System.Drawing.Imaging.ImageFormat.Jpeg)
|
|
|
Me.Save_Data()
|
|
|
Me.Save_ImageFile(Me.ApplikationNr, Me.TempFilePath + "Architekturfile.jpg")
|
|
|
Me.Diagram1.Dirty = False
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Save_Data()
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitekturObject where imageno=" & Me.ImageNo.ToString & " and applikationnr = " & Str(ApplikationNr), connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObject")
|
|
|
For Each dr As DataRow In ds.Tables(0).Rows
|
|
|
dr.Delete()
|
|
|
Next
|
|
|
Dim found As Boolean = False
|
|
|
Dim i As Integer
|
|
|
For i = 0 To Me.Diagram1.Nodes.Count - 1
|
|
|
If Diagram1.Nodes(i).ToString.IndexOf("ShapeNode") > 0 Then
|
|
|
found = False
|
|
|
Try
|
|
|
Dim stagdata As ShapeTagData = Diagram1.Nodes(i).Tag
|
|
|
Dim n As ShapeNode = Diagram1.Nodes(i)
|
|
|
Dim dr As DataRow
|
|
|
dr = ds.Tables(0).NewRow
|
|
|
dr.Item("Applikationnr") = Me.ApplikationNr
|
|
|
dr.Item("Guid") = stagdata.Guid
|
|
|
dr.Item("Name") = stagdata.Name
|
|
|
dr.Item("Description") = stagdata.Description
|
|
|
dr.Item("Erstellt_am") = Now
|
|
|
dr.Item("Mutiert_am") = Now
|
|
|
dr.Item("ImageNo") = Me.ImageNo
|
|
|
dr.Item("Mutierer") = Me.Mitarbeiternr
|
|
|
ds.Tables(0).Rows.Add(dr)
|
|
|
save_db(stagdata.DB, stagdata.Guid)
|
|
|
save_appl(stagdata.Appl, stagdata.Guid)
|
|
|
save_Virt(stagdata.Virt, stagdata.Guid)
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
End If
|
|
|
Next
|
|
|
DA.Update(ds, "ArcObject")
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub save_db(ByRef data As DataTable, ByVal guid As String)
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitekturObjectdb where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectdb")
|
|
|
For Each dr As DataRow In ds.Tables(0).Rows
|
|
|
dr.Delete()
|
|
|
Next
|
|
|
Dim found As Boolean = False
|
|
|
Dim i As Integer
|
|
|
For Each idr As DataRow In data.Rows
|
|
|
Dim dr As DataRow
|
|
|
dr = ds.Tables(0).NewRow
|
|
|
dr.Item("Guid") = guid
|
|
|
dr.Item("Datenbank") = idr.Item("DBName")
|
|
|
dr.Item("Beschreibung") = idr.Item("Description")
|
|
|
ds.Tables(0).Rows.Add(dr)
|
|
|
Next
|
|
|
DA.Update(ds, "Arcobjectdb")
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
Private Sub save_appl(ByRef data As DataTable, ByVal guid As String)
|
|
|
If data.Rows.Count < 1 Then Exit Sub
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitekturObjectAppl where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectappl")
|
|
|
For Each dr As DataRow In ds.Tables(0).Rows
|
|
|
dr.Delete()
|
|
|
Next
|
|
|
Dim found As Boolean = False
|
|
|
Dim i As Integer
|
|
|
For Each idr As DataRow In data.Rows
|
|
|
Dim dr As DataRow
|
|
|
dr = ds.Tables(0).NewRow
|
|
|
dr.Item("Guid") = guid
|
|
|
dr.Item("Applikation") = idr.Item("Applikation")
|
|
|
dr.Item("Beschreibung") = idr.Item("Description")
|
|
|
ds.Tables(0).Rows.Add(dr)
|
|
|
Next
|
|
|
DA.Update(ds, "Arcobjectappl")
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
Private Sub save_Virt(ByRef data As DataTable, ByVal guid As String)
|
|
|
If data.Rows.Count < 1 Then Exit Sub
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitekturObjectVirt where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectVirt")
|
|
|
For Each dr As DataRow In ds.Tables(0).Rows
|
|
|
dr.Delete()
|
|
|
Next
|
|
|
Dim found As Boolean = False
|
|
|
Dim i As Integer
|
|
|
For Each idr As DataRow In data.Rows
|
|
|
Dim dr As DataRow
|
|
|
dr = ds.Tables(0).NewRow
|
|
|
dr.Item("Guid") = guid
|
|
|
dr.Item("Applikation") = idr.Item("Applikation")
|
|
|
dr.Item("Beschreibung") = idr.Item("Description")
|
|
|
ds.Tables(0).Rows.Add(dr)
|
|
|
Next
|
|
|
DA.Update(ds, "ArcobjectVirt")
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
Private Sub Load_Data()
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitekturObject where imageno=" & Me.ImageNo & " and applikationnr = " & Str(ApplikationNr), connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObject")
|
|
|
|
|
|
Dim found As Boolean = False
|
|
|
Dim i As Integer
|
|
|
For i = 0 To Me.Diagram1.Nodes.Count - 1
|
|
|
If Diagram1.Nodes(i).ToString.IndexOf("ShapeNode") > 0 Then
|
|
|
found = False
|
|
|
Try
|
|
|
Dim n As ShapeNode = Diagram1.Nodes(i)
|
|
|
For Each dr As DataRow In ds.Tables(0).Rows
|
|
|
If dr.Item("guid") = n.HyperLink Then
|
|
|
Dim stagdata As New ShapeTagData(n.Text)
|
|
|
found = True
|
|
|
stagdata.Guid = dr.Item("Guid")
|
|
|
stagdata.Name = dr.Item("Name")
|
|
|
stagdata.Description = dr.Item("Description").ToString
|
|
|
Load_db(stagdata.DB, stagdata.Guid)
|
|
|
Load_appl(stagdata.Appl, stagdata.Guid)
|
|
|
Load_Virt(stagdata.Virt, stagdata.Guid)
|
|
|
n.Tag = stagdata
|
|
|
n.Shape = news()
|
|
|
n.HyperLink = stagdata.Guid
|
|
|
Exit For
|
|
|
End If
|
|
|
Next
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
End If
|
|
|
Next
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Load_db(ByRef data As DataTable, ByVal guid As String)
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select guid, datenbank as dbname, beschreibung as description from ApplikationArchitekturObjectdb where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectdb")
|
|
|
data = ds.Tables(0).Copy
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
Private Sub Load_appl(ByRef data As DataTable, ByVal guid As String)
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select guid, applikation, beschreibung as description from ApplikationArchitekturObjectAppl where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectappl")
|
|
|
data = ds.Tables(0).Copy
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
Private Sub Load_Virt(ByRef data As DataTable, ByVal guid As String)
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select guid, applikation, beschreibung as description from ApplikationArchitekturObjectVirt where guid = '" & guid & "'", connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "ArcObjectVirt")
|
|
|
data = ds.Tables(0).Copy
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
End Sub
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
#Region "FileHandling"
|
|
|
|
|
|
Public Function Save_ImageFile(ByVal Applikationnr As Integer, ByVal iFilename As String)
|
|
|
Dim filename As String = iFilename
|
|
|
Dim Connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitektur where applikationnr = " & Str(Applikationnr), Connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
Dim fs As New FileStream(filename, FileMode.OpenOrCreate, FileAccess.Read)
|
|
|
Dim mydata(fs.Length) As Byte
|
|
|
fs.Read(mydata, 0, fs.Length)
|
|
|
fs.Close()
|
|
|
Try
|
|
|
Connection.ConnectionString = Me.ConnectionString
|
|
|
Connection.Open()
|
|
|
DA.Fill(ds, "RptFile")
|
|
|
Dim myRow As DataRow
|
|
|
If ds.Tables(0).Rows.Count = 0 Then
|
|
|
' Neues Datei speichern
|
|
|
myRow = ds.Tables(0).NewRow
|
|
|
myRow.Item(0) = Applikationnr
|
|
|
Select Case Me.ImageNo
|
|
|
Case 1
|
|
|
myRow.Item(2) = mydata
|
|
|
Case 2
|
|
|
myRow.Item(4) = mydata
|
|
|
Case 3
|
|
|
myRow.Item(6) = mydata
|
|
|
Case 4
|
|
|
myRow.Item(8) = mydata
|
|
|
|
|
|
End Select
|
|
|
' myRow.Item(4) = Now
|
|
|
' myRow.Item(5) = Now
|
|
|
' myRow.Item(6) = Globals.clsmitarbeiter.iMitarbeiternr.Value
|
|
|
ds.Tables(0).Rows.Add(myRow)
|
|
|
DA.Update(ds, "RptFile")
|
|
|
Else
|
|
|
myRow = ds.Tables(0).Rows(0)
|
|
|
myRow.Item(2) = mydata
|
|
|
' myRow.Item(2) = RptName(AuswertungName)
|
|
|
' myRow.Item(3) = mydata
|
|
|
' myRow.Item(5) = Now
|
|
|
' myRow.Item(6) = Globals.clsmitarbeiter.iMitarbeiternr.Value
|
|
|
DA.Update(ds, "RptFile")
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
Return False
|
|
|
End Try
|
|
|
fs = Nothing
|
|
|
cb = Nothing
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
Connection.Close()
|
|
|
Connection = Nothing
|
|
|
End Function
|
|
|
|
|
|
|
|
|
Public Function Save_Architekturfile(ByVal Applikationnr As Integer, ByVal iFilename As String)
|
|
|
Dim filename As String = iFilename
|
|
|
Dim Connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitektur where applikationnr = " & Str(Applikationnr), Connection)
|
|
|
Dim cb As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
Dim fs As New FileStream(filename, FileMode.OpenOrCreate, FileAccess.Read)
|
|
|
Dim mydata(fs.Length) As Byte
|
|
|
fs.Read(mydata, 0, fs.Length)
|
|
|
fs.Close()
|
|
|
Try
|
|
|
Connection.ConnectionString = Me.ConnectionString
|
|
|
Connection.Open()
|
|
|
DA.Fill(ds, "RptFile")
|
|
|
Dim myRow As DataRow
|
|
|
If ds.Tables(0).Rows.Count = 0 Then
|
|
|
' Neues Datei speichern
|
|
|
myRow = ds.Tables(0).NewRow
|
|
|
myRow.Item(0) = Applikationnr
|
|
|
Select Case Me.ImageNo
|
|
|
Case 1
|
|
|
myRow.Item(1) = mydata
|
|
|
Case 2
|
|
|
myRow.Item(3) = mydata
|
|
|
Case 3
|
|
|
myRow.Item(5) = mydata
|
|
|
Case 4
|
|
|
myRow.Item(7) = mydata
|
|
|
|
|
|
End Select
|
|
|
ds.Tables(0).Rows.Add(myRow)
|
|
|
DA.Update(ds, "RptFile")
|
|
|
Else
|
|
|
myRow = ds.Tables(0).Rows(0)
|
|
|
Select Case Me.ImageNo
|
|
|
Case 1
|
|
|
myRow.Item(1) = mydata
|
|
|
Case 2
|
|
|
myRow.Item(3) = mydata
|
|
|
Case 3
|
|
|
myRow.Item(5) = mydata
|
|
|
Case 4
|
|
|
myRow.Item(7) = mydata
|
|
|
|
|
|
End Select
|
|
|
DA.Update(ds, "RptFile")
|
|
|
End If
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
Return False
|
|
|
End Try
|
|
|
fs = Nothing
|
|
|
cb = Nothing
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
Connection.Close()
|
|
|
Connection = Nothing
|
|
|
End Function
|
|
|
|
|
|
Public Function Get_Architekturfile(ByVal Applikationnr As String, Optional ByVal fname As String = "") As String
|
|
|
Dim connection As New SqlConnection()
|
|
|
Dim DA As New SqlDataAdapter("select * from ApplikationArchitektur where applikationnr = " & Str(Applikationnr), connection)
|
|
|
Dim CB As SqlCommandBuilder = New SqlCommandBuilder(DA)
|
|
|
Dim ds As New DataSet()
|
|
|
Dim Filename As String = ""
|
|
|
Try
|
|
|
connection.ConnectionString = Me.ConnectionString
|
|
|
connection.Open()
|
|
|
DA.Fill(ds, "RptFile")
|
|
|
Dim myRow As DataRow
|
|
|
myRow = ds.Tables(0).Rows(0)
|
|
|
Dim MyData() As Byte
|
|
|
Filename = Me.TempFilePath + "architekturfile.xml"
|
|
|
If fname <> "" Then
|
|
|
Filename = fname
|
|
|
End If
|
|
|
Select Case Me.ImageNo
|
|
|
Case 1
|
|
|
MyData = myRow.Item(1)
|
|
|
Case 2
|
|
|
MyData = myRow.Item(3)
|
|
|
Case 3
|
|
|
MyData = myRow.Item(5)
|
|
|
Case 4
|
|
|
MyData = myRow.Item(7)
|
|
|
End Select
|
|
|
Dim K As Long
|
|
|
K = UBound(MyData)
|
|
|
Dim fs As New FileStream(Filename, FileMode.OpenOrCreate, FileAccess.Write)
|
|
|
fs.Write(MyData, 0, K)
|
|
|
fs.Close()
|
|
|
fs = Nothing
|
|
|
Catch ex As Exception
|
|
|
Return ""
|
|
|
End Try
|
|
|
CB = Nothing
|
|
|
ds = Nothing
|
|
|
DA = Nothing
|
|
|
connection.Close()
|
|
|
connection = Nothing
|
|
|
Return Filename
|
|
|
End Function
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
|
|
|
Me.DiagramView1.ZoomOut()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
|
|
|
Me.DiagramView1.ZoomIn()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
|
|
|
Me.SaveFileDialog1.DefaultExt.Insert(0, "*.png")
|
|
|
Me.SaveFileDialog1.Filter = "BMP-Dateien|*.BMP|JPG-Dateien|*.JPG|PNG-Dateien|*.PNG"
|
|
|
Me.SaveFileDialog1.ShowDialog()
|
|
|
Dim r As New RectangleF(Me.DiagramView1.Top, Me.DiagramView1.Left, Me.Diagram1.BackgroundImage.Width, Me.Diagram1.BackgroundImage.Height)
|
|
|
''' Multiplikationsfaktor f<>r Image-With und Image-Heigh: 3.79
|
|
|
'''
|
|
|
Dim w As Integer = Me.Diagram1.BackgroundImage.Width / 3.79
|
|
|
Dim h As Integer = Me.Diagram1.BackgroundImage.Height / 3.79
|
|
|
Dim di As Image = Me.Diagram1.CreateImage(New Rectangle(1, 1, w, h), 100)
|
|
|
' Dim di As Image = Me.Diagram1.CreateImage(New Rectangle(1, 1, 264, 180), 100)
|
|
|
' di.Save("c:\temp\image.png", System.Drawing.Imaging.ImageFormat.Png)
|
|
|
If Me.SaveFileDialog1.FileName <> "" Then
|
|
|
Dim fn As String = UCase(Me.SaveFileDialog1.FileName)
|
|
|
If fn.Contains(".BMP") Then
|
|
|
di.Save(fn, System.Drawing.Imaging.ImageFormat.Bmp)
|
|
|
End If
|
|
|
If fn.Contains(".JPG") Then
|
|
|
di.Save(fn, System.Drawing.Imaging.ImageFormat.Jpeg)
|
|
|
End If
|
|
|
If fn.Contains(".PNG") Then
|
|
|
di.Save(fn, System.Drawing.Imaging.ImageFormat.Png)
|
|
|
End If
|
|
|
'If fn.Contains(".VDX") Then
|
|
|
' Dim de As New MindFusion.Diagramming.Export.VisioExporter
|
|
|
' de.ExportImagesAsGroups = True
|
|
|
' Try
|
|
|
' de.Export(Me.Diagram1, Me.SaveFileDialog1.FileName)
|
|
|
' Catch ex As Exception
|
|
|
' MsgBox(ex.Message)
|
|
|
' End Try
|
|
|
' de = Nothing
|
|
|
'End If
|
|
|
End If
|
|
|
'Dim g As Graphics = Me.DiagramView1.CreateGraphics
|
|
|
|
|
|
'Dim b As New Bitmap(Me.Diagram1.BackgroundImage.Width, Me.Diagram1.BackgroundImage.Height)
|
|
|
'Me.DiagramView1.DrawToBitmap(b, New Rectangle(0, 0, Me.Diagram1.BackgroundImage.Width, Me.Diagram1.BackgroundImage.Height))
|
|
|
'b.Save("c:\temp\image.png", System.Drawing.Imaging.ImageFormat.Png)
|
|
|
'b.Save("E:\Software-Projekte\Vertragsverwaltung\Screens\" & filename & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub ToolStripComboBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripComboBox1.SelectedIndexChanged
|
|
|
Me.Diagram1.BackgroundImage = icons.Load_Backgroundimage(Me.ToolStripComboBox1.Text)
|
|
|
Me.DiagramView1.Refresh()
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripSplitButton1_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton5.Click
|
|
|
Me.ToolStripButton5.Checked = True
|
|
|
Me.ToolStripButton6.Checked = False
|
|
|
Me.ToolStripButton7.Checked = False
|
|
|
Me.ToolStripButton8.Checked = False
|
|
|
Me.DiagramView1.Behavior = Behavior.DrawShapes
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton6.Click
|
|
|
Me.ToolStripButton5.Checked = False
|
|
|
Me.ToolStripButton6.Checked = True
|
|
|
Me.ToolStripButton7.Checked = False
|
|
|
Me.ToolStripButton8.Checked = False
|
|
|
Me.DiagramView1.Behavior = Behavior.DrawLinks
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton7.Click
|
|
|
Me.ToolStripButton5.Checked = False
|
|
|
Me.ToolStripButton6.Checked = False
|
|
|
Me.ToolStripButton7.Checked = True
|
|
|
Me.ToolStripButton8.Checked = False
|
|
|
Me.DiagramView1.Behavior = Behavior.DrawContainers
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub KopierenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KopierenToolStripMenuItem.Click
|
|
|
Me.DiagramView1.CopyToClipboard(True, True)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub Einf<6E>genToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Einf<6E>genToolStripMenuItem.Click
|
|
|
Me.DiagramView1.PasteFromClipboard(10, 10)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ShapesToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ShapesToolStripMenuItem.Click
|
|
|
ToolStripButton5_Click(sender, e)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub LinksToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LinksToolStripMenuItem.Click
|
|
|
ToolStripButton6_Click(sender, e)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub VerbinderToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VerbinderToolStripMenuItem.Click
|
|
|
ToolStripButton7_Click(sender, e)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton8.Click
|
|
|
Me.ToolStripButton5.Checked = False
|
|
|
Me.ToolStripButton6.Checked = False
|
|
|
Me.ToolStripButton7.Checked = False
|
|
|
Me.ToolStripButton8.Checked = True
|
|
|
Me.DiagramView1.Behavior = Behavior.Modify
|
|
|
End Sub
|
|
|
|
|
|
Private Sub AuswahlToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AuswahlToolStripMenuItem.Click
|
|
|
Me.ToolStripButton8_Click(sender, e)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton9.Click
|
|
|
Check_Changes()
|
|
|
ToolStripButton9.Checked = True
|
|
|
Me.ToolStripButton10.Checked = False
|
|
|
Me.ToolStripButton11.Checked = False
|
|
|
Me.ToolStripButton12.Checked = False
|
|
|
Me.ImageNo = 1
|
|
|
Me.Diagram1.Nodes.Clear()
|
|
|
Me.DiagramView1.Refresh()
|
|
|
Try
|
|
|
Me.Diagram1.LoadFromFile(Me.Get_Architekturfile(m_applikationnr))
|
|
|
Me.Load_Data()
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Dirty = False
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton10.Click
|
|
|
Check_Changes()
|
|
|
ToolStripButton9.Checked = False
|
|
|
Me.ToolStripButton10.Checked = True
|
|
|
Me.ToolStripButton11.Checked = False
|
|
|
Me.ToolStripButton12.Checked = False
|
|
|
Me.ImageNo = 2
|
|
|
Me.Diagram1.Nodes.Clear()
|
|
|
Me.DiagramView1.Refresh()
|
|
|
Try
|
|
|
Me.Diagram1.LoadFromFile(Me.Get_Architekturfile(m_applikationnr))
|
|
|
Me.Load_Data()
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Dirty = False
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton11.Click
|
|
|
Check_Changes()
|
|
|
ToolStripButton9.Checked = False
|
|
|
Me.ToolStripButton10.Checked = False
|
|
|
Me.ToolStripButton11.Checked = True
|
|
|
Me.ToolStripButton12.Checked = False
|
|
|
Me.ImageNo = 3
|
|
|
Me.Diagram1.Nodes.Clear()
|
|
|
Me.DiagramView1.Refresh()
|
|
|
Try
|
|
|
Me.Diagram1.LoadFromFile(Me.Get_Architekturfile(m_applikationnr))
|
|
|
Me.Load_Data()
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Dirty = False
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton12.Click
|
|
|
Check_Changes()
|
|
|
ToolStripButton9.Checked = False
|
|
|
Me.ToolStripButton10.Checked = False
|
|
|
Me.ToolStripButton11.Checked = False
|
|
|
Me.ToolStripButton12.Checked = True
|
|
|
Me.Diagram1.Nodes.Clear()
|
|
|
Me.DiagramView1.Refresh()
|
|
|
Me.ImageNo = 4
|
|
|
Try
|
|
|
Me.Diagram1.LoadFromFile(Me.Get_Architekturfile(m_applikationnr))
|
|
|
Me.Load_Data()
|
|
|
Catch
|
|
|
End Try
|
|
|
Me.Diagram1.Dirty = False
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton13_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton13.Click
|
|
|
If Me.Diagram1.Selection.Nodes.Count < 2 Then
|
|
|
Select Case Me.NodeType
|
|
|
Case 0 'Linknode
|
|
|
Dim x As MindFusion.Diagramming.DiagramLink = Me.TmpNode
|
|
|
Me.FontDialog1.Font = x.Font
|
|
|
Me.FontDialog1.Color = x.TextColor
|
|
|
Me.FontDialog1.ShowColor = True
|
|
|
Me.FontDialog1.ShowDialog()
|
|
|
x.Font = Me.FontDialog1.Font
|
|
|
x.TextColor = Me.FontDialog1.Color
|
|
|
Case 1 'Container
|
|
|
Dim x As MindFusion.Diagramming.ContainerNode = Me.TmpNode
|
|
|
Me.FontDialog1.Font = x.Font
|
|
|
Me.FontDialog1.ShowColor = True
|
|
|
|
|
|
Me.FontDialog1.ShowDialog()
|
|
|
x.Font = Me.FontDialog1.Font
|
|
|
Case 2
|
|
|
Dim x As MindFusion.Diagramming.ShapeNode = Me.TmpNode
|
|
|
Me.FontDialog1.Font = x.Font
|
|
|
Me.FontDialog1.Color = x.TextColor
|
|
|
Me.FontDialog1.ShowDialog()
|
|
|
x.Font = Me.FontDialog1.Font
|
|
|
x.TextColor = Me.FontDialog1.Color
|
|
|
Case 3
|
|
|
Dim x As ShapeNode = Me.TmpNode
|
|
|
Me.FontDialog1.Font = x.Font
|
|
|
Me.FontDialog1.ShowColor = False
|
|
|
Me.FontDialog1.ShowDialog()
|
|
|
x.Font = Me.FontDialog1.Font
|
|
|
End Select
|
|
|
Else
|
|
|
Me.FontDialog1.ShowDialog()
|
|
|
For Each n As Object In Me.Diagram1.Selection.Nodes
|
|
|
Try
|
|
|
n.font = Me.FontDialog1.Font
|
|
|
n.textcolor = Me.FontDialog1.Color
|
|
|
Catch ex As Exception
|
|
|
End Try
|
|
|
Next
|
|
|
End If
|
|
|
End Sub
|
|
|
|
|
|
Public Function Check_Changes()
|
|
|
If Me.FormReadOnly = True Then Exit Function
|
|
|
If Me.Diagram1.Dirty Then
|
|
|
Dim f As New frmMsgBox
|
|
|
f.ShowDialog()
|
|
|
If f.DialogResult = DialogResult.Yes Then
|
|
|
Me.Save_All()
|
|
|
End If
|
|
|
Me.Diagram1.Dirty = False
|
|
|
End If
|
|
|
End Function
|
|
|
|
|
|
Private Sub ToolStripButton14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton14.Click
|
|
|
Try
|
|
|
Me.TmpNode.TextFormat.Alignment = StringAlignment.Near
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton15_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton15.Click
|
|
|
Try
|
|
|
Me.TmpNode.TextFormat.Alignment = StringAlignment.Center
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton16.Click
|
|
|
Try
|
|
|
Me.TmpNode.TextFormat.Alignment = StringAlignment.Far
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
Private Sub DiagramView1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DiagramView1.KeyUp
|
|
|
Try
|
|
|
Dim pp As Point = (New Point(TmpNode.Bounds.Left, TmpNode.bounds.Top))
|
|
|
If e.Control = True Then
|
|
|
If e.KeyCode = 67 Then Me.DiagramView1.CopyToClipboard(True, True)
|
|
|
If e.KeyCode = 86 Then Me.DiagramView1.PasteFromClipboard(10, 10)
|
|
|
Exit Sub
|
|
|
End If
|
|
|
|
|
|
Select Case e.KeyCode
|
|
|
Case 37
|
|
|
TmpNode.Move(pp.X - 1, pp.Y)
|
|
|
Case 38
|
|
|
TmpNode.Move(pp.X, pp.Y - 1)
|
|
|
Case 39
|
|
|
TmpNode.Move(pp.X + 1, pp.Y)
|
|
|
Case 40
|
|
|
TmpNode.Move(pp.X, pp.Y + 1)
|
|
|
Case Keys.C
|
|
|
Me.DiagramView1.CopyToClipboard(True, True)
|
|
|
Case Keys.V
|
|
|
Me.DiagramView1.PasteFromClipboard(10, 10)
|
|
|
End Select
|
|
|
|
|
|
Catch ex As Exception
|
|
|
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub ContextMenuStrip1_Opening(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ContextMenuStrip1.Opening
|
|
|
If Me.NodeType = 3 Then
|
|
|
Me.DarstellungToolStripMenuItem.Visible = True
|
|
|
Me.BildAusrichungToolStripMenuItem.Visible = True
|
|
|
Else
|
|
|
Me.DarstellungToolStripMenuItem.Visible = False
|
|
|
Me.BildAusrichungToolStripMenuItem.Visible = False
|
|
|
End If
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub DarstellungToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DarstellungToolStripMenuItem.Click
|
|
|
Try
|
|
|
Dim f As frmColorDialog
|
|
|
f = New frmColorDialog(Me.TmpNode, 2)
|
|
|
f.ShowDialog()
|
|
|
Catch ex As Exception
|
|
|
MsgBox(ex.Message)
|
|
|
End Try
|
|
|
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStripButton17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton17.Click
|
|
|
Dim p As Point
|
|
|
Dim o As PointF
|
|
|
Dim pp As Point = DiagramView1.PointToClient(New Point(Me.selectPoint.X, Me.selectPoint.Y))
|
|
|
Dim pt As PointF = DiagramView1.ClientToDoc(New Point(pp.X, pp.Y))
|
|
|
|
|
|
Dim sn As New ShapeNode(Me.Diagram1)
|
|
|
Diagram1.Nodes.Add(sn)
|
|
|
sn.Image = Clipboard.GetData(System.Windows.Forms.DataFormats.Bitmap)
|
|
|
sn.ImageAlign = MindFusion.Drawing.ImageAlign.TopCenter
|
|
|
'sn.ImageAlign = MindFusion.Drawing.ImageAlign.Stretch
|
|
|
sn.Tag = New ShapeTagData("Pasted Object")
|
|
|
Dim sntag As ShapeTagData = sn.Tag
|
|
|
'sn.ToolTip = sntag.Guid
|
|
|
sn.HyperLink = sntag.Guid
|
|
|
sn.Text = sntag.Name
|
|
|
sn.Shape = news()
|
|
|
|
|
|
sn.Brush = New MindFusion.Drawing.SolidBrush(Color.Transparent)
|
|
|
sn.ShadowOffsetX = 0
|
|
|
sn.ShadowOffsetY = 0
|
|
|
sn.ShadowColor = Color.Transparent
|
|
|
|
|
|
p.X = Me.selectPoint.X - (Me.Left + Me.Navigator.Width)
|
|
|
p.Y = Me.selectPoint.Y - (Me.Top)
|
|
|
o = Me.DiagramView1.ClientToDoc(p)
|
|
|
sn.Move(10, 10)
|
|
|
'sn.Move(pt.X, pt.Y)
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Private Sub AngepasstToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AngepasstToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.Fit
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MitteLinksToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MitteLinksToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.MiddleLeft
|
|
|
End Sub
|
|
|
|
|
|
Private Sub MitteRechtsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MitteRechtsToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.MiddleRight
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ObenLinksToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ObenLinksToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.TopLeft
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ObenRechtsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ObenRechtsToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.TopRight
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ObenZentriertToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ObenZentriertToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.TopCenter
|
|
|
End Sub
|
|
|
|
|
|
Private Sub BottomToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BottomToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.BottomLeft
|
|
|
End Sub
|
|
|
|
|
|
Private Sub UntenRechtsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UntenRechtsToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.BottomRight
|
|
|
End Sub
|
|
|
|
|
|
Private Sub BottomCenterToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BottomCenterToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.BottomCenter
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ZentriertToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ZentriertToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.Center
|
|
|
End Sub
|
|
|
|
|
|
Private Sub GestrecktToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GestrecktToolStripMenuItem.Click
|
|
|
Me.TmpNode.ImageAlign = MindFusion.Drawing.ImageAlign.Stretch
|
|
|
End Sub
|
|
|
|
|
|
Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolStripItemClickedEventArgs) Handles ToolStrip1.ItemClicked
|
|
|
|
|
|
End Sub
|
|
|
'Dim sc As New MindFusion.Diagramming.SelectionCopy
|
|
|
'Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
|
|
|
' Me.sc = Me.Diagram1.CopySelection(Me.Diagram1, True, True)
|
|
|
|
|
|
'End Sub
|
|
|
|
|
|
'Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click
|
|
|
' Dim dc As New MindFusion.Diagramming.Commands.CompositeCmd(Me.Diagram1, "PasteTest")
|
|
|
|
|
|
|
|
|
' Me.Diagram1.PasteSelection(Me.Diagram1, sc, dc, 10, 10)
|
|
|
'End Sub
|
|
|
|
|
|
Private Sub SchriftartToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SchriftartToolStripMenuItem.Click
|
|
|
Me.ToolStripButton13_Click(sender, e)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub CopyToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CopyToolStripMenuItem.Click
|
|
|
Me.DiagramView1.CopyToClipboard(True, True)
|
|
|
End Sub
|
|
|
|
|
|
Private Sub PasteToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PasteToolStripMenuItem.Click
|
|
|
Me.DiagramView1.PasteFromClipboard(0, 0)
|
|
|
End Sub
|
|
|
End Class
|
|
|
|
|
|
Public Class ShapeTagData
|
|
|
Dim m_name As String
|
|
|
Dim m_description As String
|
|
|
Dim m_guid As String
|
|
|
Dim m_db As DataTable
|
|
|
Dim m_appl As DataTable
|
|
|
Dim m_virt As DataTable
|
|
|
|
|
|
Property Name() As String
|
|
|
Get
|
|
|
Return m_name
|
|
|
End Get
|
|
|
Set(ByVal value As String)
|
|
|
m_name = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Property Description() As String
|
|
|
Get
|
|
|
Return m_description
|
|
|
End Get
|
|
|
Set(ByVal value As String)
|
|
|
m_description = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Property Guid() As String
|
|
|
Get
|
|
|
Return m_guid
|
|
|
End Get
|
|
|
Set(ByVal value As String)
|
|
|
m_guid = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Property DB() As DataTable
|
|
|
Get
|
|
|
Return m_db
|
|
|
End Get
|
|
|
Set(ByVal value As DataTable)
|
|
|
m_db = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Property Appl() As DataTable
|
|
|
Get
|
|
|
Return m_appl
|
|
|
End Get
|
|
|
Set(ByVal value As DataTable)
|
|
|
m_appl = value
|
|
|
End Set
|
|
|
End Property
|
|
|
|
|
|
Property Virt() As DataTable
|
|
|
Get
|
|
|
Return m_virt
|
|
|
End Get
|
|
|
Set(ByVal value As DataTable)
|
|
|
m_virt = value
|
|
|
End Set
|
|
|
End Property
|
|
|
Public Sub New(ByVal name As String)
|
|
|
Me.Guid = System.Guid.NewGuid.ToString
|
|
|
Me.DB = New_DBTable()
|
|
|
Me.Appl = New_ApplTable()
|
|
|
Me.Virt = New_VirtTable()
|
|
|
Me.Name = name
|
|
|
End Sub
|
|
|
Private Function New_DBTable() As DataTable
|
|
|
Dim tbl As New DataTable
|
|
|
tbl.Columns.Add("Guid")
|
|
|
tbl.Columns.Add("DBName")
|
|
|
tbl.Columns.Add("Description")
|
|
|
Return tbl
|
|
|
End Function
|
|
|
Private Function New_ApplTable() As DataTable
|
|
|
Dim tbl As New DataTable
|
|
|
tbl.Columns.Add("Entry")
|
|
|
tbl.Columns.Add("Applikation")
|
|
|
tbl.Columns.Add("Description")
|
|
|
Return tbl
|
|
|
End Function
|
|
|
Private Function New_VirtTable() As DataTable
|
|
|
Dim tbl As New DataTable
|
|
|
tbl.Columns.Add("Entry")
|
|
|
tbl.Columns.Add("Applikation")
|
|
|
tbl.Columns.Add("Description")
|
|
|
Return tbl
|
|
|
End Function
|
|
|
Public Function Edit_Attributes() As String
|
|
|
Dim f As New frmDescription
|
|
|
Dim sname As String
|
|
|
f.txtName.Text = Me.Name
|
|
|
f.lblGuid.Text = Me.Guid
|
|
|
f.txtDescription.Text = Me.Description
|
|
|
f.c1appl.DataSource = Me.Appl
|
|
|
f.c1appl.DataMember = Me.Appl.TableName
|
|
|
f.c1db.DataSource = Me.DB
|
|
|
f.c1db.DataMember = Me.DB.TableName
|
|
|
f.c1virt.DataSource = Me.Virt
|
|
|
f.c1virt.DataMember = Me.Virt.TableName
|
|
|
sname = Me.Name
|
|
|
f.ShowDialog()
|
|
|
If f.DialogResult = DialogResult.OK Then
|
|
|
' Me.Tag = f.txtDescription
|
|
|
Me.Name = f.txtName.Text
|
|
|
Me.Description = f.txtDescription.Text
|
|
|
Me.DB = f.c1db.DataSource
|
|
|
Me.Appl = f.c1appl.DataSource
|
|
|
Me.Virt = f.c1virt.DataSource
|
|
|
Return f.txtName.Text
|
|
|
Else
|
|
|
Return sname
|
|
|
|
|
|
End If
|
|
|
End Function
|
|
|
|
|
|
|
|
|
End Class
|