Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d98eb0e9da | |||
| f4e97d4bae | |||
| cefff881f5 | |||
| 923f1ab7ff | |||
| f1b2e66b97 | |||
| 0535036d36 | |||
| 77333dfc9e | |||
| a6b9fcd2ba | |||
| 5385547af6 | |||
| 467284d008 | |||
| 7a2c45fc4b | |||
| 19b1b8d984 | |||
| 1767aa7f97 | |||
| 652ce25a83 | |||
| 6c2d3bb7b5 | |||
| 4257a92486 | |||
| ac621d9dc0 | |||
| 6f56ae6686 | |||
| e19032f3cb | |||
| 111c59ea46 | |||
| 6b2aa1a8d1 |
@@ -28,4 +28,6 @@
|
||||
Public Const S_VARIABLESLIST As String = "DG_VariablesList"
|
||||
Public Const S_MDICOMMANDS As String = "DG_MDICommands"
|
||||
|
||||
Public Const K_LOCKTABLE As String = "LockTable"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -75,6 +75,8 @@ Public Module ConstGen
|
||||
Public Const SETUP_LUA As String = "SetUp.lua"
|
||||
' Nome eseguibile per stampa
|
||||
Public Const ZEBRAPRINTER_EXE As String = "ZebraPrinterUtilitiesD32.exe"
|
||||
' Nome eseguibile per applicativo di invio feedback
|
||||
Public Const LIMANTRANSFER_EXE As String = "LiMan.Transfer.exe"
|
||||
' Sottodirettorio di default per macro
|
||||
Public Const MACRO_DFL_DIR As String = "Macro"
|
||||
|
||||
|
||||
@@ -30,11 +30,14 @@ Public Module ConstIni
|
||||
'Public Const K_LASTPROJ As String = "LastProj"
|
||||
'Public Const K_AUTOLOADLASTPROJ As String = "AutoLoadLastProj"
|
||||
Public Const K_LASTIMPDIR As String = "LastImpDir"
|
||||
Public Const K_LASTNGEXPDIR As String = "LastNgexpDir"
|
||||
Public Const K_LASTUPDATEDIR As String = "LastUpdateDir"
|
||||
Public Const K_PROJSINDEX As String = "ProjsIndex"
|
||||
Public Const K_PRODSINDEX As String = "ProdsIndex"
|
||||
'Public Const K_SUPPORT As String = "Support"
|
||||
Public Const K_WAREHOUSE As String = "Warehouse"
|
||||
Public Const K_DBADDRESS As String = "DbAddress"
|
||||
Public Const K_LIMANUTILITIES As String = "LiManUtilities"
|
||||
|
||||
'Public Const S_LANGUAGES As String = "Languages"
|
||||
'Public Const K_LANGUAGE As String = "Language"
|
||||
@@ -131,6 +134,11 @@ Public Module ConstIni
|
||||
Public Const K_ZEBRAUTILITIES As String = "ZebraUtilities"
|
||||
Public Const K_TEMPLATE As String = "Template"
|
||||
|
||||
Public Const S_CUSTOMERCONTACT As String = "CustomerContact"
|
||||
Public Const K_CONTACTEMAIL As String = "ContactEmail"
|
||||
Public Const K_CONTACTNAME As String = "ContactName"
|
||||
Public Const K_CONTACTPHONE As String = "ContactPhone"
|
||||
|
||||
Public Const S_BEAM_LIST As String = "Beam_List"
|
||||
Public Const S_WALL_LIST As String = "Wall_List"
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Forms
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
@@ -31,7 +32,8 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
ocColumns.Add(New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
@@ -67,7 +69,8 @@ Public Module DataGridColumnsIniFile
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible)
|
||||
Dim nSortDirection As SortOrder = If(sColumnParams.Count >= 10, CInt(sColumnParams(9)), 0)
|
||||
Column = New EgtDataGridColumn(ParentDGName, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible, nSortDirection)
|
||||
Exit While
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<EventSetter Event="SizeChanged" Handler="Cell_SizedChanged" />
|
||||
<EventSetter Event="MouseRightButtonDown" Handler="Cell_MouseRightButtonDown" />
|
||||
<EventSetter Event="FrameworkElement.Loaded" Handler="DataGridColumnHeader_Loaded"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.Collections.Specialized
|
||||
Imports System.ComponentModel
|
||||
Imports System.Windows
|
||||
Imports System.Windows.Controls
|
||||
Imports System.Windows.Data
|
||||
Imports System.Windows.Controls.Primitives
|
||||
Imports System.Windows.Input
|
||||
Imports System.Windows.Media
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class EgtDataGrid
|
||||
|
||||
' vecchio indice da salvare per il Reorder delle colonne
|
||||
Public OldIndex As Integer = 0
|
||||
|
||||
' variabili e costanti per il Resize delle colonne adiacenti
|
||||
Private Const LEFT As String = "PART_LeftHeaderGripper"
|
||||
Private Const RIGHT As String = "PART_RightHeaderGripper"
|
||||
Private startPoint As Point
|
||||
Private startWidth As Double
|
||||
Private adjacentStartWidth As Double
|
||||
'Private startUnitType As DataGridLengthUnitType
|
||||
'Private adjacentUnitType As DataGridLengthUnitType
|
||||
Private targetColumn As DataGridColumn
|
||||
Private adjacentColumn As DataGridColumn
|
||||
|
||||
' indice header su cui è aperto il ContextMenu per gestione check/uncheck LockTable
|
||||
Private HeaderDispIndex As Integer = 0
|
||||
|
||||
Sub New()
|
||||
InitializeComponent()
|
||||
End Sub
|
||||
@@ -28,8 +50,8 @@ Public Class EgtDataGrid
|
||||
|
||||
If oldItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To oldItems.Count - 1
|
||||
Dim Column As DataGridColumn = context.FindResource(oldItems(Index))
|
||||
For index = 0 To oldItems.Count - 1
|
||||
Dim Column As DataGridColumn = context.FindResource(oldItems(index))
|
||||
context.Columns.Remove(Column)
|
||||
Next
|
||||
|
||||
@@ -40,13 +62,13 @@ Public Class EgtDataGrid
|
||||
|
||||
If newItems IsNot Nothing Then
|
||||
|
||||
For Index = 0 To newItems.Count - 1
|
||||
For index = 0 To newItems.Count - 1
|
||||
Try
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(Index).Name)
|
||||
newItems(Index).InitColumn(col)
|
||||
Dim col As DataGridColumn = context.FindResource(newItems(index).Name)
|
||||
newItems(index).InitColumn(col)
|
||||
context.Columns.Add(col)
|
||||
Catch ex As Exception
|
||||
MessageBox.Show(String.Format(EgtMsg(61883), newItems(Index).Name, newItems(Index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
MessageBox.Show(String.Format(EgtMsg(61883), newItems(index).Name, newItems(index).ParentDataGridName), EgtMsg(15002), MessageBoxButton.OK, MessageBoxImage.Warning)
|
||||
End Try
|
||||
Next
|
||||
|
||||
@@ -116,7 +138,89 @@ Public Class EgtDataGrid
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public OldIndex As Integer = 0
|
||||
Private Sub Cell_MouseRightButtonDown(sender As Object, e As RoutedEventArgs)
|
||||
Dim nDispIndex As Integer = sender.DisplayIndex
|
||||
' creo il ContextMenu con gli item checkabili
|
||||
Dim cm As ContextMenu = New ContextMenu()
|
||||
Dim miReorder As MenuItem = New MenuItem()
|
||||
Dim miResize As MenuItem = New MenuItem()
|
||||
Dim miSort As MenuItem = New MenuItem()
|
||||
Dim sep1 As Separator = New Separator()
|
||||
Dim miVis As MenuItem = New MenuItem()
|
||||
Dim sep2 As Separator = New Separator()
|
||||
Dim miLock As MenuItem = New MenuItem()
|
||||
Dim miResetSort As MenuItem = New MenuItem()
|
||||
miReorder.Header = NameOf(EgtDataGridColumn.CanUserReorder)
|
||||
miResize.Header = NameOf(EgtDataGridColumn.CanUserResize)
|
||||
miSort.Header = NameOf(EgtDataGridColumn.CanUserSort)
|
||||
miVis.Header = "Columns Visibility"
|
||||
miLock.Header = "Lock Table"
|
||||
miResetSort.Header = "Reset Sort"
|
||||
miReorder.IsCheckable = True
|
||||
miResize.IsCheckable = True
|
||||
miSort.IsCheckable = True
|
||||
miLock.IsCheckable = True
|
||||
miResetSort.IsCheckable = False
|
||||
miReorder.StaysOpenOnClick = True
|
||||
miResize.StaysOpenOnClick = True
|
||||
miSort.StaysOpenOnClick = True
|
||||
miLock.StaysOpenOnClick = True
|
||||
miResetSort.StaysOpenOnClick = True
|
||||
' setto il binding
|
||||
Dim miReorderBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserReorder))
|
||||
Dim miResizeBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserResize))
|
||||
Dim miSortBinding As Binding = New Binding(NameOf(EgtDataGridColumn.CanUserSort))
|
||||
miReorderBinding.Mode = BindingMode.TwoWay
|
||||
miResizeBinding.Mode = BindingMode.TwoWay
|
||||
miSortBinding.Mode = BindingMode.TwoWay
|
||||
miReorder.DataContext = BindingColumns(nDispIndex)
|
||||
miResize.DataContext = BindingColumns(nDispIndex)
|
||||
miSort.DataContext = BindingColumns(nDispIndex)
|
||||
miReorder.SetBinding(MenuItem.IsCheckedProperty, miReorderBinding)
|
||||
miResize.SetBinding(MenuItem.IsCheckedProperty, miResizeBinding)
|
||||
miSort.SetBinding(MenuItem.IsCheckedProperty, miSortBinding)
|
||||
' setto check e enable associati a LockTable
|
||||
miLock.IsChecked = (GetPrivateProfileInt(BindingColumns(nDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile) > 0)
|
||||
miReorder.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserReorder)
|
||||
miResize.IsChecked = If(miLock.IsChecked, False, BindingColumns(nDispIndex).CanUserResize)
|
||||
miReorder.IsEnabled = Not miLock.IsChecked
|
||||
miResize.IsEnabled = Not miLock.IsChecked
|
||||
HeaderDispIndex = nDispIndex
|
||||
AddHandler miLock.Checked, AddressOf miLock_Checked
|
||||
AddHandler miLock.Unchecked, AddressOf miLock_Unchecked
|
||||
AddHandler miResetSort.Click, AddressOf miResetSort_Click
|
||||
' aggiungo i MenuItem al ContextMenu
|
||||
cm.Items.Add(miReorder)
|
||||
cm.Items.Add(miResize)
|
||||
cm.Items.Add(miSort)
|
||||
cm.Items.Add(sep1)
|
||||
cm.Items.Add(miVis)
|
||||
cm.Items.Add(sep2)
|
||||
cm.Items.Add(miLock)
|
||||
cm.Items.Add(miResetSort)
|
||||
' creo e aggiungo gli item figli di Columns Visibility
|
||||
For Each Column In BindingColumns
|
||||
Dim mi As MenuItem = New MenuItem()
|
||||
mi.Header = Column.Name
|
||||
mi.IsCheckable = True
|
||||
Dim miBinding As Binding = New Binding(NameOf(EgtDataGridColumn.Visible))
|
||||
miBinding.Mode = BindingMode.TwoWay
|
||||
mi.DataContext = Column
|
||||
mi.SetBinding(MenuItem.IsCheckedProperty, miBinding)
|
||||
mi.StaysOpenOnClick = True
|
||||
mi.IsEnabled = Column.CanUserEditVisible
|
||||
miVis.Items.Add(mi)
|
||||
Next
|
||||
' disabilito Columns Visibility se tutti i suoi figli sono disabilitati
|
||||
Dim bIsEnabled As Boolean = False
|
||||
For Each visMenuItem In miVis.Items
|
||||
bIsEnabled = visMenuItem.IsEnabled
|
||||
Next
|
||||
cm.Items(4).IsEnabled = bIsEnabled
|
||||
|
||||
cm.PlacementTarget = TryCast(sender, Button)
|
||||
cm.IsOpen = True
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_ColumnReordering(sender As Object, e As DataGridColumnEventArgs) Handles CurrDataGrid.ColumnReordering
|
||||
' conservo il vecchio indice in modo da effettuare lo scambio in BindingColumns una volta riordinate graficamente
|
||||
@@ -136,6 +240,156 @@ Public Class EgtDataGrid
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub DataGridColumnHeader_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
Dim header = DirectCast(sender, DataGridColumnHeader)
|
||||
|
||||
Dim thumbLeft As Thumb = header.Template.FindName(LEFT, header)
|
||||
thumbLeft.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbLeft.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
|
||||
Dim thumbRight As Thumb = header.Template.FindName(RIGHT, header)
|
||||
thumbRight.AddHandler(Thumb.DragStartedEvent, CType(AddressOf Thumb_DragStarted, DragStartedEventHandler), True)
|
||||
thumbRight.AddHandler(Thumb.DragCompletedEvent, CType(AddressOf Thumb_DragCompleted, DragCompletedEventHandler), True)
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_DragStarted(sender As Object, e As DragStartedEventArgs)
|
||||
Dim thumb = CType(sender, Thumb)
|
||||
Dim dg As DataGrid = GetParent(Of DataGrid)(thumb)
|
||||
startPoint = Mouse.GetPosition(dg)
|
||||
|
||||
Dim header As DataGridColumnHeader = GetParent(Of DataGridColumnHeader)(thumb)
|
||||
|
||||
If thumb.Name = RIGHT Then
|
||||
targetColumn = header.Column
|
||||
Dim Index As Integer = header.Column.DisplayIndex + 1
|
||||
If (Index < BindingColumns.Count) Then
|
||||
adjacentColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index)
|
||||
End If
|
||||
Else
|
||||
Dim Index As Integer = header.Column.DisplayIndex - 1
|
||||
If (Index >= 0) Then
|
||||
adjacentColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index + 1)
|
||||
End If
|
||||
targetColumn = dg.Columns.FirstOrDefault(Function(x) x.DisplayIndex = Index)
|
||||
End If
|
||||
startWidth = targetColumn.ActualWidth
|
||||
'startUnitType = targetColumn.Width.UnitType
|
||||
If Not IsNothing(adjacentColumn) Then
|
||||
adjacentStartWidth = adjacentColumn.ActualWidth
|
||||
'adjacentUnitType = adjacentColumn.Width.UnitType
|
||||
End If
|
||||
AddHandler thumb.PreviewMouseMove, AddressOf Thumb_PreviewMouseMove
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_PreviewMouseMove(sender As Object, e As MouseEventArgs)
|
||||
Dim thumb = CType(sender, Thumb)
|
||||
If (Not thumb.IsDragging Or IsNothing(targetColumn)) Then Return
|
||||
|
||||
e.Handled = True
|
||||
|
||||
Dim dg As DataGrid = GetParent(Of DataGrid)(thumb)
|
||||
Dim currentPoint As Point = Mouse.GetPosition(dg)
|
||||
Dim diffX As Double = (currentPoint - startPoint).X
|
||||
Dim newWidth As Double = Math.Max(targetColumn.MinWidth, Math.Min(startWidth + diffX, targetColumn.MaxWidth))
|
||||
Dim length = New DataGridLength(newWidth)
|
||||
|
||||
targetColumn.SetValue(DataGridColumn.WidthProperty, length)
|
||||
|
||||
If Not IsNothing(adjacentColumn) Then
|
||||
newWidth = Math.Max(adjacentColumn.MinWidth, Math.Min(adjacentStartWidth - diffX, adjacentColumn.MaxWidth))
|
||||
length = New DataGridLength(newWidth)
|
||||
adjacentColumn.SetValue(DataGridColumn.WidthProperty, length)
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub Thumb_DragCompleted(sender As Object, e As DragCompletedEventArgs)
|
||||
RemoveHandler CType(sender, Thumb).PreviewMouseMove, AddressOf Thumb_PreviewMouseMove
|
||||
targetColumn = Nothing
|
||||
adjacentColumn = Nothing
|
||||
End Sub
|
||||
|
||||
Private Function GetParent(Of T As DependencyObject)(d As DependencyObject) As T
|
||||
Dim tObj As T = Nothing
|
||||
|
||||
While IsNothing(tObj)
|
||||
tObj = TryCast(d, T)
|
||||
d = VisualTreeHelper.GetParent(d)
|
||||
End While
|
||||
|
||||
Return tObj
|
||||
End Function
|
||||
|
||||
Private Sub miLock_Checked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' disabilito Reorder e Resize di tutte le colonne salvandone prima il valore
|
||||
For Each Column In BindingColumns
|
||||
Column.OldCanUserReorder = Column.CanUserReorder
|
||||
Column.OldCanUserResize = Column.CanUserResize
|
||||
Column.CanUserReorder = False
|
||||
Column.CanUserResize = False
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = False
|
||||
miResize.IsChecked = False
|
||||
miReorder.IsEnabled = False
|
||||
miResize.IsEnabled = False
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 1, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miLock_Unchecked(sender As Object, e As RoutedEventArgs)
|
||||
Dim miLock = DirectCast(sender, MenuItem)
|
||||
' abilito Reorder e Resize di tutte le colonne ripristinando il valore precedente, se presente
|
||||
For Each Column In BindingColumns
|
||||
If Not IsNothing(Column.OldCanUserReorder) Then Column.CanUserReorder = Column.OldCanUserReorder
|
||||
If Not IsNothing(Column.OldCanUserResize) Then Column.CanUserResize = Column.OldCanUserResize
|
||||
Next
|
||||
' aggiorno il ContextMenu correntemente aperto
|
||||
Dim miReorder As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(0)
|
||||
Dim miResize As MenuItem = TryCast(miLock.Parent, ContextMenu).Items(1)
|
||||
miReorder.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserReorder), BindingColumns(HeaderDispIndex).CanUserReorder, BindingColumns(HeaderDispIndex).OldCanUserReorder)
|
||||
miResize.IsChecked = If(IsNothing(BindingColumns(HeaderDispIndex).OldCanUserResize), BindingColumns(HeaderDispIndex).CanUserResize, BindingColumns(HeaderDispIndex).OldCanUserResize)
|
||||
miReorder.IsEnabled = True
|
||||
miResize.IsEnabled = True
|
||||
' scrivo il valore di LockTable nell'INI
|
||||
WritePrivateProfileString(BindingColumns(HeaderDispIndex).ParentDataGridName, K_LOCKTABLE, 0, m_sDataGridColumnsIniFile)
|
||||
End Sub
|
||||
|
||||
Private Sub miResetSort_Click(sender As Object, e As RoutedEventArgs)
|
||||
CurrDataGrid.Items.SortDescriptions.Clear()
|
||||
For Each column In BindingColumns 'Grid.Columns
|
||||
column.SortDirection = 0
|
||||
' resettiamo graficamente anche l'header della colonna
|
||||
CurrDataGrid.Columns(column.DisplayIndex).SortDirection = Nothing
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Loaded(sender As Object, e As RoutedEventArgs) Handles CurrDataGrid.Loaded
|
||||
' setto la SortDirection, se attiva, sulla colonna su cui è attiva
|
||||
Dim colIndex As Integer = 0
|
||||
For Each col In BindingColumns
|
||||
If col.SortDirection > 0 Then
|
||||
CurrDataGrid.Items.SortDescriptions.Add(New SortDescription(CurrDataGrid.Columns(colIndex).SortMemberPath, col.SortDirection - 1))
|
||||
Exit For
|
||||
End If
|
||||
colIndex += 1
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub CurrDataGrid_Sorting(sender As Object, e As DataGridSortingEventArgs) Handles CurrDataGrid.Sorting
|
||||
Select Case e.Column.SortDirection
|
||||
Case ListSortDirection.Ascending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 2 ' la settiamo a Descending
|
||||
Case ListSortDirection.Descending
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
Case Else
|
||||
BindingColumns(e.Column.DisplayIndex).SortDirection = 1 ' la settiamo a Ascending
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class EgtDataGridColumn
|
||||
@@ -204,6 +458,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserReorder As Boolean?
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
@@ -219,6 +474,7 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend OldCanUserResize As Boolean?
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
@@ -285,11 +541,30 @@ Public Class EgtDataGridColumn
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SortDirection As Forms.SortOrder = Forms.SortOrder.None
|
||||
Public Property SortDirection As Forms.SortOrder
|
||||
Get
|
||||
Return m_SortDirection 'If(IsNothing(m_dgColumn.SortDirection), 0, m_dgColumn.SortDirection + 1)
|
||||
End Get
|
||||
Set(value As Forms.SortOrder)
|
||||
'If Not IsNothing(m_dgColumn) Then
|
||||
' If value = 0 Then
|
||||
' m_dgColumn.SortDirection = Nothing
|
||||
' Else
|
||||
' m_dgColumn.SortDirection = value - 1
|
||||
' End If
|
||||
'Else
|
||||
m_SortDirection = value
|
||||
'End If
|
||||
SaveDataGridColumn()
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
Sub New(sParentDG As String, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean, nSortDirection As Integer)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
@@ -299,6 +574,7 @@ Public Class EgtDataGridColumn
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
m_SortDirection = nSortDirection
|
||||
End Sub
|
||||
|
||||
Friend Sub InitColumn(dgColumn As DataGridColumn)
|
||||
@@ -310,13 +586,18 @@ Public Class EgtDataGridColumn
|
||||
'm_dgColumn.DisplayIndex = m_DisplayIndex
|
||||
m_dgColumn.Width = m_Width
|
||||
m_dgColumn.Visibility = m_ColumnVisibility
|
||||
If CInt(m_SortDirection) > 0 Then
|
||||
m_dgColumn.SortDirection = m_SortDirection - 1 'If(CInt(m_SortDirection) = 0, Nothing, m_SortDirection - 1)
|
||||
Else
|
||||
m_dgColumn.SortDirection = Nothing
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringa dei parametri della colonna nell'INI
|
||||
Public Function SaveDataGridColumn() As Boolean
|
||||
Dim bOk As Boolean
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0)
|
||||
sColumnParams = Name & "," & If(CanUserReorder, 1, 0) & "," & If(CanUserResize, 1, 0) & "," & If(CanUserSort, 1, 0) & "," & If(IsReadOnly, 1, 0) & "," & DoubleToString(Width.Value, 6) & "," & Width.UnitType & "," & If(Visible, 1, 0) & "," & If(CanUserEditVisible, 1, 0) & "," & CInt(SortDirection)
|
||||
bOk = WriteColumnPrivateProfileParam(ParentDataGridName, DisplayIndex, sColumnParams)
|
||||
Return bOk
|
||||
End Function
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding ProjectColumns}">
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -267,6 +267,10 @@ Public MustInherit Class OpenProjectFileDialogVM
|
||||
New IdNameStruct(OpenProjFileColumn.BTLFILENAME, BTLFileName_Msg),
|
||||
New IdNameStruct(OpenProjFileColumn.CREATEDATE, CreateDate_Msg)})
|
||||
End If
|
||||
' setto la visibilità delle colonne delle EgtDataGrid
|
||||
For Each col In ProjectColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Friend Function VerifySelected() As Boolean
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding VariablesColumns}">
|
||||
<DataGrid.Resources>
|
||||
@@ -289,50 +289,6 @@
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Colonne tabelle">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:DGColumnsListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding DGColumnsList}"
|
||||
SelectedItem="{Binding SelDGColumn}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:DGColumnsListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
|
||||
@@ -55,18 +55,6 @@ Public Class ConfigurationPageVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle colonne con le relative proprietà della DataGrid
|
||||
Private m_DGColumnsList_View As CollectionView = Nothing
|
||||
Protected m_DGColumnsList As New ObservableCollection(Of IniDataGridColumn)
|
||||
Public Property DGColumnsList As ObservableCollection(Of IniDataGridColumn)
|
||||
Get
|
||||
Return m_DGColumnsList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of IniDataGridColumn))
|
||||
m_DGColumnsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Protected m_VariablesColumns As New ObservableCollection(Of EgtDataGridColumn)
|
||||
Public Property VariablesColumns As ObservableCollection(Of EgtDataGridColumn)
|
||||
Get
|
||||
@@ -252,11 +240,6 @@ Public Class ConfigurationPageVM
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
' carico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
LoadConfigDGColumns()
|
||||
' setto il grouping ad 1 livello per la DataGrid
|
||||
m_DGColumnsList_View = CollectionViewSource.GetDefaultView(m_DGColumnsList)
|
||||
m_DGColumnsList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(IniDataGridColumn.VisParentDataGridName)))
|
||||
' carico la lista delle colonne delle variabili della macchina in ConfigurationPage
|
||||
GetPrivateProfileColumns(S_VARIABLESLIST, VariablesColumns)
|
||||
' carico le Variables della macchina
|
||||
@@ -284,7 +267,6 @@ Public Class ConfigurationPageVM
|
||||
''' </summary>
|
||||
Public Sub Save()
|
||||
WriteVariables()
|
||||
WriteDataGridColumns()
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
End Sub
|
||||
@@ -330,54 +312,8 @@ Public Class ConfigurationPageVM
|
||||
|
||||
' funzione che verifica la modifica dei valori in Configurazione e ne chiede il salvataggio
|
||||
Friend Sub VerifyConfigPageModification()
|
||||
' verifico se i valori delle colonne DataGrid sono stati modificati
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
If DGColumnItem.IsModified Then
|
||||
If MessageBox.Show(EgtMsg(61882), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
' scrivo i valori delle colonne DataGrid modificate
|
||||
WriteDataGridColumns()
|
||||
Else
|
||||
' se da non salvare li resetto ed esco dai For
|
||||
LoadConfigDGColumns()
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
' qui veniva verificata solamente la modifica delle proprietà delle colonne delle EgtDataGrid
|
||||
|
||||
' funzione che carica la DataGrid di configurazione delle colonne delle EgtDataGrid
|
||||
Public Sub LoadConfigDGColumns()
|
||||
DGColumnsList.Clear()
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_VARIABLESLIST, DGColumnsList)
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringhe dei parametri delle colonne relative ad una ParentDataGridName nell'INI
|
||||
Public Sub SaveDataGridColumns(ParentDataGridName As String, DGColumnsList As ObservableCollection(Of IniDataGridColumn))
|
||||
For Each ColumnItem In DGColumnsList
|
||||
If ColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = ColumnItem.Name & "," & If(ColumnItem.CanUserReorder, 1, 0) & "," & If(ColumnItem.CanUserResize, 1, 0) & "," &
|
||||
If(ColumnItem.CanUserSort, 1, 0) & "," & If(ColumnItem.IsReadOnly, 1, 0) & "," & DoubleToString(ColumnItem.Width.Value, 6) & "," &
|
||||
ColumnItem.Width.UnitType & "," & If(ColumnItem.Visible, 1, 0) & "," & If(ColumnItem.CanUserEditVisible, 1, 0)
|
||||
WriteColumnPrivateProfileParam(ParentDataGridName, ColumnItem.m_DisplayIndex, sColumnParams)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che scrive i valori delle proprietà delle colonne customizzate delle EgtDataGrid nell'INI
|
||||
Public Sub WriteDataGridColumns()
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, DGColumnsList)
|
||||
SaveDataGridColumns(S_VARIABLESLIST, DGColumnsList)
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
DGColumnItem.IsModifiedReset()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che legge le variabili della macchina dall'INI
|
||||
@@ -421,239 +357,6 @@ Public Class ConfigurationPageVM
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IniDataGridColumn
|
||||
|
||||
Private Property m_ParentDataGridName As String
|
||||
Public Property ParentDataGridName As String
|
||||
Get
|
||||
Return m_ParentDataGridName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ParentDataGridName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome datagrid di cui fa parte la colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisParentDataGridName As String
|
||||
Get
|
||||
Return ParentDataGridName.Replace(ParentDataGridName.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisName As String
|
||||
Get
|
||||
Return Name.Replace(Name.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
m_Width = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedDisplayIndex
|
||||
Friend Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return If(Visible, m_DisplayIndex, -1)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_DisplayIndex = value
|
||||
m_IsModifiedDisplayIndex = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME))
|
||||
' se DisplayIndex viene settato ad un valore che corrisponde a quello che aveva inizialmente aggiorno gli IsModified
|
||||
' delle altre proprietà utilizzando il DisplayIndex attuale
|
||||
If Not m_IsModifiedDisplayIndex Then
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
m_IsModifiedVisible = (m_Visible <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedIsReadOnly As Boolean = False
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserReorder As Boolean = False
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserReorder = value
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserResize As Boolean = False
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserResize = value
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserSort As Boolean = False
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserSort = value
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedVisible As Boolean = False
|
||||
Private m_Visible As Boolean
|
||||
Public Property Visible As Boolean
|
||||
Get
|
||||
Return m_Visible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Visible = value
|
||||
' Utilizzo OldDGIndex e NewDGIndex per muovere la Column tra il gruppo dei Visible (in alto) o il gruppo
|
||||
' dei non Visible (in basso): in ambo i casi verrà sempre spostata in mezzo ai due raggruppamenti
|
||||
Dim OldDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Me)
|
||||
If value Then
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False))
|
||||
' se NewDGIndex = -1 (ovvero ho settato l'ultima Column rimasta non Visible a Visible) oppure
|
||||
' se il nuovo indice è subito dopo il vecchio non la sposto altrimenti viene spostata in maniera sbagliata
|
||||
If NewDGIndex <> -1 AndAlso NewDGIndex <> OldDGIndex + 1 Then Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex)
|
||||
Else
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False AndAlso
|
||||
x.Name <> Name))
|
||||
' se NewDGIndex = -1 vuol dire che erano tutte settate a Visible perciò devo calcolare l'indice
|
||||
' dell'ultima Column con quel ParentDataGridName e spostarlo lì
|
||||
If NewDGIndex = -1 Then
|
||||
Dim FirstIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName))
|
||||
Dim LastIndex = FirstIndex
|
||||
While LastIndex < Map.refConfigurationPageVM.DGColumnsList.Count AndAlso Map.refConfigurationPageVM.DGColumnsList(LastIndex).ParentDataGridName = ParentDataGridName
|
||||
LastIndex += 1
|
||||
End While
|
||||
NewDGIndex = LastIndex
|
||||
End If
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex - 1)
|
||||
End If
|
||||
' aggiorno i DisplayIndex di ciascuna Column della ParentDataGridName in questione
|
||||
Dim index = 0
|
||||
For Each DGColumnItem In Map.refConfigurationPageVM.DGColumnsList
|
||||
If DGColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
DGColumnItem.DisplayIndex = index
|
||||
index += 1
|
||||
End If
|
||||
Next
|
||||
' uso il Move col medesimo valore per i 2 argomenti per refreshare i DisplayIndex delle Column
|
||||
' della ParentDataGridName in questione appena riordinate
|
||||
For index = 0 To Map.refConfigurationPageVM.DGColumnsList.Count - 1
|
||||
If Map.refConfigurationPageVM.DGColumnsList(index).ParentDataGridName = ParentDataGridName Then
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(index, index)
|
||||
End If
|
||||
Next
|
||||
' setto se il valore è stato modificato, a partire dalla verifica che il Nome e DisplayIndex combacino (altrimenti è per forza modificato)
|
||||
m_IsModifiedVisible = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME)) OrElse
|
||||
(If(m_Visible, 1, 0) <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserEditVisible As Boolean
|
||||
Public Property CanUserEditVisible As Boolean
|
||||
Get
|
||||
Return m_CanUserEditVisible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserEditVisible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsModified() As Boolean
|
||||
Get
|
||||
Return m_IsModifiedDisplayIndex OrElse
|
||||
m_IsModifiedIsReadOnly OrElse
|
||||
m_IsModifiedCanUserReorder OrElse
|
||||
m_IsModifiedCanUserResize OrElse
|
||||
m_IsModifiedCanUserSort OrElse
|
||||
m_IsModifiedVisible
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub IsModifiedReset()
|
||||
m_IsModifiedDisplayIndex = False
|
||||
m_IsModifiedIsReadOnly = False
|
||||
m_IsModifiedCanUserReorder = False
|
||||
m_IsModifiedCanUserResize = False
|
||||
m_IsModifiedCanUserSort = False
|
||||
m_IsModifiedVisible = False
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, nDisplayIndex As Integer, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_DisplayIndex = nDisplayIndex
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ConfigVariable
|
||||
|
||||
Private m_sName As String
|
||||
@@ -712,67 +415,3 @@ End Class
|
||||
' LENGTH = 4
|
||||
' CHECKBOX = 5
|
||||
'End Enum
|
||||
|
||||
Public Module IniDataGridColumnFunctions
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nella DataGrid usata per customizzare le proprietà delle colonne delle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileIniColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of IniDataGridColumn)) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
' creo colonna
|
||||
Dim sName = sColumnParams(0)
|
||||
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
|
||||
Dim bResize As Boolean = sColumnParams(2).Equals("1")
|
||||
Dim bSort As Boolean = sColumnParams(3).Equals("1")
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New IniDataGridColumn(ParentDGName, colIndex, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
' funzione che ottiene dal file INI la singola proprietà legata ad una specifica colonna
|
||||
Public Function GetPrivateProfileIniColumnProperty(ParentDGName As String, ocColumns As ObservableCollection(Of IniDataGridColumn), DisplayIndex As Integer, PropertyIndex As EgtDGColumnProperty) As String
|
||||
Dim str = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(ParentDGName, DisplayIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0 Then
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
If PropertyIndex > -1 AndAlso PropertyIndex < sColumnParams.Count Then Return sColumnParams(PropertyIndex)
|
||||
End If
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Enum EgtDGColumnProperty
|
||||
NAME = 0
|
||||
REORDER = 1
|
||||
RESIZE = 2
|
||||
SORT = 3
|
||||
ISREADONLY = 4
|
||||
WIDTH = 5
|
||||
WIDTHTYPE = 6
|
||||
VISIBLE = 7
|
||||
EDITVISIBLE = 8
|
||||
End Enum
|
||||
|
||||
End Module
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<DataGrid x:Class="DGColumnsListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--Indice-->
|
||||
<!--<DataGridTextColumn Binding="{Binding DisplayIndex}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.DisplayIndex_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>-->
|
||||
<!--Nome colonna-->
|
||||
<DataGridTextColumn Binding="{Binding VisName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.ColumnName_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--CanUserReorder-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserReorder, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserReorder_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserResize-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserResize, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserResize_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserSort-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserSort, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserSort_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--IsReadOnly-->
|
||||
<!--<DataGridCheckBoxColumn Binding="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.IsReadOnly_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>-->
|
||||
<!--Visible-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding Visible, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Visible_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataGridCheckBoxColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding CanUserEditVisible}" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.CellStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class DGColumnsListV
|
||||
|
||||
End Class
|
||||
@@ -252,9 +252,6 @@
|
||||
<DependentUpon>ConfigurationPageV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ConfigurationPage\ConfigurationPageVM.vb" />
|
||||
<Compile Include="ConfigurationPage\DGColumnsListV.xaml.vb">
|
||||
<DependentUpon>DGColumnsListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Constants\ConstCommVar.vb" />
|
||||
<Compile Include="ItemParamList\FeatureInPartInRawPartListV.xaml.vb">
|
||||
<DependentUpon>FeatureInPartInRawPartListV.xaml</DependentUpon>
|
||||
@@ -366,10 +363,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ConfigurationPage\DGColumnsListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ItemParamList\FeatureInPartInRawPartListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding FeatureInPartInRawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding PartInRawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -130,6 +130,10 @@ Public Class PartInRawPartListVM
|
||||
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
||||
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
||||
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
' nascondo colonna redo
|
||||
If Not IsNothing(colPartInRawPart_Redo) Then
|
||||
colPartInRawPart_Redo.ColumnVisibility = Visibility.Collapsed
|
||||
@@ -143,6 +147,10 @@ Public Class PartInRawPartListVM
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colPartInRawPart_Rot) Then
|
||||
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
@@ -158,9 +166,6 @@ Public Class PartInRawPartListVM
|
||||
'PartInRawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_BEAM, PartInRawPartColumns)
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
If Not IsNothing(m_colPartInRawPart_Rot) Then
|
||||
m_colPartInRawPart_Rot.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
@@ -173,6 +178,13 @@ Public Class PartInRawPartListVM
|
||||
If Not IsNothing(m_colPartInRawPart_PosY) Then
|
||||
m_colPartInRawPart_PosY.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colPartInRawPart_Offset) Then
|
||||
m_colPartInRawPart_Offset.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
' PartInRawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_PARTINRAWPARTLIST_WALL, PartInRawPartColumns)
|
||||
End If
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding RawPartColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -97,7 +97,15 @@ Public Class RawPartListVM
|
||||
End If
|
||||
'RawPartColumns.Clear()
|
||||
'GetPrivateProfileColumns(S_RAWPARTLIST_BEAM, RawPartColumns)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
ElseIf nMachType = MachineType.WALL Then
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(m_colRawPart_StartCut) Then
|
||||
m_colRawPart_StartCut.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding MDICommandColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -175,6 +175,10 @@ Public Class MainMenuVM
|
||||
Map.refRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(BWType.BEAM)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
'' apro progetto proj
|
||||
'If Not IsNothing(Map.refProjManagerVM.CurrProj) Then
|
||||
' If Map.refProjManagerVM.CurrProj.bReloadProject Then
|
||||
@@ -232,20 +236,11 @@ Public Class MainMenuVM
|
||||
|
||||
Private Function InitCONFIG() As Boolean
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
'' ricarico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
'If Not IsNothing(Map.refConfigurationPageVM) Then Map.refConfigurationPageVM.LoadConfigDGColumns()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Function ExitCONFIG() As Boolean
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
' ricarico le EgtDataGrid del programma con le colonne customizzate
|
||||
Map.refRawPartListVM.RawPartColumns.Clear()
|
||||
Map.refPartInRawPartListVM.PartInRawPartColumns.Clear()
|
||||
Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns.Clear()
|
||||
GetPrivateProfileColumns(S_RAWPARTLIST_SUPERVISOR, Map.refRawPartListVM.RawPartColumns)
|
||||
GetPrivateProfileColumns(S_PARTINRAWPARTLIST_SUPERVISOR, Map.refPartInRawPartListVM.PartInRawPartColumns)
|
||||
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST_SUPERVISOR, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,89 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EgtBEAMWALL.SupportRequest
|
||||
{
|
||||
public class SupportRequest
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodApp { get; set; } = "";
|
||||
public string CodImp { get; set; } = "";
|
||||
public string CodInst { get; set; } = "";
|
||||
public string ContactEmail { get; set; } = "";
|
||||
public string ContactName { get; set; } = "";
|
||||
public string ContactPhone { get; set; } = "";
|
||||
public int idxSubLic { get; set; } = 0;
|
||||
|
||||
public TipologiaTicket Tipo { get; set; } = TipologiaTicket.ND;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
|
||||
}
|
||||
|
||||
public string MasterKey { get; set; } = "";
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Istanzia un nuovo ogetto richeista supporto
|
||||
/// </summary>
|
||||
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
|
||||
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
|
||||
/// <param name="codInst">Codice Cliente/Installazione</param>
|
||||
/// <param name="contactEmail">Email x contatto</param>
|
||||
/// <param name="contactName">Nome del richiedente/clietne</param>
|
||||
/// <param name="contactPhone">Tel richeidente/cliente</param>
|
||||
/// <param name="masterKey">Chiave master di comunicazione da LiMan</param>
|
||||
/// <param name="ReqBody">Testo delal richiesta</param>
|
||||
/// <param name="idxSubLic">Idx univoco di sublic (es x gestione utenti)</param>
|
||||
/// <param name="tipo">tipo ticket da gestire (default fileUpload)</param>
|
||||
public SupportRequest(string codApp, string codImp, string codInst, string contactEmail, string contactName, string contactPhone, string masterKey, string ReqBody, int idxSubLic = 0, TipologiaTicket tipo = TipologiaTicket.FileUpload)
|
||||
{
|
||||
this.CodApp = CodApp;
|
||||
this.CodImp = CodImp;
|
||||
this.CodInst = CodInst;
|
||||
this.ContactEmail = contactEmail;
|
||||
this.ContactName = contactName;
|
||||
this.ContactPhone = contactPhone;
|
||||
this.MasterKey = masterKey;
|
||||
this.ReqBody = ReqBody;
|
||||
this.idxSubLic = idxSubLic;
|
||||
this.Tipo = tipo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio su file di un oggetto richiesta file upload
|
||||
/// </summary>
|
||||
/// <param name="currReq">Oggetto richiesta (già istanziato)</param>
|
||||
/// <param name="filePath">Path dove salvare il file</param>
|
||||
public static bool SaveRequest(SupportRequest currReq, string filePath)
|
||||
{
|
||||
bool fatto = false;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(currReq, Formatting.Indented);
|
||||
File.WriteAllText(filePath, rawData);
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Write(ex.ToString());
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public enum TipologiaTicket : int {
|
||||
ND = 0,
|
||||
FileUpload = 2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding SectXMatColumns}">
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -247,6 +247,10 @@ Public Class AddSectionXMaterialWndVM
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_SECTXMATLIST_WALL, SectXMatColumns)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In SectXMatColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' LoadColumns
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding BeamMachiningsColumns}">
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ Public Class MyBeamMachiningsWindowVM
|
||||
MyBase.New(sTitle, sBaseDir, sMachTypePath, sTabTemplPath, bIsBeam)
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_BEAMMACHININGS, BeamMachiningsColumns)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In BeamMachiningsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
@@ -215,50 +215,6 @@
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
<TabItem Header="Colonne tabelle">
|
||||
<TabItem.Content>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<EgtBEAMWALL:DGColumnsListV DataContext="{Binding}"
|
||||
ItemsSource="{Binding DGColumnsList}"
|
||||
SelectedItem="{Binding SelDGColumn}"
|
||||
Grid.Column="0"
|
||||
Margin="5">
|
||||
<DataGrid.GroupStyle>
|
||||
<GroupStyle>
|
||||
<GroupStyle.ContainerStyle>
|
||||
<Style TargetType="{x:Type GroupItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupItem}">
|
||||
<Expander IsExpanded="True">
|
||||
<Expander.Background>
|
||||
<SolidColorBrush Color="LightGray"></SolidColorBrush>
|
||||
</Expander.Background>
|
||||
<Expander.Header>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Text="{Binding Path=Name}" />
|
||||
</StackPanel>
|
||||
</Expander.Header>
|
||||
<ItemsPresenter />
|
||||
</Expander>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</GroupStyle.ContainerStyle>
|
||||
</GroupStyle>
|
||||
</DataGrid.GroupStyle>
|
||||
</EgtBEAMWALL:DGColumnsListV>
|
||||
</Grid>
|
||||
</TabItem.Content>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
<Button Command="{Binding SaveCommand}"
|
||||
|
||||
@@ -124,18 +124,6 @@ Public Class ConfigurationPageVM
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' lista delle colonne con le relative proprietà della DataGrid
|
||||
Private m_DGColumnsList_View As CollectionView = Nothing
|
||||
Protected m_DGColumnsList As New ObservableCollection(Of IniDataGridColumn)
|
||||
Public Property DGColumnsList As ObservableCollection(Of IniDataGridColumn)
|
||||
Get
|
||||
Return m_DGColumnsList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of IniDataGridColumn))
|
||||
m_DGColumnsList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#Region "Messages"
|
||||
|
||||
Public ReadOnly Property L_Msg As String
|
||||
@@ -315,11 +303,6 @@ Public Class ConfigurationPageVM
|
||||
m_QBTLParamVMList_View = CollectionViewSource.GetDefaultView(m_QBTLParamVMList)
|
||||
m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.GroupType)))
|
||||
m_QBTLParamVMList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(QBTLParamVM.ghDesc)))
|
||||
' carico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
LoadConfigDGColumns()
|
||||
' setto il grouping ad 1 livello per la DataGrid
|
||||
m_DGColumnsList_View = CollectionViewSource.GetDefaultView(m_DGColumnsList)
|
||||
m_DGColumnsList_View.GroupDescriptions.Add(New PropertyGroupDescription(NameOf(IniDataGridColumn.VisParentDataGridName)))
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructor
|
||||
@@ -345,7 +328,6 @@ Public Class ConfigurationPageVM
|
||||
WriteMachParams()
|
||||
WriteMachParamsLua()
|
||||
WriteProcessParams(PRCList.ToList())
|
||||
WriteDataGridColumns()
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_MESSAGES, m_SelectedLanguage.Name)
|
||||
WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, SelMeasureUnit.ToString())
|
||||
WriteMainPrivateProfileString(S_NEST, K_SECTIONTIME, DoubleToString(m_SectionTime, 5))
|
||||
@@ -468,19 +450,6 @@ Public Class ConfigurationPageVM
|
||||
Next
|
||||
NotifyPropertyChanged(NameOf(QBTLParamVMList))
|
||||
End If
|
||||
' verifico se i valori delle colonne DataGrid sono stati modificati
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
If DGColumnItem.IsModified Then
|
||||
If MessageBox.Show(EgtMsg(61882), "", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
' scrivo i valori delle colonne DataGrid modificate
|
||||
WriteDataGridColumns()
|
||||
Else
|
||||
' se da non salvare li resetto ed esco dai For
|
||||
LoadConfigDGColumns()
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che verifica l'inserimento della password quando si edita un parametro Macchina
|
||||
@@ -584,67 +553,6 @@ Public Class ConfigurationPageVM
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che carica la DataGrid di configurazione delle colonne delle EgtDataGrid
|
||||
Public Sub LoadConfigDGColumns()
|
||||
DGColumnsList.Clear()
|
||||
GetPrivateProfileIniColumns(S_FEATURELIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_RAWPARTLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARTLIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_FEATUREINPARTINRAWPARTLIST, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_STATISTICS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_OPTIMIZERSTATISTICS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_BEAMMACHININGS, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARAMETERLIST_P, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_PARAMETERLIST_Q, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SPARAMLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SPARAMLIST_WALL, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SECTXMATLIST_BEAM, DGColumnsList)
|
||||
GetPrivateProfileIniColumns(S_SECTXMATLIST_WALL, DGColumnsList)
|
||||
End Sub
|
||||
|
||||
' funzione per calcolare e scrivere la stringhe dei parametri delle colonne relative ad una ParentDataGridName nell'INI
|
||||
Public Sub SaveDataGridColumns(ParentDataGridName As String, DGColumnsList As ObservableCollection(Of IniDataGridColumn))
|
||||
For Each ColumnItem In DGColumnsList
|
||||
If ColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
Dim sColumnParams = String.Empty
|
||||
sColumnParams = ColumnItem.Name & "," & If(ColumnItem.CanUserReorder, 1, 0) & "," & If(ColumnItem.CanUserResize, 1, 0) & "," &
|
||||
If(ColumnItem.CanUserSort, 1, 0) & "," & If(ColumnItem.IsReadOnly, 1, 0) & "," & DoubleToString(ColumnItem.Width.Value, 6) & "," &
|
||||
ColumnItem.Width.UnitType & "," & If(ColumnItem.Visible, 1, 0) & "," & If(ColumnItem.CanUserEditVisible, 1, 0)
|
||||
WriteColumnPrivateProfileParam(ParentDataGridName, ColumnItem.m_DisplayIndex, sColumnParams)
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
' funzione che scrive i valori delle proprietà delle colonne customizzate delle EgtDataGrid nell'INI
|
||||
Public Sub WriteDataGridColumns()
|
||||
SaveDataGridColumns(S_FEATURELIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROJ, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPENPROJFILEDLG_PROD, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_RAWPARTLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTINRAWPARTLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARTLIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_FEATUREINPARTINRAWPARTLIST, DGColumnsList)
|
||||
SaveDataGridColumns(S_STATISTICS, DGColumnsList)
|
||||
SaveDataGridColumns(S_OPTIMIZERSTATISTICS, DGColumnsList)
|
||||
SaveDataGridColumns(S_BEAMMACHININGS, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARAMETERLIST_P, DGColumnsList)
|
||||
SaveDataGridColumns(S_PARAMETERLIST_Q, DGColumnsList)
|
||||
SaveDataGridColumns(S_SPARAMLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_SPARAMLIST_WALL, DGColumnsList)
|
||||
SaveDataGridColumns(S_SECTXMATLIST_BEAM, DGColumnsList)
|
||||
SaveDataGridColumns(S_SECTXMATLIST_WALL, DGColumnsList)
|
||||
For Each DGColumnItem In DGColumnsList
|
||||
DGColumnItem.IsModifiedReset()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' Methods
|
||||
|
||||
End Class
|
||||
@@ -838,239 +746,6 @@ Public Class MachTable
|
||||
|
||||
End Class
|
||||
|
||||
Public Class IniDataGridColumn
|
||||
|
||||
Private Property m_ParentDataGridName As String
|
||||
Public Property ParentDataGridName As String
|
||||
Get
|
||||
Return m_ParentDataGridName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_ParentDataGridName = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome datagrid di cui fa parte la colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisParentDataGridName As String
|
||||
Get
|
||||
Return ParentDataGridName.Replace(ParentDataGridName.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_Name = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Nome colonna visualizzato nell'interfaccia
|
||||
Public ReadOnly Property VisName As String
|
||||
Get
|
||||
Return Name.Replace(Name.Substring(0, 3), "").Trim()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private Property m_Width As DataGridLength
|
||||
Public Property Width As DataGridLength
|
||||
Get
|
||||
Return m_Width
|
||||
End Get
|
||||
Set(value As DataGridLength)
|
||||
m_Width = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedDisplayIndex
|
||||
Friend Property m_DisplayIndex As Integer
|
||||
Public Property DisplayIndex As Integer
|
||||
Get
|
||||
Return If(Visible, m_DisplayIndex, -1)
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
m_DisplayIndex = value
|
||||
m_IsModifiedDisplayIndex = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME))
|
||||
' se DisplayIndex viene settato ad un valore che corrisponde a quello che aveva inizialmente aggiorno gli IsModified
|
||||
' delle altre proprietà utilizzando il DisplayIndex attuale
|
||||
If Not m_IsModifiedDisplayIndex Then
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
m_IsModifiedVisible = (m_Visible <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedIsReadOnly As Boolean = False
|
||||
Private Property m_IsReadOnly As Boolean = True
|
||||
Public Property IsReadOnly As Boolean
|
||||
Get
|
||||
Return m_IsReadOnly
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsReadOnly = value
|
||||
m_IsModifiedIsReadOnly = (m_IsReadOnly <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.ISREADONLY))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserReorder As Boolean = False
|
||||
Private m_CanUserReorder As Boolean
|
||||
Public Property CanUserReorder As Boolean
|
||||
Get
|
||||
Return m_CanUserReorder
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserReorder = value
|
||||
m_IsModifiedCanUserReorder = (m_CanUserReorder <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.REORDER))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserResize As Boolean = False
|
||||
Private m_CanUserResize As Boolean
|
||||
Public Property CanUserResize As Boolean
|
||||
Get
|
||||
Return m_CanUserResize
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserResize = value
|
||||
m_IsModifiedCanUserResize = (m_CanUserResize <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.RESIZE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedCanUserSort As Boolean = False
|
||||
Private m_CanUserSort As Boolean
|
||||
Public Property CanUserSort As Boolean
|
||||
Get
|
||||
Return m_CanUserSort
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserSort = value
|
||||
m_IsModifiedCanUserSort = (m_CanUserSort <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.SORT))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsModifiedVisible As Boolean = False
|
||||
Private m_Visible As Boolean
|
||||
Public Property Visible As Boolean
|
||||
Get
|
||||
Return m_Visible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_Visible = value
|
||||
' Utilizzo OldDGIndex e NewDGIndex per muovere la Column tra il gruppo dei Visible (in alto) o il gruppo
|
||||
' dei non Visible (in basso): in ambo i casi verrà sempre spostata in mezzo ai due raggruppamenti
|
||||
Dim OldDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Me)
|
||||
If value Then
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False))
|
||||
' se NewDGIndex = -1 (ovvero ho settato l'ultima Column rimasta non Visible a Visible) oppure
|
||||
' se il nuovo indice è subito dopo il vecchio non la sposto altrimenti viene spostata in maniera sbagliata
|
||||
If NewDGIndex <> -1 AndAlso NewDGIndex <> OldDGIndex + 1 Then Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex)
|
||||
Else
|
||||
Dim NewDGIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName AndAlso
|
||||
x.Visible = False AndAlso
|
||||
x.Name <> Name))
|
||||
' se NewDGIndex = -1 vuol dire che erano tutte settate a Visible perciò devo calcolare l'indice
|
||||
' dell'ultima Column con quel ParentDataGridName e spostarlo lì
|
||||
If NewDGIndex = -1 Then
|
||||
Dim FirstIndex As Integer = Map.refConfigurationPageVM.DGColumnsList.IndexOf(Map.refConfigurationPageVM.DGColumnsList.FirstOrDefault(
|
||||
Function(x) x.ParentDataGridName = ParentDataGridName))
|
||||
Dim LastIndex = FirstIndex
|
||||
While LastIndex < Map.refConfigurationPageVM.DGColumnsList.Count AndAlso Map.refConfigurationPageVM.DGColumnsList(LastIndex).ParentDataGridName = ParentDataGridName
|
||||
LastIndex += 1
|
||||
End While
|
||||
NewDGIndex = LastIndex
|
||||
End If
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(OldDGIndex, NewDGIndex - 1)
|
||||
End If
|
||||
' aggiorno i DisplayIndex di ciascuna Column della ParentDataGridName in questione
|
||||
Dim index = 0
|
||||
For Each DGColumnItem In Map.refConfigurationPageVM.DGColumnsList
|
||||
If DGColumnItem.ParentDataGridName = ParentDataGridName Then
|
||||
DGColumnItem.DisplayIndex = index
|
||||
index += 1
|
||||
End If
|
||||
Next
|
||||
' uso il Move col medesimo valore per i 2 argomenti per refreshare i DisplayIndex delle Column
|
||||
' della ParentDataGridName in questione appena riordinate
|
||||
For index = 0 To Map.refConfigurationPageVM.DGColumnsList.Count - 1
|
||||
If Map.refConfigurationPageVM.DGColumnsList(index).ParentDataGridName = ParentDataGridName Then
|
||||
Map.refConfigurationPageVM.DGColumnsList.Move(index, index)
|
||||
End If
|
||||
Next
|
||||
' setto se il valore è stato modificato, a partire dalla verifica che il Nome e DisplayIndex combacino (altrimenti è per forza modificato)
|
||||
m_IsModifiedVisible = (m_Name <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.NAME)) OrElse
|
||||
(If(m_Visible, 1, 0) <>
|
||||
GetPrivateProfileIniColumnProperty(ParentDataGridName, Map.refConfigurationPageVM.DGColumnsList, m_DisplayIndex, EgtDGColumnProperty.VISIBLE))
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CanUserEditVisible As Boolean
|
||||
Public Property CanUserEditVisible As Boolean
|
||||
Get
|
||||
Return m_CanUserEditVisible
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_CanUserEditVisible = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property IsModified() As Boolean
|
||||
Get
|
||||
Return m_IsModifiedDisplayIndex OrElse
|
||||
m_IsModifiedIsReadOnly OrElse
|
||||
m_IsModifiedCanUserReorder OrElse
|
||||
m_IsModifiedCanUserResize OrElse
|
||||
m_IsModifiedCanUserSort OrElse
|
||||
m_IsModifiedVisible
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub IsModifiedReset()
|
||||
m_IsModifiedDisplayIndex = False
|
||||
m_IsModifiedIsReadOnly = False
|
||||
m_IsModifiedCanUserReorder = False
|
||||
m_IsModifiedCanUserResize = False
|
||||
m_IsModifiedCanUserSort = False
|
||||
m_IsModifiedVisible = False
|
||||
End Sub
|
||||
|
||||
Sub New(sName As String)
|
||||
m_Name = sName
|
||||
End Sub
|
||||
|
||||
Sub New(sParentDG As String, nDisplayIndex As Integer, sName As String, bCanUserReorder As Boolean, bCanUserResize As Boolean, bCanUserSort As Boolean, bIsReadOnly As Boolean, Width As DataGridLength, bVisible As Boolean, bCanUserEditVisible As Boolean)
|
||||
m_ParentDataGridName = sParentDG
|
||||
m_DisplayIndex = nDisplayIndex
|
||||
m_Name = sName
|
||||
m_CanUserReorder = bCanUserReorder
|
||||
m_CanUserResize = bCanUserResize
|
||||
m_CanUserSort = bCanUserSort
|
||||
m_IsReadOnly = bIsReadOnly
|
||||
m_Width = Width
|
||||
m_Visible = bVisible
|
||||
m_CanUserEditVisible = bCanUserEditVisible
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
' Tipo parametro nel file di configurazione Macchina
|
||||
Public Enum MachParamType As Integer
|
||||
DOUBLE_ = 1
|
||||
@@ -1079,68 +754,3 @@ Public Enum MachParamType As Integer
|
||||
LENGTH = 4
|
||||
CHECKBOX = 5
|
||||
End Enum
|
||||
|
||||
Public Module IniDataGridColumnFunctions
|
||||
|
||||
' funzione per ottenere dal file INI le colonne da caricare nella DataGrid usata per customizzare le proprietà delle colonne delle EgtDataGrid del programma
|
||||
Public Function GetPrivateProfileIniColumns(ParentDGName As String, ByRef ocColumns As ObservableCollection(Of IniDataGridColumn)) As Boolean
|
||||
Dim colIndex As Integer = 0
|
||||
Dim str = String.Empty
|
||||
While EgtUILib.GetPrivateProfileString(ParentDGName, colIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
' creo colonna
|
||||
Dim sName = sColumnParams(0)
|
||||
Dim bReorder As Boolean = sColumnParams(1).Equals("1")
|
||||
Dim bResize As Boolean = sColumnParams(2).Equals("1")
|
||||
Dim bSort As Boolean = sColumnParams(3).Equals("1")
|
||||
Dim bIsReadOnly As Boolean = sColumnParams(4).Equals("1")
|
||||
Dim Width As Double
|
||||
Dim WidthType As DataGridLengthUnitType
|
||||
StringToDouble(sColumnParams(5), Width)
|
||||
Integer.TryParse(sColumnParams(6), WidthType)
|
||||
Dim bVisible As Boolean = sColumnParams(7).Equals("1")
|
||||
Dim bCanUserEditVisible As Boolean = sColumnParams(8).Equals("1")
|
||||
ocColumns.Add(New IniDataGridColumn(ParentDGName, colIndex, sName, bReorder, bResize, bSort, bIsReadOnly, New DataGridLength(Width, WidthType), bVisible, bCanUserEditVisible))
|
||||
End If
|
||||
colIndex += 1
|
||||
End While
|
||||
Return ocColumns.Count > 0
|
||||
End Function
|
||||
|
||||
' funzione che ottiene dal file INI la singola proprietà legata ad una specifica colonna
|
||||
Public Function GetPrivateProfileIniColumnProperty(ParentDGName As String, ocColumns As ObservableCollection(Of IniDataGridColumn), DisplayIndex As Integer, PropertyIndex As EgtDGColumnProperty) As String
|
||||
Dim str = String.Empty
|
||||
If EgtUILib.GetPrivateProfileString(ParentDGName, DisplayIndex, String.Empty, str, m_sDataGridColumnsIniFile) > 0 Then
|
||||
Dim sColumnParams() As String = str.Split(","c)
|
||||
' verifico numero minimo di parametri
|
||||
If sColumnParams.Count >= 9 Then
|
||||
' cancello spazi
|
||||
For index = 0 To sColumnParams.Count - 1
|
||||
sColumnParams(index) = sColumnParams(index).Trim()
|
||||
Next
|
||||
If PropertyIndex > -1 AndAlso PropertyIndex < sColumnParams.Count Then Return sColumnParams(PropertyIndex)
|
||||
End If
|
||||
End If
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
Public Enum EgtDGColumnProperty
|
||||
NAME = 0
|
||||
REORDER = 1
|
||||
RESIZE = 2
|
||||
SORT = 3
|
||||
ISREADONLY = 4
|
||||
WIDTH = 5
|
||||
WIDTHTYPE = 6
|
||||
VISIBLE = 7
|
||||
EDITVISIBLE = 8
|
||||
End Enum
|
||||
|
||||
End Module
|
||||
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
<DataGrid x:Class="DGColumnsListV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
AutoGenerateColumns="False"
|
||||
CanUserSortColumns="False"
|
||||
CanUserResizeColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!--Indice-->
|
||||
<!--<DataGridTextColumn Binding="{Binding DisplayIndex}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.DisplayIndex_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>-->
|
||||
<!--Nome colonna-->
|
||||
<DataGridTextColumn Binding="{Binding VisName}"
|
||||
Width="Auto"
|
||||
IsReadOnly="True">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.ColumnName_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
</DataGridTextColumn>
|
||||
<!--CanUserReorder-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserReorder, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserReorder_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserResize-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserResize, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserResize_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--CanUserSort-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding CanUserSort, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.CanUserSort_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>
|
||||
<!--IsReadOnly-->
|
||||
<!--<DataGridCheckBoxColumn Binding="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.IsReadOnly_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
</DataGridCheckBoxColumn>-->
|
||||
<!--Visible-->
|
||||
<DataGridCheckBoxColumn Binding="{Binding Visible, UpdateSourceTrigger=PropertyChanged}"
|
||||
Width="Auto">
|
||||
<DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding DataContext.Visible_Msg,RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
|
||||
</DataTemplate>
|
||||
</DataGridCheckBoxColumn.HeaderTemplate>
|
||||
<DataGridCheckBoxColumn.CellStyle>
|
||||
<Style TargetType="DataGridCell">
|
||||
<Setter Property="IsEnabled" Value="{Binding CanUserEditVisible}" />
|
||||
</Style>
|
||||
</DataGridCheckBoxColumn.CellStyle>
|
||||
</DataGridCheckBoxColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
</DataGrid>
|
||||
@@ -1,3 +0,0 @@
|
||||
Public Class DGColumnsListV
|
||||
|
||||
End Class
|
||||
@@ -165,6 +165,10 @@
|
||||
<Compile Include="AboutBoxWindow\AboutBoxV.xaml.vb">
|
||||
<DependentUpon>AboutBoxV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml.vb">
|
||||
<DependentUpon>MovePartInRawPartWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MovePartInRawPartWnd\MovePartInRawPartWndVM.vb" />
|
||||
<Compile Include="InputPwdWnd\InputPwdWndV.xaml.vb">
|
||||
<DependentUpon>InputPwdWndV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -209,9 +213,6 @@
|
||||
<DependentUpon>CalcPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CALCPanel\CALCPanelVM.vb" />
|
||||
<Compile Include="ConfigurationPage\DGColumnsListV.xaml.vb">
|
||||
<DependentUpon>DGColumnsListV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Constants\ConstWarehouseIni.vb" />
|
||||
<Compile Include="FreeContourManager\FreeContourManagerV.xaml.vb">
|
||||
<DependentUpon>FreeContourManagerV.xaml</DependentUpon>
|
||||
@@ -356,6 +357,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="MovePartInRawPartWnd\MovePartInRawPartWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="InputPwdWnd\InputPwdWndV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -404,10 +409,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="ConfigurationPage\DGColumnsListV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="FreeContourManager\FreeContourManagerV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -696,6 +697,10 @@
|
||||
<Project>{24d7760e-662a-47e4-b729-b70126c24a31}</Project>
|
||||
<Name>EgtBEAMWALL.DataLayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\LiMan.Core\LiMan.Core.csproj">
|
||||
<Project>{b61508b2-20cb-45d9-8c00-209a22c44de5}</Project>
|
||||
<Name>LiMan.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TreeView\Folder.png" />
|
||||
@@ -848,6 +853,15 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\OptimizePanel\UnlockRotation.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MovePartInRawPart\MoveLeftParts.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\MovePartInRawPart\MoveRightParts.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\TopPanel\MovePartInRawPart.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\EgtBEAMWALL\EgtBEAMWALL.ViewerOptimizerR32.exe
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding FeatureInPartInRawPartColumns}"
|
||||
BeginningEdit="FeatureInPartInRawPartList_BeginningEdit"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding FeatureColumns}"
|
||||
Style="{StaticResource DataGrid_CustomHighLight}">
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.PBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelPBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:PParameterListV}}}"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding PartInRawPartColumns}"
|
||||
BeginningEdit="PartInRawPartList_BeginningEdit"
|
||||
|
||||
@@ -129,6 +129,10 @@ Public Class PartInRawPartListVM
|
||||
m_colPartInRawPart_Flip = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_FLIP)
|
||||
m_colPartInRawPart_PosX = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSX)
|
||||
m_colPartInRawPart_PosY = m_PartInRawPartColumns.FirstOrDefault(Function(x) x.Name = COL_POSY)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5">
|
||||
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
ItemsSource="{Binding Tag.QBTLParamVMList, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
SelectedItem="{Binding Tag.SelQBTLParam, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:QParameterListV}}}"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="0,0,0,5"
|
||||
BindingColumns="{Binding RawPartColumns}"
|
||||
BeginningEdit="RawPartList_BeginningEdit"
|
||||
|
||||
@@ -114,6 +114,10 @@ Public Class RawPartListVM
|
||||
m_colRawPart_StartCut = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_STARTCUT)
|
||||
m_colRawPart_W = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_W)
|
||||
m_colRawPart_L = RawPartColumns.FirstOrDefault(Function(x) x.Name = COL_L)
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports System.IO
|
||||
Imports System.Runtime.InteropServices
|
||||
Imports System.Windows.Threading
|
||||
Imports EgtBEAMWALL.Core
|
||||
Imports EgtBEAMWALL.Core.ConstBeam
|
||||
Imports EgtBEAMWALL.DataLayer.DatabaseModels
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
Imports LiMan.Core
|
||||
|
||||
Public Class MainMenuVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Private m_LiManTimer As New DispatcherTimer
|
||||
|
||||
Private m_MainMenu_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property MainMenu_IsEnabled As Boolean
|
||||
Get
|
||||
@@ -162,6 +166,8 @@ Public Class MainMenuVM
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefMainMenuVM(Me)
|
||||
m_LiManTimer.Interval = TimeSpan.FromMilliseconds(1000)
|
||||
AddHandler m_LiManTimer.Tick, AddressOf LiManTimer_Tick
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -189,6 +195,22 @@ Public Class MainMenuVM
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Visible
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureListVM.FeatureColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPartListVM.PartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refStatisticsVM.StatisticsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPParameterListVM.PParameterListColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refQParameterListVM.QParameterListColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
' imposto dimensioni colonne/righe della Grid
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_VIEW, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_VIEW, Map.refLeftPanelVM.GridDims)
|
||||
@@ -249,9 +271,6 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.SetProdManager_Visibility(True)
|
||||
Map.refProjectVM.SetOptimizePanel_Visibility(True)
|
||||
Map.refCALCPanelVM.SetChooseMachine_Visibility(False)
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -269,6 +288,25 @@ Public Class MainMenuVM
|
||||
Map.refProjectVM.NotifyAllPanelVisibility()
|
||||
Map.refCALCPanelVM.SetChooseMachineBtn_Visibility(False)
|
||||
Map.refTopPanelVM.UpdateQParameterVisibility()
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In Map.refFeatureListVM.FeatureColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refRawPartListVM.RawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refPartInRawPartListVM.PartInRawPartColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
For Each col In Map.refStatisticsVM.OptimizerStatisticsColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
If Not IsNothing(Map.refFeatureListVM.colFeature_Do) Then
|
||||
Map.refFeatureListVM.colFeature_Do.ColumnVisibility = Visibility.Collapsed
|
||||
End If
|
||||
' imposto dimensioni colonne/righe della Grid
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.PROJECT_OPTIMIZER, Map.refProjectVM.GridDims)
|
||||
DimensionsIniFile.ReadGridDimensions(ConstDims.LEFTPANEL_OPTIMIZER, Map.refLeftPanelVM.GridDims)
|
||||
@@ -355,8 +393,6 @@ Public Class MainMenuVM
|
||||
Private Function InitCONFIG() As Boolean
|
||||
Map.refMainWindowVM.NotifyPropertyChanged(NameOf(Map.refMainWindowVM.nSelTabPage))
|
||||
Map.refMainMenuVM.NotifyPropertyChanged(NameOf(Map.refMainMenuVM.SendFeedbackIsEnabled))
|
||||
' ricarico la lista delle colonne delle DataGrid in ConfigurationPage
|
||||
If Not IsNothing(Map.refConfigurationPageVM) Then Map.refConfigurationPageVM.LoadConfigDGColumns()
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -364,21 +400,6 @@ Public Class MainMenuVM
|
||||
Map.refConfigurationPageVM.VerifyConfigPageModification()
|
||||
' resetto flag inserimento password
|
||||
Map.refConfigurationPageVM.bModifyMachParam = False
|
||||
' ricarico le EgtDataGrid del programma con le colonne customizzate
|
||||
Map.refFeatureListVM.FeatureColumns.Clear()
|
||||
Map.refPartListVM.PartColumns.Clear()
|
||||
Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns.Clear()
|
||||
Map.refStatisticsVM.StatisticsColumns.Clear()
|
||||
Map.refStatisticsVM.OptimizerStatisticsColumns.Clear()
|
||||
Map.refPParameterListVM.PParameterListColumns.Clear()
|
||||
Map.refQParameterListVM.QParameterListColumns.Clear()
|
||||
GetPrivateProfileColumns(S_FEATURELIST, Map.refFeatureListVM.FeatureColumns)
|
||||
GetPrivateProfileColumns(S_PARTLIST, Map.refPartListVM.PartColumns)
|
||||
GetPrivateProfileColumns(S_FEATUREINPARTINRAWPARTLIST, Map.refFeatureInPartInRawPartListVM.FeatureInPartInRawPartColumns)
|
||||
GetPrivateProfileColumns(S_STATISTICS, Map.refStatisticsVM.StatisticsColumns)
|
||||
GetPrivateProfileColumns(S_OPTIMIZERSTATISTICS, Map.refStatisticsVM.OptimizerStatisticsColumns)
|
||||
GetPrivateProfileColumns(S_PARAMETERLIST_P, Map.refPParameterListVM.PParameterListColumns)
|
||||
GetPrivateProfileColumns(S_PARAMETERLIST_Q, Map.refQParameterListVM.QParameterListColumns)
|
||||
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then
|
||||
Map.refRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
Map.refPartInRawPartListVM.UpdateColumns(Map.refProjectVM.BTLStructureVM.nPROJTYPE)
|
||||
@@ -448,6 +469,7 @@ Public Class MainMenuVM
|
||||
MessageBox.Show(EgtMsg(61891), EgtMsg(MSG_MESSAGEBOX + 1), MessageBoxButton.OK, MessageBoxImage.Error)
|
||||
Return
|
||||
End If
|
||||
Dim FileToSendList As New List(Of String)
|
||||
' Recupero indirizzo a cui spedire la mail
|
||||
Dim sSupportAddress As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_SUPPORT, "support@egaltech.com", sSupportAddress)
|
||||
@@ -484,48 +506,19 @@ Public Class MainMenuVM
|
||||
End If
|
||||
Dim sExportFileName = Map.refProjManagerVM.CurrProj.nProjId.ToString("0000") & " - " & Map.refProjManagerVM.CurrProj.sBTLFileName & " - ProjectExport"
|
||||
Dim sExpZipToCreate = Map.refProjManagerVM.ExportProject(sExportFileName)
|
||||
' Creo zip file da allegare
|
||||
Dim sZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip"
|
||||
If File.Exists(sZipToCreate) Then
|
||||
File.Delete(sZipToCreate)
|
||||
|
||||
|
||||
' creo zip del progetto esportato, BTLFeatures.ini e Log
|
||||
Dim sExpAndMoreZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\" & sExportFileName & " and more.zip"
|
||||
If File.Exists(sExpAndMoreZipToCreate) Then
|
||||
File.Delete(sExpAndMoreZipToCreate)
|
||||
End If
|
||||
Try
|
||||
Using zip As New Ionic.Zip.ZipFile(sZipToCreate, Console.Out)
|
||||
Using zip As New Ionic.Zip.ZipFile(sExpAndMoreZipToCreate, Console.Out)
|
||||
' aggiungo progetto esportato
|
||||
If File.Exists(sExpZipToCreate) Then
|
||||
zip.AddItem(sExpZipToCreate, "")
|
||||
End If
|
||||
' aggiungo Prod e Proj associati
|
||||
Dim ProdId As Integer
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
ProdId = Map.refProjManagerVM.CurrProj.nProdId
|
||||
Case Pages.MACHINING
|
||||
ProdId = Map.refProdManagerVM.CurrProd.nProdId
|
||||
End Select
|
||||
If ProdId = 0 Then
|
||||
zip.AddItem(Map.refProjManagerVM.CurrProj.sProjDirPath, "Projs\" & Map.refProjManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
Else
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProdId)
|
||||
' se piu' di uno
|
||||
If IsNothing(ProjFileMList) Then
|
||||
Return
|
||||
ElseIf ProjFileMList.Count > 0 Then
|
||||
Dim ProjFileVMList As New List(Of ProjectFileVM)
|
||||
For Each Project In ProjFileMList
|
||||
ProjFileVMList.Add(New ProjFileVM(Project))
|
||||
Next
|
||||
For Each ProjFileVMItem In ProjFileVMList
|
||||
zip.AddItem(ProjFileVMItem.sProjDirPath, "Projs\" & ProjFileVMItem.nProjId.ToString("0000"))
|
||||
Next
|
||||
zip.AddItem(ProjFileVMList(0).sProdDirPath, "Prods\" & ProjFileVMList(0).nProdId.ToString("0000"))
|
||||
End If
|
||||
End If
|
||||
' aggiungo cartella macchina del progetto
|
||||
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
|
||||
If Directory.Exists(sMachineDir) Then
|
||||
zip.AddItem(sMachineDir, sMachineName)
|
||||
End If
|
||||
' aggiungo file log
|
||||
If File.Exists(Map.refMainWindowVM.MainWindowM.sLogFile) Then
|
||||
zip.AddItem(Map.refMainWindowVM.MainWindowM.sLogFile, "")
|
||||
@@ -537,30 +530,167 @@ Public Class MainMenuVM
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sExpAndMoreZipToCreate)
|
||||
|
||||
' creo zip della cartella macchina
|
||||
Dim sMachineZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\" & sMachineName & ".zip"
|
||||
If File.Exists(sMachineZipToCreate) Then
|
||||
File.Delete(sMachineZipToCreate)
|
||||
End If
|
||||
Using zip As New Ionic.Zip.ZipFile(sMachineZipToCreate, Console.Out)
|
||||
' aggiungo cartella macchina del progetto
|
||||
Dim sMachineDir As String = Map.refMainWindowVM.MainWindowM.sMachinesRoot & "\" & sMachineName
|
||||
If Directory.Exists(sMachineDir) Then
|
||||
zip.AddItem(sMachineDir, sMachineName)
|
||||
End If
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sMachineZipToCreate)
|
||||
|
||||
' aggiungo Prod e Proj associati
|
||||
Dim ProdId As Integer
|
||||
Select Case Map.refMainMenuVM.SelPage
|
||||
Case Pages.VIEW
|
||||
ProdId = Map.refProjManagerVM.CurrProj.nProdId
|
||||
Case Pages.MACHINING
|
||||
ProdId = Map.refProdManagerVM.CurrProd.nProdId
|
||||
End Select
|
||||
If ProdId = 0 Then
|
||||
' Creo zip del Proj
|
||||
Dim sProjZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Projs.zip"
|
||||
If File.Exists(sProjZipToCreate) Then
|
||||
File.Delete(sProjZipToCreate)
|
||||
End If
|
||||
' aggiungo lo zip del solo Proj
|
||||
Using zip As New Ionic.Zip.ZipFile(sProjZipToCreate, Console.Out)
|
||||
zip.AddItem(Map.refProjManagerVM.CurrProj.sProjDirPath, "Projs\" & Map.refProjManagerVM.CurrProj.nProjId.ToString("0000"))
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProjZipToCreate)
|
||||
Else
|
||||
ProjFileMList = DbControllers.m_ProjController.GetByProdAsc(ProdId)
|
||||
' se piu' di uno
|
||||
If IsNothing(ProjFileMList) Then
|
||||
Return
|
||||
ElseIf ProjFileMList.Count > 0 Then
|
||||
Dim ProjFileVMList As New List(Of ProjectFileVM)
|
||||
For Each Project In ProjFileMList
|
||||
ProjFileVMList.Add(New ProjFileVM(Project))
|
||||
Next
|
||||
' prima creo zip del Proj
|
||||
Dim sProjZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Projs.zip"
|
||||
If File.Exists(sProjZipToCreate) Then
|
||||
File.Delete(sProjZipToCreate)
|
||||
End If
|
||||
' aggiungo lo zip del Proj riempiendolo con tutti i Proj associati
|
||||
Using zip As New Ionic.Zip.ZipFile(sProjZipToCreate, Console.Out)
|
||||
For Each ProjFileVMItem In ProjFileVMList
|
||||
zip.AddItem(ProjFileVMItem.sProjDirPath, "Projs\" & ProjFileVMItem.nProjId.ToString("0000"))
|
||||
Next
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProjZipToCreate)
|
||||
' ora creo zip del Prod
|
||||
Dim sProdZipToCreate As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Prods.zip"
|
||||
If File.Exists(sProdZipToCreate) Then
|
||||
File.Delete(sProdZipToCreate)
|
||||
End If
|
||||
' ora aggiungo lo zip del Prod
|
||||
Using zip As New Ionic.Zip.ZipFile(sProdZipToCreate, Console.Out)
|
||||
zip.AddItem(ProjFileVMList(0).sProdDirPath, "Prods\" & ProjFileVMList(0).nProdId.ToString("0000"))
|
||||
' salvo lo zip
|
||||
zip.Save()
|
||||
End Using
|
||||
FileToSendList.Add(sProdZipToCreate)
|
||||
End If
|
||||
End If
|
||||
Catch ex1 As Exception
|
||||
EgtOutLog("Exception in zip: " & ex1.ToString())
|
||||
End Try
|
||||
' preparo la mail per il supporto
|
||||
Dim bEx As Boolean = False
|
||||
Try
|
||||
Dim sAddressArray As String() = sSupportAddress.Split(CType(",", Char()))
|
||||
Dim SendFeedbackWindow As New EgtWPFLib5.MapiMailMessage("EgtBEAMWALL Feedback - " & sKey)
|
||||
SendFeedbackWindow.Recipients.Add(sAddressArray(0))
|
||||
For index As Integer = 1 To sAddressArray.Length() - 1
|
||||
SendFeedbackWindow.Recipients.Add(sAddressArray(index), EgtWPFLib5.MapiMailMessage.RecipientType.CC)
|
||||
|
||||
' recupero codice chiave di protezione
|
||||
'Dim sLicFileName As String = String.Empty
|
||||
'GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
|
||||
'Dim sLicFile As String = Map.refMainWindowVM.MainWindowM.sConfigDir & "\" & sLicFileName
|
||||
'Dim sKey As String = String.Empty
|
||||
'EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
|
||||
|
||||
' recupero contatti cliente
|
||||
Dim sContactEmail As String = String.Empty
|
||||
Dim sContactName As String = String.Empty
|
||||
Dim sContactPhone As String = String.Empty
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTEMAIL, "", sContactEmail)
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTNAME, "", sContactName)
|
||||
GetMainPrivateProfileString(S_CUSTOMERCONTACT, K_CONTACTPHONE, "", sContactPhone)
|
||||
|
||||
Dim sp As SupportRequest = New SupportRequest("Uploader",
|
||||
sKey,
|
||||
"EgalWare",
|
||||
sContactEmail,
|
||||
sContactName,
|
||||
sContactPhone,
|
||||
"4AIc8fMEXcSyDIMl1Ro05O/1xar7nrVHXAQzrh/fmxfvlczA13tQwXAqida6hTqV",
|
||||
"Upload da sendlog di EGT BeamWall",
|
||||
0,
|
||||
TipologiaTicket.FileUpload)
|
||||
|
||||
' specifico le cartelle Data (da cui prendere i file) e Archive (in cui archiviare i file)
|
||||
Dim sDataFolderPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Data"
|
||||
Dim sArchiveFolderPath As String = Map.refMainWindowVM.MainWindowM.sTempDir & "\Archive"
|
||||
' creo le cartelle
|
||||
DeleteDirectory(sDataFolderPath)
|
||||
Directory.CreateDirectory(sDataFolderPath)
|
||||
If Not Directory.Exists(sArchiveFolderPath) Then
|
||||
Directory.CreateDirectory(sArchiveFolderPath)
|
||||
End If
|
||||
' muovo zip e json nella cartella Data
|
||||
For Each FileName In FileToSendList
|
||||
Dim mFile As FileInfo = New FileInfo(FileName)
|
||||
mFile.MoveTo(sDataFolderPath & "\" & mFile.Name)
|
||||
Next
|
||||
SupportRequest.SaveRequest(sp, sDataFolderPath & "\request.json")
|
||||
|
||||
' eseguo LiMan Transfer con le 2 cartelle come argomenti
|
||||
Dim Proc = New Process()
|
||||
Proc.StartInfo.FileName = Map.refMainWindowVM.MainWindowM.sLiManTransferExe
|
||||
Proc.StartInfo.Arguments = sDataFolderPath & " " & sArchiveFolderPath
|
||||
Proc.StartInfo.CreateNoWindow = True
|
||||
Proc.StartInfo.UseShellExecute = False
|
||||
AddHandler Proc.Exited, AddressOf Proc_Exited
|
||||
|
||||
For Inde = 0 To 100
|
||||
If Not m_LiManTimer.IsEnabled Then Exit For
|
||||
Threading.Thread.Sleep(100)
|
||||
Next
|
||||
If Not m_LiManTimer.IsEnabled AndAlso Proc.Start() Then
|
||||
m_LiManTimer.Start()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Proc_Exited()
|
||||
m_LiManTimer.Stop()
|
||||
End Sub
|
||||
|
||||
Private Sub LiManTimer_Tick()
|
||||
m_LiManTimer.Stop()
|
||||
EgtOutLog("LiMan Transfer timeout!")
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteDirectory(path As String)
|
||||
If Directory.Exists(path) Then
|
||||
'Delete all files from the Directory
|
||||
For Each filepath As String In Directory.GetFiles(path)
|
||||
File.Delete(filepath)
|
||||
Next
|
||||
If Not String.IsNullOrWhiteSpace(sZipToCreate) AndAlso File.Exists(sZipToCreate) Then
|
||||
SendFeedbackWindow.Files.Add(Map.refMainWindowVM.MainWindowM.sTempDir & "\Feedback.zip")
|
||||
End If
|
||||
SendFeedbackWindow.ShowDialog()
|
||||
Catch ex As Exception
|
||||
EgtOutLog("Feedback exception: " & ex.ToString)
|
||||
bEx = True
|
||||
End Try
|
||||
If bEx OrElse EgtWPFLib5.MapiMailMessage.m_ErrorCode <> 0 Then
|
||||
MessageBox.Show(String.Format(EgtMsg(MSG_TOPCOMMANDBAR + 12), sSupportAddress, sZipToCreate), EgtMsg(MSG_MESSAGEBOX + 3), MessageBoxButton.OK, MessageBoxImage.Information)
|
||||
Else
|
||||
Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(MSG_TOPCOMMANDBAR + 14))
|
||||
'Delete all child Directories
|
||||
For Each dir As String In Directory.GetDirectories(path)
|
||||
DeleteDirectory(dir)
|
||||
Next
|
||||
'Delete a Directory
|
||||
Directory.Delete(path)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -152,6 +152,14 @@ Public Class MainWindowM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Friend ReadOnly Property sLiManTransferExe As String
|
||||
Get
|
||||
Dim sTransferExe As String = ""
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LIMANUTILITIES, LIMANTRANSFER_EXE, sTransferExe)
|
||||
Return sTransferExe
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' FIELDS
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
<EgtWPFLib5:EgtCustomWindow x:Class="MovePartInRawPartWndV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.ViewerOptimizer"
|
||||
Style="{DynamicResource {x:Type EgtWPFLib5:EgtCustomWindow}}"
|
||||
WindowStyle="None" ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
IsClosable="False"
|
||||
IsMinimizable="False"
|
||||
IsResizable="False"
|
||||
Title="MovePartInRawPartWndV">
|
||||
<Grid Margin="5,5,5,0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid HorizontalAlignment="Center"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MoveDirMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,5"/>
|
||||
|
||||
<RadioButton IsChecked="{Binding LeftIsChecked}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"
|
||||
Grid.Row="1" Grid.Column="0">
|
||||
<Image Source="/Resources/MovePartInRawPart/MoveLeftParts.png" Stretch="Uniform"/>
|
||||
</RadioButton>
|
||||
<RadioButton IsChecked="{Binding RightIsChecked}"
|
||||
Style="{StaticResource ToolBar_ToggleButton}"
|
||||
Grid.Row="1" Grid.Column="1">
|
||||
<Image Source="/Resources/MovePartInRawPart/MoveRightParts.png" Stretch="Uniform"/>
|
||||
</RadioButton>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MoveLenMsg}"
|
||||
Style="{StaticResource OptionTextBlock}"
|
||||
HorizontalAlignment="Center"
|
||||
Margin="0,5"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sMoveLen}"
|
||||
Grid.Row="1"
|
||||
Width="200"/>
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="3"
|
||||
Margin="0,0,0,5">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
IsDefault="True"
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
<Button Content="Cancel"
|
||||
IsCancel="True"
|
||||
Grid.Column="3"
|
||||
Style="{StaticResource EgtWPFLib5_InputButton}"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</EgtWPFLib5:EgtCustomWindow>
|
||||
@@ -0,0 +1,18 @@
|
||||
Public Class MovePartInRawPartWndV
|
||||
|
||||
Private WithEvents m_MovePartInRawPartWndVM As MovePartInRawPartWndVM
|
||||
|
||||
Sub New(Owner As Window, MovePartInRawPartWndVM As MovePartInRawPartWndVM)
|
||||
MyBase.New(Owner)
|
||||
' This call is required by the designer.
|
||||
InitializeComponent()
|
||||
Me.DataContext = MovePartInRawPartWndVM
|
||||
' Assegno al riferimento locale al VM il VM preso dal DataContext
|
||||
m_MovePartInRawPartWndVM = MovePartInRawPartWndVM
|
||||
End Sub
|
||||
|
||||
Private Sub CloseWindow(bDialogResult As Boolean) Handles m_MovePartInRawPartWndVM.m_CloseWindow
|
||||
Me.DialogResult = bDialogResult
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,147 @@
|
||||
Imports EgtWPFLib5
|
||||
Imports EgtUILib
|
||||
|
||||
Public Class MovePartInRawPartWndVM
|
||||
Inherits VMBase
|
||||
|
||||
#Region "FIELDS & PROPERTIES"
|
||||
|
||||
Friend Event m_CloseWindow(bDialogResult As Boolean)
|
||||
|
||||
Private m_dMoveLen As Double
|
||||
Public ReadOnly Property dMoveLen As Double
|
||||
Get
|
||||
Return m_dMoveLen
|
||||
End Get
|
||||
End Property
|
||||
Public Property sMoveLen As String
|
||||
Get
|
||||
Return LenToString(m_dMoveLen, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
Dim dTempMoveLen As Double
|
||||
If StringToLen(value, dTempMoveLen) AndAlso dTempMoveLen > 0 Then
|
||||
m_dMoveLen = dTempMoveLen
|
||||
Else
|
||||
m_dMoveLen = 0
|
||||
NotifyPropertyChanged(NameOf(sMoveLen))
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LeftIsChecked As Boolean
|
||||
Public Property LeftIsChecked As Boolean
|
||||
Get
|
||||
Return m_LeftIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_LeftIsChecked Then
|
||||
m_LeftIsChecked = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_RightIsChecked As Boolean
|
||||
Public Property RightIsChecked As Boolean
|
||||
Get
|
||||
Return m_RightIsChecked
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_RightIsChecked Then
|
||||
m_RightIsChecked = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdOk As ICommand
|
||||
|
||||
#End Region ' FIELDS & PROPERTIES
|
||||
|
||||
#Region "MESSAGES"
|
||||
|
||||
Public ReadOnly Property MoveDirMsg As String
|
||||
Get
|
||||
Return EgtMsg(61945)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MoveLenMsg As String
|
||||
Get
|
||||
Return EgtMsg(61946)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' MESSAGES
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
Sub New()
|
||||
' setto il bottone Left a premuto
|
||||
LeftIsChecked = True
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "Ok"
|
||||
|
||||
Public ReadOnly Property Ok_Command As ICommand
|
||||
Get
|
||||
If m_cmdOk Is Nothing Then
|
||||
m_cmdOk = New Command(AddressOf Ok)
|
||||
End If
|
||||
Return m_cmdOk
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub Ok()
|
||||
' verifico che il campo dello spostamento abbia un valore valido
|
||||
If Not IsNothing(m_dMoveLen) AndAlso m_dMoveLen > 0 Then
|
||||
' calcolo BBox globale del grezzo
|
||||
Dim b3RawPart As New BBox3d
|
||||
EgtGetBBoxGlob(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id, GDB_BB.ONLY_VISIBLE, b3RawPart)
|
||||
' calcolo BBox globale dei pezzi aggiunti al grezzo
|
||||
Dim b3Parts As New BBox3d
|
||||
For Each Part In Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.PartVMList
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(Part.nPartId, GDB_BB.ONLY_VISIBLE, b3Part)
|
||||
b3Parts.Add(b3Part)
|
||||
Next
|
||||
' ricavo coordinate minime e massime sull'asse X dei BBox del grezzo e dei pezzi
|
||||
Dim dRawPartMinL As Double = b3RawPart.Min.x
|
||||
Dim dRawPartMaxL As Double = b3RawPart.Max.x
|
||||
Dim dPartsMinL As Double = b3Parts.Min.x
|
||||
Dim dPartsMaxL As Double = b3Parts.Max.x
|
||||
' ricavo il vettore di spostamento
|
||||
Dim vtMove As Vector3d = New Vector3d(If(LeftIsChecked, dMoveLen, -dMoveLen), 0, 0)
|
||||
' verifico che i pezzi venendo mossi non escano dal box
|
||||
If dPartsMinL + vtMove.x > dRawPartMinL And dPartsMaxL + vtMove.x < dRawPartMaxL Then
|
||||
' muovo i pezzi di quanto possibile
|
||||
If vtMove.SqLen() > EPS_SMALL * EPS_SMALL Then
|
||||
' muovo tutti i pezzi della lista
|
||||
For Each Part In Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.PartVMList
|
||||
EgtMovePartInRawPart(Part.nPartId, vtMove)
|
||||
' aggiorno valori nella tabella
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.dPOSX))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.sPOSX))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.dPOSY))
|
||||
Part.NotifyPropertyChanged(NameOf(PartVM.sPOSY))
|
||||
EgtZoom(ZM.ALL)
|
||||
Next
|
||||
End If
|
||||
RaiseEvent m_CloseWindow(True)
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61947), EgtMsg(30007))
|
||||
End If
|
||||
Else
|
||||
MessageBox.Show(EgtMsg(61948), EgtMsg(30007))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Ok
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -58,7 +58,6 @@
|
||||
</Button>-->
|
||||
<Button Command="{Binding UpdateBTL_Command}"
|
||||
ToolTip="{Binding UpdateBTL_ToolTip}"
|
||||
Visibility="Collapsed"
|
||||
Style="{StaticResource ToolBar_Button}">
|
||||
<Image Source="/Resources/ProjectManager/UpdateBTL.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
|
||||
@@ -100,6 +100,7 @@ Public Class ProjManagerVM
|
||||
Private m_cmdExport As ICommand
|
||||
Private m_cmdDxfOut As ICommand
|
||||
Private m_cmdImportBTL As ICommand
|
||||
Private m_cmdUpdateBTL As ICommand
|
||||
Private m_cmdImportProject As ICommand
|
||||
Private m_cmdExportProject As ICommand
|
||||
Private m_cmdGoToProd As ICommand
|
||||
@@ -551,6 +552,7 @@ Public Class ProjManagerVM
|
||||
.DefaultExt = ".btl",
|
||||
.Filter = "BTL (*.btl)|*.btl" &
|
||||
"|BTLX (*.btlx)|*.btlx",
|
||||
.InitialDirectory = sDir,
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If BTLDlg.ShowDialog() Then
|
||||
@@ -732,6 +734,125 @@ Public Class ProjManagerVM
|
||||
|
||||
#End Region ' ImportBTL
|
||||
|
||||
#Region "UpdateBTL"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do UpdateBTL.
|
||||
''' </summary>
|
||||
Public ReadOnly Property UpdateBTL_Command As ICommand
|
||||
Get
|
||||
If m_cmdUpdateBTL Is Nothing Then
|
||||
m_cmdUpdateBTL = New Command(AddressOf UpdateBTL)
|
||||
End If
|
||||
Return m_cmdUpdateBTL
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the UpdateBTL. This method is invoked by the UpdateBTLCommand.
|
||||
''' </summary>
|
||||
Public Sub UpdateBTL(Optional sFile As String = "", Optional bWithDlg As Boolean = True)
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, "", sDir)
|
||||
If bWithDlg Then
|
||||
' apro finestra scelta file
|
||||
Dim BTLDlg As New Microsoft.Win32.OpenFileDialog() With {
|
||||
.DefaultExt = ".btl",
|
||||
.Filter = "BTL (*.btl)|*.btl" &
|
||||
"|BTLX (*.btlx)|*.btlx",
|
||||
.InitialDirectory = sDir,
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If BTLDlg.ShowDialog() Then
|
||||
sFile = BTLDlg.FileName
|
||||
Else
|
||||
Return
|
||||
End If
|
||||
End If
|
||||
' creo un nuovo contesto su cui aprire il file BTL
|
||||
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||
Dim nTempCtx As Integer = EgtInitContext()
|
||||
Dim bOk As Boolean = nTempCtx <> 0
|
||||
If bOk Then
|
||||
' importo il file BTL
|
||||
bOk = bOk AndAlso EgtImportBtl(sFile)
|
||||
' rimuovo i parametri generali e salvo come file NGE
|
||||
Dim AsseBaseId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
Dim BtlInfoId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtErase(AsseBaseId)
|
||||
EgtErase(BtlInfoId)
|
||||
EgtSaveFile("C:\EgtData\EgtBEAMWALL\Temp\Prova.nge", NGE.CMPTEXT)
|
||||
' torno sul contesto corrente
|
||||
EgtSetCurrentContext(nCurrCtx)
|
||||
EgtDeleteContext(nTempCtx)
|
||||
' calcolo BBox globale del progetto iniziale
|
||||
Dim b3Parts As New BBox3d
|
||||
Dim nProjPartId As Integer = EgtGetFirstPart()
|
||||
Dim nLastProjPartId As Integer = 0
|
||||
While nProjPartId <> GDB_ID.NULL
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nProjPartId, GDB_BB.ONLY_VISIBLE, b3Part)
|
||||
b3Parts.Add(b3Part)
|
||||
nLastProjPartId = nProjPartId
|
||||
nProjPartId = EgtGetNextPart(nProjPartId)
|
||||
End While
|
||||
' inserisco il file importato nel progetto corrente
|
||||
bOk = bOk AndAlso EgtInsertFile("C:\EgtData\EgtBEAMWALL\Temp\Prova.nge")
|
||||
' deseleziono tutto
|
||||
EgtDeselectAll()
|
||||
' ciclo sui pezzi aggiunti
|
||||
Dim nAddedPartId As Integer = EgtGetNextPart(nLastProjPartId)
|
||||
Dim bFirstLoop As Boolean = True
|
||||
Dim LastPartMaxY As Double
|
||||
While nAddedPartId <> GDB_ID.NULL
|
||||
' recupero layer del box
|
||||
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(nAddedPartId, "Box")
|
||||
' recupero box del layer box
|
||||
Dim b3Box As New BBox3d
|
||||
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.STANDARD, b3Box)
|
||||
' eseguo rotazione del pezzo
|
||||
Dim ptRot = b3Box.Min() + New Vector3d(0, b3Box.DimZ() / 2, b3Box.DimZ() / 2)
|
||||
bOk = bOk AndAlso EgtRotate(nAddedPartId, ptRot, -Vector3d.X_AX, -90)
|
||||
' ricaviamo il box globale del part appena aggiunto e ruotato
|
||||
Dim b3Part As New BBox3d
|
||||
EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
|
||||
' sposto il pezzo per distanziarlo dall'ultimo di un offset pari a 500
|
||||
bOk = bOk AndAlso EgtMove(nAddedPartId, New Vector3d(0, If(bFirstLoop, b3Parts.DimY(), LastPartMaxY - b3Part.Min.y) + 500, 0))
|
||||
bFirstLoop = False
|
||||
' ricaviamo il box globale del part appena spostato, salviamo la sua Y massima e lo aggiungiamo al box globale di tutti i part
|
||||
EgtGetBBoxGlob(nAddedPartId, 1, b3Part)
|
||||
LastPartMaxY = b3Part.Max.y
|
||||
b3Parts.Add(b3Part)
|
||||
nAddedPartId = EgtGetNextPart(nAddedPartId)
|
||||
End While
|
||||
' aggiungo i part inseriti alla lista
|
||||
Dim nNewPartId As Integer = EgtGetNextPart(nLastProjPartId)
|
||||
While nNewPartId <> GDB_ID.NULL
|
||||
' aggiungo dati pezzo
|
||||
Dim NewPart As BTLPartM = BTLPartM.CreateBTLPart(nNewPartId)
|
||||
' aggiungo pezzo alla lista
|
||||
Map.refProjectVM.BTLStructureVM.BTLStructureM.AddBTLPart(NewPart)
|
||||
Dim AddedBTLPart As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart) 'Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.BTLPartM Is NewPart)
|
||||
' verifico se aggiungere sezione alla lista
|
||||
If Not Map.refProjectVM.BTLStructureVM.SectionList.Contains(AddedBTLPart.Section) Then
|
||||
Map.refProjectVM.BTLStructureVM.SectionList.Add(AddedBTLPart.Section)
|
||||
End If
|
||||
nNewPartId = EgtGetNextPart(nNewPartId)
|
||||
End While
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTUPDATEDIR, Path.GetDirectoryName(sFile))
|
||||
End If
|
||||
'If bOk Then
|
||||
' ' riporto aggiunta proj a prod su Db
|
||||
' DbControllers.m_ProdController.AddProj(OpenProjectFileDialogVM.SelProject.nProdId, Map.refProjManagerVM.CurrProj.nProjId)
|
||||
' ' imposto currprod
|
||||
' Map.refProdManagerVM.SetCurrProd(OpenProjectFileDialogVM.SelProject.nProdId)
|
||||
'End If
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
#End Region ' UpdateBTL
|
||||
|
||||
#Region "ExportProject"
|
||||
|
||||
''' <summary>
|
||||
@@ -864,10 +985,11 @@ Public Class ProjManagerVM
|
||||
Dim ErrorList As New List(Of String)
|
||||
If Not ProjFileVM.VerifyProjectModification(CurrProj, ProjectType.PROJ) Then Return
|
||||
Dim sDir As String = String.Empty
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, "", sDir)
|
||||
GetMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, "", sDir)
|
||||
' apro finestra scelta file
|
||||
Dim ImportDlg As New Microsoft.Win32.OpenFileDialog() With {.DefaultExt = ".ngexp",
|
||||
.Filter = "ProjectExport (*.ngexp)|*.ngexp",
|
||||
.InitialDirectory = sDir,
|
||||
.CheckFileExists = True,
|
||||
.ValidateNames = True}
|
||||
If ImportDlg.ShowDialog() <> True Then Return
|
||||
@@ -1085,6 +1207,7 @@ Public Class ProjManagerVM
|
||||
End If
|
||||
' ripristino eventuale CurrProd precedente
|
||||
Map.refProdManagerVM.CurrProd = CurrProd
|
||||
WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEXPDIR, Path.GetDirectoryName(ImportDlg.FileName))
|
||||
''' imposto progetto corrente
|
||||
''If NewProjIdList.Count > 0 Then SetCurrProj(NewProjIdList(0))
|
||||
''' costruisco BTLStructure del proj
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 449 B |
Binary file not shown.
|
After Width: | Height: | Size: 427 B |
Binary file not shown.
|
After Width: | Height: | Size: 379 B |
@@ -678,7 +678,7 @@ Public Class MySceneHostVM
|
||||
' scrivo info proj e type su layer BtlInfo
|
||||
Dim nBTLInfoLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, BTLINFO)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, nType)
|
||||
EgtSetInfo(nBTLInfoLayer, BTL_GEN_PROJTYPE, Map.refProjManagerVM.CurrProj.nType)
|
||||
' scrivo info proj su layer AsseBase
|
||||
Dim nAsseBaseLayer As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, ASSEBASE)
|
||||
EgtSetInfo(nAsseBaseLayer, BTL_PRT_PROJ, Map.refProjManagerVM.nLoadingProjId)
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/TopPanel/RemoveRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
<Button Command="{Binding MovePartInRawPart_Command}"
|
||||
ToolTip="{Binding MovePartInRawPart_ToolTip}"
|
||||
IsEnabled="{Binding TopPanel_IsEnabled}"
|
||||
Style="{StaticResource LeftPanel_Button}">
|
||||
<Image Source="/Resources/TopPanel/MovePartInRawPart.png" Stretch="Uniform"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<EgtBEAMWALL:RawPartListV Grid.Column="1"
|
||||
|
||||
@@ -63,6 +63,7 @@ Public Class TopPanelVM
|
||||
Private m_cmdMoveUpPart As ICommand
|
||||
Private m_cmdMoveDownPart As ICommand
|
||||
Private m_cmdReOrderPart As ICommand
|
||||
Private m_cmdMovePartInRawPart As ICommand
|
||||
|
||||
Public ReadOnly Property MovePart_Visibility As Visibility
|
||||
Get
|
||||
@@ -129,6 +130,12 @@ Public Class TopPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property MovePartInRawPart_ToolTip As String
|
||||
Get
|
||||
Return EgtMsg(61944)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#End Region ' Messages
|
||||
|
||||
#End Region 'FIELDS & PROPERTIES
|
||||
@@ -471,6 +478,32 @@ Public Class TopPanelVM
|
||||
|
||||
#End Region ' ReOrderPart
|
||||
|
||||
#Region "MovePartInRawPart"
|
||||
|
||||
''' <summary>
|
||||
''' Returns a command that do Exec.
|
||||
''' </summary>
|
||||
Public ReadOnly Property MovePartInRawPart_Command As ICommand
|
||||
Get
|
||||
If m_cmdMovePartInRawPart Is Nothing Then
|
||||
m_cmdMovePartInRawPart = New Command(AddressOf MovePartInRawPart)
|
||||
End If
|
||||
Return m_cmdMovePartInRawPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
''' <summary>
|
||||
''' Execute the Exec. This method is invoked by the ExecCommand.
|
||||
''' </summary>
|
||||
Public Sub MovePartInRawPart()
|
||||
If IsNothing(Map.refProdManagerVM.CurrProd) Then Return
|
||||
Dim MovePartInRawPartWndVM As New MovePartInRawPartWndVM()
|
||||
Dim MovePartInRawPartWnd As New MovePartInRawPartWndV(Application.Current.MainWindow, MovePartInRawPartWndVM)
|
||||
If Not MovePartInRawPartWnd.ShowDialog() Then Return
|
||||
End Sub
|
||||
|
||||
#End Region ' MovePartInRawPart
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
SelectionMode="Single"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Auto"
|
||||
Margin="5"
|
||||
BindingColumns="{Binding SParamColumns}">
|
||||
<DataGrid.Resources>
|
||||
|
||||
@@ -903,6 +903,10 @@ Public Class WarehouseWndVM
|
||||
' carico le colonne della datagrid
|
||||
GetPrivateProfileColumns(S_SPARAMLIST_WALL, SParamColumns)
|
||||
End If
|
||||
' aggiorno la visibilità delle colonne
|
||||
For Each col In SParamColumns
|
||||
col.ColumnVisibility = If(col.Visible, Visibility.Visible, Visibility.Collapsed)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Sub CheckExistingSectionXMaterial()
|
||||
|
||||
@@ -11,46 +11,78 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EgtBEAMWALL.DataLayer", "Eg
|
||||
EndProject
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "EgtBEAMWALL.Core", "EgtBEAMWALL.Core\EgtBEAMWALL.Core.vbproj", "{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LiMan.Core", "LiMan.Core\LiMan.Core.csproj", "{B61508B2-20CB-45D9-8C00-209A22C44DE5}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x64.Build.0 = Debug|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Debug|x86.Build.0 = Debug|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.ActiveCfg = Release|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x64.Build.0 = Release|x64
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.ActiveCfg = Release|x86
|
||||
{57291955-F9C4-4466-8D53-476D43BA3659}.Release|x86.Build.0 = Release|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x64.Build.0 = Debug|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Debug|x86.Build.0 = Debug|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.ActiveCfg = Release|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x64.Build.0 = Release|x64
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.ActiveCfg = Release|x86
|
||||
{B71DA327-38C8-4305-BBA1-34F3F3F32405}.Release|x86.Build.0 = Release|x86
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x64.Build.0 = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{24D7760E-662A-47E4-B729-B70126C24A31}.Release|x86.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{F22835A1-83D8-4334-91BB-BAAEB9CF59B1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|x64.Build.0 = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{B61508B2-20CB-45D9-8C00-209A22C44DE5}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B61508B2-20CB-45D9-8C00-209A22C44DE5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>LiMan.Core</RootNamespace>
|
||||
<AssemblyName>LiMan.Core</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SupportRequest.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// Le informazioni generali relative a un assembly sono controllate dal seguente
|
||||
// set di attributi. Modificare i valori di questi attributi per modificare le informazioni
|
||||
// associate a un assembly.
|
||||
[assembly: AssemblyTitle("LiMan.Core")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("LiMan.Core")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2022")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili
|
||||
// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da
|
||||
// COM, impostare su true l'attributo ComVisible per tale tipo.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// Se il progetto viene esposto a COM, il GUID seguente verrà utilizzato come ID della libreria dei tipi
|
||||
[assembly: Guid("b61508b2-20cb-45d9-8c00-209a22c44de5")]
|
||||
|
||||
// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
|
||||
//
|
||||
// Versione principale
|
||||
// Versione secondaria
|
||||
// Numero di build
|
||||
// Revisione
|
||||
//
|
||||
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
// usando l'asterisco '*' come illustrato di seguito:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -0,0 +1,90 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LiMan.Core
|
||||
{
|
||||
public class SupportRequest
|
||||
{
|
||||
#region Public Properties
|
||||
|
||||
public string CodApp { get; set; } = "";
|
||||
public string CodImp { get; set; } = "";
|
||||
public string CodInst { get; set; } = "";
|
||||
public string ContactEmail { get; set; } = "";
|
||||
public string ContactName { get; set; } = "";
|
||||
public string ContactPhone { get; set; } = "";
|
||||
public int idxSubLic { get; set; } = 0;
|
||||
|
||||
public TipologiaTicket Tipo { get; set; } = TipologiaTicket.ND;
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get => !string.IsNullOrEmpty(MasterKey) && !string.IsNullOrEmpty(ContactEmail) && !string.IsNullOrEmpty(CodInst) && !string.IsNullOrEmpty(CodApp);
|
||||
}
|
||||
|
||||
public string MasterKey { get; set; } = "";
|
||||
public string ReqBody { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Istanzia un nuovo ogetto richeista supporto
|
||||
/// </summary>
|
||||
/// <param name="codApp">Codice Applicazione (es EBW-UP)</param>
|
||||
/// <param name="codImp">Codice Impegno (es codice chiave HW)</param>
|
||||
/// <param name="codInst">Codice Cliente/Installazione</param>
|
||||
/// <param name="contactEmail">Email x contatto</param>
|
||||
/// <param name="contactName">Nome del richiedente/clietne</param>
|
||||
/// <param name="contactPhone">Tel richeidente/cliente</param>
|
||||
/// <param name="masterKey">Chiave master di comunicazione da LiMan</param>
|
||||
/// <param name="ReqBody">Testo delal richiesta</param>
|
||||
/// <param name="idxSubLic">Idx univoco di sublic (es x gestione utenti)</param>
|
||||
/// <param name="tipo">tipo ticket da gestire (default fileUpload)</param>
|
||||
public SupportRequest(string codApp, string codImp, string codInst, string contactEmail, string contactName, string contactPhone, string masterKey, string ReqBody, int idxSubLic = 0, TipologiaTicket tipo = TipologiaTicket.FileUpload)
|
||||
{
|
||||
this.CodApp = codApp;
|
||||
this.CodImp = codImp;
|
||||
this.CodInst = codInst;
|
||||
this.ContactEmail = contactEmail;
|
||||
this.ContactName = contactName;
|
||||
this.ContactPhone = contactPhone;
|
||||
this.MasterKey = masterKey;
|
||||
this.ReqBody = ReqBody;
|
||||
this.idxSubLic = idxSubLic;
|
||||
this.Tipo = tipo;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Effettua salvataggio su file di un oggetto richiesta file upload
|
||||
/// </summary>
|
||||
/// <param name="currReq">Oggetto richiesta (già istanziato)</param>
|
||||
/// <param name="filePath">Path dove salvare il file</param>
|
||||
public static bool SaveRequest(SupportRequest currReq, string filePath)
|
||||
{
|
||||
bool fatto = false;
|
||||
try
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(currReq, Formatting.Indented);
|
||||
File.WriteAllText(filePath, rawData);
|
||||
fatto = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.Write(ex.ToString());
|
||||
}
|
||||
return fatto;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
public enum TipologiaTicket : int {
|
||||
ND = 0,
|
||||
User = 1,
|
||||
FileUpload = 2
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user