From 5c17576575d033febbdf5b4859ba0c5d96d68c45 Mon Sep 17 00:00:00 2001 From: Demetrio Cassarino Date: Mon, 3 Mar 2025 10:05:09 +0100 Subject: [PATCH] -pulizia codice --- AssemblyManager/AssemblyName.vb | 8 + AttachedBehavior/ScrollIntoView.vb | 17 +- Command/Command.vb | 8 +- CompoPanel/CompoPanelVM.vb | 27 +- CompoPanel/CompoType.vb | 42 +- Constants/ConstCompo.vb | 37 +- DataService/ThemesDataService.vb | 8 + DoorParameters/Compo.vb | 446 +++++++---- DoorParameters/Part.vb | 478 +++++++----- DoorParameters/PartPageV.xaml.vb | 6 +- DoorParameters/PartPageVM.vb | 241 +++--- DoorParameters/PropertyItem.vb | 30 +- EgtDOORCreator.vbproj | 4 + EgtDOORCreatorDarkDictionary.xaml | 2 +- EgtDOORCreatorDefaultStyle.xaml | 7 +- EgtDOORCreatorSummerDictonary.xaml | 898 +++++++++++++++++++++++ Guide/GuideV.xaml.vb | 8 + Guide/GuideViewModel.vb | 5 + HardwareGeometry/GeometryListConfigVM.vb | 150 ++-- HardwareManager/HardwarePageV.xaml | 6 - OptionsWindow/OptionsViewModel.vb | 4 + 21 files changed, 1894 insertions(+), 538 deletions(-) create mode 100644 EgtDOORCreatorSummerDictonary.xaml diff --git a/AssemblyManager/AssemblyName.vb b/AssemblyManager/AssemblyName.vb index 795855c..bc90326 100644 --- a/AssemblyManager/AssemblyName.vb +++ b/AssemblyManager/AssemblyName.vb @@ -4,6 +4,8 @@ Imports EgtWPFLib5 Public Class AssemblyName Inherits VMBase +#Region "FIELDS & PROPERTIES" + Private m_Name As String Public Property Name As String Get @@ -79,6 +81,10 @@ Public Class AssemblyName End Set End Property +#End Region ' Fields & Properties + +#Region "METHODS" + Private Sub MakeTitle() If OptionModule.m_SingleDoor AndAlso Map.refMainWindowVM.SelectedPage <> MainWindowVM.ListPageEnum.nHardwarePage AndAlso Not IsNothing(Map.refMainWindowVM.ProjectNameMsg) Then @@ -92,4 +98,6 @@ Public Class AssemblyName End If End Sub +#End Region ' Methods + End Class \ No newline at end of file diff --git a/AttachedBehavior/ScrollIntoView.vb b/AttachedBehavior/ScrollIntoView.vb index c57c566..2712566 100644 --- a/AttachedBehavior/ScrollIntoView.vb +++ b/AttachedBehavior/ScrollIntoView.vb @@ -4,10 +4,16 @@ Imports System.Collections.Specialized Public Class ScrollIntoViewForListBox Inherits Behavior(Of ListBox) +#Region "FIELDS & PROPERTIES" + Private ItemsSource As INotifyCollectionChanged Private ListControl As ListBox +#End Region ' Fields & Properties + +#Region "METHODS" + ''' ''' When Beahvior is attached ''' @@ -17,7 +23,6 @@ Public Class ScrollIntoViewForListBox AddHandler Me.AssociatedObject.SelectionChanged, AddressOf AssociatedObject_SelectionChanged End Sub - Private Sub AssociatedObject_CollectionChanged(sender As Object, e As System.Collections.Specialized.NotifyCollectionChangedEventArgs) If IsNothing(ItemsSource) Then Dim CurrItemsSource As IEnumerable = Me.AssociatedObject.ItemsSource @@ -74,15 +79,23 @@ Public Class ScrollIntoViewForListBox RemoveHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged End Sub +#End Region ' Methods + End Class Public Class ScrollIntoViewForDataGrid Inherits Behavior(Of DataGrid) +#Region "FIELDS & PROPERTIES" + Private ItemsSource As INotifyCollectionChanged Private DataGridControl As DataGrid +#End Region ' Fields & Properties + +#Region "METHODS" + ''' ''' When Beahvior is attached ''' @@ -154,4 +167,6 @@ Public Class ScrollIntoViewForDataGrid RemoveHandler ItemsSource.CollectionChanged, AddressOf AssociatedObject_CollectionChanged End Sub +#End Region ' Methods + End Class diff --git a/Command/Command.vb b/Command/Command.vb index 0cfdfbb..5ab47d3 100644 --- a/Command/Command.vb +++ b/Command/Command.vb @@ -1,14 +1,14 @@ Public Class Command Implements ICommand -#Region "Fields" +#Region "FIELDS & PROPERTIES" Private ReadOnly _execute As Action(Of Object) Private ReadOnly _canExecute As Predicate(Of Object) -#End Region ' Fields +#End Region ' Fields & Properties -#Region "Constructors" +#Region "CONSTRUCTORS" Public Sub New(ByVal execute As Action(Of Object)) Me.New(execute, Nothing) @@ -25,7 +25,7 @@ #End Region ' Constructors -#Region "ICommand Members" +#Region "ICOMMAND MEMBERS" Public Function CanExecute(ByVal parameter As Object) As Boolean Implements ICommand.CanExecute diff --git a/CompoPanel/CompoPanelVM.vb b/CompoPanel/CompoPanelVM.vb index 7edd15f..9113291 100644 --- a/CompoPanel/CompoPanelVM.vb +++ b/CompoPanel/CompoPanelVM.vb @@ -6,6 +6,8 @@ Imports System.IO Public Class CompoPanelVM Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_ErroLoadCompo As String = String.Empty Public ReadOnly Property ErrorLoadCompo As String Get @@ -63,6 +65,10 @@ Public Class CompoPanelVM ' definizione comando Private m_EnterRefreshCmd As ICommand +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(Page As String) m_PageName = Page 'Map.SetRefCompoPanelVM(Me) @@ -170,6 +176,8 @@ Public Class CompoPanelVM End If End Sub +#End Region ' Constructor + #Region "COMMANDS" #Region "CompoBtnCommand" @@ -257,12 +265,12 @@ Public Class CompoPanelVM Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nDDFPage Map.refSceneManagerVM.RefreshBtn() End If - Map.refProjectManagerVM.NotifyPropertyChanged("VisibilityCreateAssembly") + Map.refProjectManagerVM.NotifyPropertyChanged(NameOf(Map.refProjectManagerVM.VisibilityCreateAssembly)) End Sub #End Region ' GoToAssemblyBtnCommand -#Region "ENTERREFRESH" +#Region "RefreshCmd" Public ReadOnly Property RefreshCmd As ICommand Get @@ -277,21 +285,26 @@ Public Class CompoPanelVM Map.refSceneManagerVM.RefreshBtn() End Sub -#End Region ' EnterRefresh +#End Region ' RefreshCmd #End Region 'Commands +#Region "EVENTS" + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class - Public Class VerifyCompo +#Region "FIELDS & PROPERTIES" + Private m_sName As String Public ReadOnly Property sName As String Get @@ -310,9 +323,15 @@ Public Class VerifyCompo m_bExists = Exists End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(Name As String, Exists As Boolean) m_sName = Name m_bExists = Exists End Sub +#End Region ' Constructor + End Class \ No newline at end of file diff --git a/CompoPanel/CompoType.vb b/CompoPanel/CompoType.vb index 2a7126c..b3d0b14 100644 --- a/CompoPanel/CompoType.vb +++ b/CompoPanel/CompoType.vb @@ -1,10 +1,11 @@ -Imports System.IO -Imports System.Collections.ObjectModel +Imports System.Collections.ObjectModel Imports EgtWPFLib5 Public Class CompoType Inherits VMBase +#Region "FIELDS & PROPERTIES" + ' Folder Door Private m_FolderList As New ObservableCollection(Of CompoBrandDir) Public Property FolderList As ObservableCollection(Of CompoBrandDir) @@ -127,25 +128,13 @@ Public Class CompoType Return m_DDFMaterial End Get End Property - Public Sub SetDDFMaterial(DDFMaterial As String) m_DDFMaterial = DDFMaterial End Sub - Public Function LoadListTemplate() As Boolean - FolderList.Clear() - m_HardwareFolderList.Clear() - m_FrameFolderList.Clear() - m_FolderList.Clear() - GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList) - Return True - End Function +#End Region ' Fields & Properties - Public Function DeepCopy() As CompoType - Dim other As CompoType = DirectCast(Me.MemberwiseClone, CompoType) - other.LoadListTemplate() - Return other - End Function +#Region "CONSTRUCTORS" Sub New(sName As String, sDDFName As String, sPath As String, sJambSide As String, sFolderName As String, Optional sDDFMaterial As String = "wood") m_Name = sName @@ -168,4 +157,25 @@ Public Class CompoType LoadListTemplate() End Sub +#End Region ' Constructors + +#Region "METHODS" + + Public Function LoadListTemplate() As Boolean + FolderList.Clear() + m_HardwareFolderList.Clear() + m_FrameFolderList.Clear() + m_FolderList.Clear() + GetDirectoryCompoModel(m_Path, m_FolderList, m_FrameFolderList, m_HardwareFolderList) + Return True + End Function + + Public Function DeepCopy() As CompoType + Dim other As CompoType = DirectCast(Me.MemberwiseClone, CompoType) + other.LoadListTemplate() + Return other + End Function + +#End Region ' Methods + End Class diff --git a/Constants/ConstCompo.vb b/Constants/ConstCompo.vb index 7affd31..a7a701f 100644 --- a/Constants/ConstCompo.vb +++ b/Constants/ConstCompo.vb @@ -21,41 +21,41 @@ Module ConstCompo Public Const S_MEASURES As String = "measures" Public Const S_CODE As String = "code" Public Const S_ORDER As String = "order" - Public Const K_CUSTOMER As String = "customer" - Public Const K_ELEVATION As String = "elevation" + Public Const K_CUSTOMER As String = "customer" + Public Const K_ELEVATION As String = "elevation" Public Const K_PROJECT As String = "project" Public Const K_ORDER As String = "Order" Public Const K_PO As String = "PO" - Public Const K_LINE As String = "Line" + Public Const K_LINE As String = "Line" Public Const S_DATE As String = "date" Public Const S_PIECE As String = "piece" Public Const S_POSITION As String = "position" - Public Const K_X As String = "x" - Public Const K_Y As String = "y" - Public Const K_Z As String = "z" + Public Const K_X As String = "x" + Public Const K_Y As String = "y" + Public Const K_Z As String = "z" Public Const S_SIZE As String = "size" - Public Const K_WIDTH As String = "width" - Public Const K_HEIGHT As String = "height" + Public Const K_WIDTH As String = "width" + Public Const K_HEIGHT As String = "height" Public Const K_THICKNESS As String = "thickness" Public Const S_ORIGHEIGHTDOOR As String = "origdoorheight" Public Const S_OVERLAP_DDF As String = "overlap" Public Const S_WEIGHT As String = "pressure" Public Const S_SWING As String = "swing" Public Const S_SECURE As String = "secure" - Public Const S_MATERIAL As String = "material" + Public Const S_MATERIAL As String = "material" Public Const S_PROPERTIES As String = "properties" Public Const S_PROFILES As String = "profiles" - Public Const K_LOCKEDGE As String = "lockedge" - Public Const K_HINGEEDGE As String = "hingeedge" - Public Const K_TOP As String = "top" + Public Const K_LOCKEDGE As String = "lockedge" + Public Const K_HINGEEDGE As String = "hingeedge" + Public Const K_TOP As String = "top" Public Const K_BOTTOM As String = "bottom" Public Const K_TYPEEDGE As String = "type" Public Const K_MACHINING As String = "machining" - Public Const K_OVERMATERIAL As String = "overmaterial" + Public Const K_OVERMATERIAL As String = "overmaterial" Public Const K_IDCODECOMPONENT As String = "IdCodeComponent" Public Const K_OTHERDOOR As String = "other_door" Public Const K_RADIUS As String = "radius" - Public Const K_ANGLE As String = "angle" + Public Const K_ANGLE As String = "angle" Public Const K_POSX As String = "posx" Public Const K_OVERLAP_BOTTOM As String = "overlap bottom" Public Const K_THICKNESS_BOTTOM As String = "thickness bottom" @@ -74,12 +74,12 @@ Module ConstCompo Public Const K_MATERIAL As String = "Material" Public Const K_CASCADED As String = "Cascaded" Public Const K_FOLDER_NAME As String = "FolderName" - ' K_NAME come sopra indicato - Public Const K_COMPO As String = "Compo" + ' K_NAME come sopra indicato + Public Const K_COMPO As String = "Compo" Public Const S_NGECONFIG As String = "NgeConfig" Public Const K_DEFAULT As String = "Default" Public Const S_POSITIONSIDE As String = "PositionSide" - Public Const K_SIDE As String = "Side" + Public Const K_SIDE As String = "Side" Public Const S_GR_PARAM_DEFAULT = "Graphic parameters" Public Const S_GR_PARAM_HARDWARE = "Parameters" Public Const K_PARAM As String = "Param" @@ -131,7 +131,7 @@ Module ConstCompo Public Const INI_EXTENSION As String = ".ini" Public Const TEMPL_EXTENSION As String = ".templ" Public Const FRAME_FOLDER As String = ".frame" - Public Const LCK_EXTENSION as string = ".lck" + Public Const LCK_EXTENSION As String = ".lck" Public Const FOLDERDIR As String = "Folder" ' Nome file di matching tra componenti su ante e telaio @@ -154,5 +154,4 @@ Module ConstCompo Public Const INI_CHECKBOX As String = "CheckBox" Public Const INI_GHOST As String = "Ghost" - End Module diff --git a/DataService/ThemesDataService.vb b/DataService/ThemesDataService.vb index 11f9d6c..e9a5aa2 100644 --- a/DataService/ThemesDataService.vb +++ b/DataService/ThemesDataService.vb @@ -4,13 +4,21 @@ Imports System.Resources Public Class ThemesDataService +#Region "FIELDS & PROPERTIES" + Private ReadOnly m_Themes As New ObservableCollection(Of ThemeM)() +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New() ScanResources() ScanDisk("Themes") End Sub +#End Region ' Constructor + #Region "METHODS" ''' diff --git a/DoorParameters/Compo.vb b/DoorParameters/Compo.vb index cb49ca4..0924cbd 100644 --- a/DoorParameters/Compo.vb +++ b/DoorParameters/Compo.vb @@ -5,6 +5,8 @@ Imports EgtUILib Module Modified +#Region "METHODS" + Sub SetModified() If Not Map.refMainWindowVM.SelectedPage = MainWindowVM.ListPageEnum.nHardwarePage Then Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True @@ -18,10 +20,15 @@ Module Modified End If End Sub +#End Region ' Methods + End Module Public Class Compo Implements INotifyPropertyChanged + +#Region "FIELDS & PROPERTIES" + Friend TempFileDDF As String = IniFile.m_sTempDir & "\" & TEMP_FILE ' permette di bloccare il refresh della componente singola (solo se nell'Hardwaremanagaer) Friend Shared DoRefreshCompo As Boolean = True @@ -45,10 +52,97 @@ Public Class Compo End Get End Property -#Region "Colori GroupBox" + Private m_TidyParam As String + Public Property TidyParam As String + Get + Return m_TidyParam + End Get + Set(value As String) + m_TidyParam = value + End Set + End Property + + Private m_CompoParamList As New ObservableCollection(Of CompoParam) + Public Property CompoParamList As ObservableCollection(Of CompoParam) + Get + Return m_CompoParamList + End Get + Set(value As ObservableCollection(Of CompoParam)) + m_CompoParamList = value + End Set + End Property + + Private m_TemplateVisibility As Visibility + Public Property TemplateVisibility As Visibility + Get + Return m_TemplateVisibility + End Get + Set(value As Visibility) + m_TemplateVisibility = value + End Set + End Property + + ' nome grafica (potrebbe essere shape o template) + Private m_TemplateName As String + Public Property TemplateName As String + Get + Return m_TemplateName + End Get + Set(value As String) + m_TemplateName = value + End Set + End Property + + ' nome DDF (potrebbe essere shape o template) + Private m_TemplateDDFName As String + Public Property TemplateDDFName As String + Get + Return m_TemplateDDFName + End Get + Set(value As String) + m_TemplateDDFName = value + End Set + End Property + + ' il messaggio associato al brand + Public ReadOnly Property BrandMsg As String + Get + Return Me.CompoType.FolderName + End Get + End Property + + ' Template selezionato + Private m_TemplateSelItem As String + Public Property TemplateSelItem As String + Get + Return m_TemplateSelItem + End Get + Set(value As String) + SetTemplateSelItem(value) + ' LoadByDefault = False + SetModified() + 'Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + Private Sub SetSelTemplate(Template As String) + If Template.Contains(".\") Then Template = Template.Replace(".\", "") + SetTemplateSelItem(Template) + 'SetModified() + End Sub + + ' Definizione comando + Private m_CmdDelete As ICommand + Private m_CmdReload As ICommand + Private m_CmdGoToHardware As ICommand + +#End Region ' Fields & Properties + +#Region "COLORI GROUPBOX" + +#Region "FIELDS & PROPERTIES" ' Colore della linea che circonda l'elenco dei parametri - Private m_BorderColor As SolidColorBrush = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) + Private m_BorderColor As SolidColorBrush = If(Not IsNothing(Map.refOptionsVM) AndAlso Map.refOptionsVM.SelectedTheme.Name = "Default", DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush), DirectCast(New BrushConverter().ConvertFrom("#0076A8"), SolidColorBrush)) Public Property BorderColor As SolidColorBrush Get Return m_BorderColor @@ -72,8 +166,8 @@ Public Class Compo End Property ' Colore utilizzato nell'intestazione - Private m_Foreground As SolidColorBrush = DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush) - Public Property Foreground As SolidColorBrush + Private m_Foreground As SolidColorBrush = If(Not IsNothing(Map.refOptionsVM) AndAlso Map.refOptionsVM.SelectedTheme.Name = "Default", DirectCast(New BrushConverter().ConvertFrom("#000000"), SolidColorBrush), DirectCast(New BrushConverter().ConvertFrom("#FFFFFF"), SolidColorBrush)) + Public Property Foreground As SolidColorBrush Get Return m_Foreground End Get @@ -107,8 +201,16 @@ Public Class Compo End Set End Property +#End Region ' Fields & Properties + +#Region "METHODS" + Public Sub ResetMark() - m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) + If Not IsNothing(Map.refOptionsVM) AndAlso Map.refOptionsVM.SelectedTheme.Name = "Default" Then + m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#DCDCDC"), SolidColorBrush) + Else + m_BorderColor = DirectCast(New BrushConverter().ConvertFrom("#0076A8"), SolidColorBrush) + End If m_BackGroundColor = Brushes.White If Not IsNothing(Map.refOptionsVM) AndAlso Map.refOptionsVM.SelectedTheme.Name = "Default" Then m_Foreground = Brushes.Black @@ -137,9 +239,13 @@ Public Class Compo NotifyPropertyChanged(NameOf(FontBold)) End Sub +#End Region ' Methods + #End Region ' Colori GroupBox -#Region "CompoRef" +#Region "COMPOREF" + +#Region "FIELDS & PROPERTIES" ' componente RIFERITA generata sul telaio Private m_refCompoJamb As Compo @@ -227,9 +333,13 @@ Public Class Compo End Set End Property +#End Region ' Fields & Properties + #End Region ' CompoRef -#Region "Gestione Errori DOORCreator" +#Region "GESTIONE ERRORI DOORCREATOR" + +#Region "FIELDS & PROPERTIES" Public m_ParameterDDfList As New List(Of String) @@ -338,17 +448,6 @@ Public Class Compo End Get End Property - ' Sets l'immagine per l'eliminazione della componente - Public Sub SetImage() - If m_LoadByDefault Then - 'm_ImageButton = "/Resources/Refresh/Error.png" - m_ImageButton = "/Resources/TopCommandBar/X.png" - Else - m_ImageButton = "/Resources/TopCommandBar/X.png" - End If - NotifyPropertyChanged(NameOf(IsError)) - End Sub - Private m_ImageButton As String = "/Resources/TopCommandBar/X.png" Public ReadOnly Property ImageButton As String Get @@ -402,9 +501,29 @@ Public Class Compo End Get End Property -#End Region ' Gestione Errori +#End Region ' Fields & Properties -#Region "Group Chapter" +#Region "METHODS" + + + ' Sets l'immagine per l'eliminazione della componente + Public Sub SetImage() + If m_LoadByDefault Then + 'm_ImageButton = "/Resources/Refresh/Error.png" + m_ImageButton = "/Resources/TopCommandBar/X.png" + Else + m_ImageButton = "/Resources/TopCommandBar/X.png" + End If + NotifyPropertyChanged(NameOf(IsError)) + End Sub + +#End Region ' Methods + +#End Region ' Gestione Errori DoorCreator + +#Region "GROUP CHAPTER" + +#Region "FIELDS & PROPERTIES" ' definsce se il capitolo NON deve essere di tipo Expand Private m_IsFixed As Boolean @@ -484,11 +603,15 @@ Public Class Compo NotifyPropertyChanged(NameOf(ErrorColor)) End Sub +#End Region ' Fields & Properties + #End Region ' Group Chapter -#Region "Selezione Template" +#Region "SELEZIONE TEMPLETE" -#Region "Brand" +#Region "BRAND" + +#Region "FIELDS & PROPERTIES" ' lista dei marchi Private m_BrandListPart As New ObservableCollection(Of String) @@ -579,7 +702,6 @@ Public Class Compo Exit For End If Next - End If Exit For End If @@ -612,9 +734,13 @@ Public Class Compo NotifyPropertyChanged(NameOf(SelBrandPart)) End Sub +#End Region ' Fields & Properties + #End Region ' Brand -#Region "File" +#Region "FILE" + +#Region "FIELDS & PROPERTIES" ' lista dei file Private m_FileList As New ObservableCollection(Of String) @@ -663,65 +789,11 @@ Public Class Compo NotifyPropertyChanged(NameOf(SelFile)) End Sub +#End Region ' Fields & Properties + #End Region ' File - Private m_TemplateVisibility As Visibility - Public Property TemplateVisibility As Visibility - Get - Return m_TemplateVisibility - End Get - Set(value As Visibility) - m_TemplateVisibility = value - End Set - End Property - - ' nome grafica (potrebbe essere shape o template) - Private m_TemplateName As String - Public Property TemplateName As String - Get - Return m_TemplateName - End Get - Set(value As String) - m_TemplateName = value - End Set - End Property - - ' nome DDF (potrebbe essere shape o template) - Private m_TemplateDDFName As String - Public Property TemplateDDFName As String - Get - Return m_TemplateDDFName - End Get - Set(value As String) - m_TemplateDDFName = value - End Set - End Property - - ' il messaggio associato al brand - Public ReadOnly Property BrandMsg As String - Get - Return Me.CompoType.FolderName - End Get - End Property - - ' Template selezionato - Private m_TemplateSelItem As String - Public Property TemplateSelItem As String - Get - Return m_TemplateSelItem - End Get - Set(value As String) - SetTemplateSelItem(value) - ' LoadByDefault = False - SetModified() - 'Map.refSceneManagerVM.RefreshBtn() - End Set - End Property - Private Sub SetSelTemplate(Template As String) - If Template.Contains(".\") Then Template = Template.Replace(".\", "") - SetTemplateSelItem(Template) - 'SetModified() - End Sub +#Region "METHODS" ' ricevuto il nome scritto nel file ddf viene scomposto per asseganare una parte alla proprietà Brand e una a alla proprietà File Public Sub SplitBrandFile(TemplateValue As String) @@ -852,6 +924,7 @@ Public Class Compo End Sub #Region "SettemplateREFCOMPO" + Friend Sub SetTemplateSelItemRefCompo(sFrameFile As String, CurrRefCompo As Compo) ' salvo una copia del percorso del direttorio Dim CurrItemPath As String = CurrRefCompo.CompoType.Path @@ -2023,32 +2096,11 @@ Public Class Compo Return False End Function +#End Region ' Methods + #End Region ' Selezione Template - Private m_TidyParam As String - Public Property TidyParam As String - Get - Return m_TidyParam - End Get - Set(value As String) - m_TidyParam = value - End Set - End Property - - Private m_CompoParamList As New ObservableCollection(Of CompoParam) - Public Property CompoParamList As ObservableCollection(Of CompoParam) - Get - Return m_CompoParamList - End Get - Set(value As ObservableCollection(Of CompoParam)) - m_CompoParamList = value - End Set - End Property - - ' Definizione comando - Private m_CmdDelete As ICommand - Private m_CmdReload As ICommand - Private m_CmdGoToHardware As ICommand +#Region "CONSTRUCTORS" ' creo una copia dell'oggetto Sub New(CompoType As CompoType) @@ -2061,6 +2113,8 @@ Public Class Compo m_CompoType = CompoType End Sub +#End Region ' Constructors + #Region "COMMANDS" #Region "DeleteCommand" @@ -2215,17 +2269,23 @@ Public Class Compo #End Region 'Commands +#Region "EVENTS" + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class Public Class CompoParam Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + ' è utilizzato solo nell'HardwareManager Public ReadOnly Property FontStyleParam As String Get @@ -2364,6 +2424,10 @@ Public Class CompoParam End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, Optional sLayerName As String = "") m_DDFName = sDDFName m_Name = sName @@ -2375,17 +2439,25 @@ Public Class CompoParam End If End Sub +#End Region ' Constructor + +#Region "EVENTS" + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class Public Class GhostParam Inherits CompoParam ' Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_Value As String Public Property Value As String Get @@ -2396,11 +2468,17 @@ Public Class GhostParam End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String) MyBase.New(sDDFName, sName, CurrCompo) m_Value = sValue End Sub +#End Region ' Constructor + 'Public Event PropertyChanged(sender As Object, e As PropertyChangedEventArgs) Implements INotifyPropertyChanged.PropertyChanged End Class @@ -2408,6 +2486,8 @@ Public Class TextBoxParam Inherits CompoParam ' Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + ' è utilizzata nel processo di ricalcolo dei parametri sul telaio, ' per eviatre di ripetere la stessa domanda ad ogni digitazione Private bContinueModify As Boolean = False @@ -2597,6 +2677,41 @@ Public Class TextBoxParam End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTORS" + + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), Optional ByVal bIsActive As Boolean = true) + MyBase.New(sDDFName, sName, CurrCompo) + If bIsActive then + SetValue( sValue) + Else + ErrorInReading = False + MissingParameterInReading = False + m_Value = sValue + If sValue.Contains("$") then + m_Value = "" + EnableCopy = False + End If + End If + 'm_Value = sValue + m_ComboBox = ComboBox + m_ComboValuelList = ComboValuelList + End Sub + + ' utilizzata per le text degli hardware che possono ricevere diversi tipi di valore + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), TypeVar As String, Optional sLayerName As String = "") + MyBase.New(sDDFName, sName, CurrCompo, sLayerName) + m_Value = sValue + m_ComboBox = ComboBox + m_ComboValuelList = ComboValuelList + m_TypeVar = TypeVar + End Sub + +#End Region ' Constructors + +#Region "METHODS" + ' aggiorno il valore dal parametro in funzione della modifica del parametro sull'anta Public Function UpdateParam() As Boolean Dim CmpPar As CompoParam = Me @@ -2694,32 +2809,7 @@ Public Class TextBoxParam Return False End Function - Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), Optional ByVal bIsActive As Boolean = true) - MyBase.New(sDDFName, sName, CurrCompo) - If bIsActive then - SetValue( sValue) - Else - ErrorInReading = False - MissingParameterInReading = False - m_Value = sValue - If sValue.Contains("$") then - m_Value = "" - EnableCopy = False - End If - End If - 'm_Value = sValue - m_ComboBox = ComboBox - m_ComboValuelList = ComboValuelList - End Sub - - ' utilizzata per le text degli hardware che possono ricevere diversi tipi di valore - Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), TypeVar As String, Optional sLayerName As String = "") - MyBase.New(sDDFName, sName, CurrCompo, sLayerName) - m_Value = sValue - m_ComboBox = ComboBox - m_ComboValuelList = ComboValuelList - m_TypeVar = TypeVar - End Sub +#End Region ' Methods 'Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged 'Public Sub NotifyPropertyChanged(propName As String) @@ -2732,6 +2822,8 @@ Public Class ComboBoxParam Inherits CompoParam ' Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_IsReadOnly As Boolean = True Public Property IsReadOnly As Boolean Get @@ -2925,6 +3017,10 @@ Public Class ComboBoxParam NotifyPropertyChanged(NameOf(SelItem)) End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, ref_ItemList As ObservableCollection(Of String), ref_ItemListDDF As ObservableCollection(Of String), sSelItem As String, Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sLayerName) ItemList = ref_ItemList @@ -2932,6 +3028,8 @@ Public Class ComboBoxParam SetSelItem(sSelItem) End Sub +#End Region ' Constructor + 'Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged 'Public Sub NotifyPropertyChanged(propName As String) ' RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) @@ -2941,6 +3039,8 @@ End Class Public Class TextBoxOnOffParam Inherits TextBoxParam +#Region "FIELDS & PROPERTIES" + Private m_IsActive As Boolean = True Public Property IsActive As Boolean Get @@ -2964,6 +3064,10 @@ Public Class TextBoxOnOffParam 'NotifyPropertyChanged("IsActive") End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTORS" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), Optional bIsActive As Boolean = True) MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList, bIsActive) m_IsActive = bIsActive @@ -2974,11 +3078,15 @@ Public Class TextBoxOnOffParam m_IsActive = bIsActive End Sub +#End Region ' Constructors + End Class Public Class TextBoxNgeParam Inherits TextBoxParam +#Region "FIELDS & PROPERTIES" + Private m_IsActive As Boolean = False Public Property IsActive As Boolean Get @@ -2995,14 +3103,23 @@ Public Class TextBoxNgeParam 'NotifyPropertyChanged("IsActive") End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList, sLayerName) End Sub + +#End Region ' Constructor + End Class Public Class TextBoxLuaParam Inherits TextBoxParam +#Region "FIELDS & PROPERTIES" + Private m_IsActive As Boolean = False Public Property IsActive As Boolean Get @@ -3019,14 +3136,23 @@ Public Class TextBoxLuaParam 'NotifyPropertyChanged("IsActive") End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList, sLayerName) End Sub + +#End Region ' Constructor + End Class Public Class TextBoxDGCParam Inherits TextBoxParam +#Region "FIELDS & PROPERTIES" + Private m_ConstList As List(Of String) Public Property ConstList As List(Of String) Get @@ -3052,17 +3178,25 @@ Public Class TextBoxDGCParam NotifyPropertyChanged(NameOf(SelConst)) End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), ConstList As List(Of String), TypeVar As String, Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList, TypeVar, sLayerName) m_ConstList = ConstList m_SelConst = m_ConstList(0) End Sub +#End Region ' Constructor + End Class Public Class TextBoxThicknessParam Inherits TextBoxParam +#Region "FIELDS & PROPERTIES" + Private m_ConstList As List(Of ItemConstThickness) Public Property ConstList As List(Of ItemConstThickness) Get @@ -3110,18 +3244,26 @@ Public Class TextBoxThicknessParam End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, sValue As String, ComboBox As ComboBoxParam, ComboValuelList As List(Of String), ConstList As List(Of ItemConstThickness), TypeVar As String, Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sValue, ComboBox, ComboValuelList, TypeVar, sLayerName) m_ConstList = ConstList m_SelConst = m_ConstList(2) End Sub +#End Region ' Constructor + End Class Public Class CheckBoxParam Inherits CompoParam ' Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_IsChecked As Boolean = False Public Property IsChecked As Boolean Get @@ -3138,12 +3280,17 @@ Public Class CheckBoxParam NotifyPropertyChanged(NameOf(IsChecked)) End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" Sub New(sDDFName As String, sName As String, CurrCompo As Compo, IsChecked As Boolean, Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sLayerName) m_IsChecked = IsChecked End Sub +#End Region ' Constructor + 'Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged 'Public Sub NotifyPropertyChanged(propName As String) ' RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) @@ -3153,6 +3300,8 @@ End Class Public Class ComboBoxOnOffParam Inherits ComboBoxParam +#Region "FIELDS & PROPERTIES" + Private m_IsActive As Boolean = True Public Property IsActive As Boolean Get @@ -3178,22 +3327,31 @@ Public Class ComboBoxOnOffParam ' CurrCompo.ErrorValue = True 'End If NotifyPropertyChanged(NameOf(ErrorParameter)) - If String.IsNullOrEmpty(m_SelItem) then + If String.IsNullOrEmpty(m_SelItem) Then EnableCopy = False End If 'NotifyPropertyChanged("IsActive") End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, ItemList As ObservableCollection(Of String), ItemListDDF As ObservableCollection(Of String), sSelItem As String, Optional sLayerName As String = "", Optional bActiveBox As Boolean = True) MyBase.New(sDDFName, sName, CurrCompo, ItemList, ItemListDDF, sSelItem, sLayerName) - SetIsActive( bActiveBox) + SetIsActive(bActiveBox) End Sub + +#End Region ' Constructor + End Class Public Class ComboBoxParamLua Inherits ComboBoxParam ' serve solo per distinguere le liste che sono caricate da file GeometryNameList.ini +#Region "FIELDS & PROPERTIES" + ' riceve il nome del parametro associato alla geometria di lavorazione Private Property m_refParam As String Public Property refParam As String @@ -3231,14 +3389,23 @@ Public Class ComboBoxParamLua End Get End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sDDFName As String, sName As String, CurrCompo As Compo, ItemList As ObservableCollection(Of String), ItemListDDF As ObservableCollection(Of String), sSelItem As String, Optional sLayerName As String = "", Optional sKey2 As String = "") MyBase.New(sDDFName, sName, CurrCompo, ItemList, ItemListDDF, sSelItem, sLayerName) m_refParam = sKey2 End Sub + +#End Region ' Constructor + End Class Public Class ItemConstThickness +#Region "FIELDS & PROPERTIES" + Private m_Name As String Public Property Name As String Get @@ -3259,17 +3426,25 @@ Public Class ItemConstThickness End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(Message As String, dVal As Double) m_Name = Message m_dValue = dVal End Sub +#End Region ' Constructor + End Class Public Class ActivateParam Inherits CompoParam 'Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_IsActivated As Boolean = False Public Property IsActivated As Boolean Get @@ -3286,12 +3461,17 @@ Public Class ActivateParam NotifyPropertyChanged(NameOf(IsActivated)) End Sub +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" Sub New(sDDFName As String, sName As String, CurrCompo As Compo, IsActivate As Boolean, Optional sLayerName As String = "") MyBase.New(sDDFName, sName, CurrCompo, sLayerName) m_IsActivated = IsActivate End Sub +#End Region ' Constructor + 'Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged 'Public Sub NotifyPropertyChanged(propName As String) ' RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) diff --git a/DoorParameters/Part.vb b/DoorParameters/Part.vb index e73bb7e..0552a9f 100644 --- a/DoorParameters/Part.vb +++ b/DoorParameters/Part.vb @@ -7,6 +7,8 @@ Imports EgtWPFLib5 Public Class Part Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + ' queste variabili servono per getsire le ripezioni dei messaggi durante il caricamento degli assemblati ' in fase di lettura diventa vero dopo aver caricato il primo dei part del ddf @@ -30,9 +32,72 @@ Public Class Part End Set End Property + ' lista delle componenti + Friend m_CompoList As New ObservableCollection(Of Compo) + Public Property CompoList As ObservableCollection(Of Compo) + Get + Return m_CompoList + End Get + Set(value As ObservableCollection(Of Compo)) + m_CompoList = value + End Set + End Property + + Private m_SelCompo As Compo + Public Property SelCompo As Compo + Get + Return m_SelCompo + End Get + Set(value As Compo) + m_SelCompo = value + MarkCompoInScena() + End Set + End Property + + Private m_TopShapeIsChecked As Boolean = False + Public Property TopShapeIsChecked As Boolean + Get + Return m_TopShapeIsChecked + End Get + Set(value As Boolean) + m_TopShapeIsChecked = value + Map.refSceneManagerVM.RefreshBtn() + End Set + End Property + + Private Property m_TopShapeList As New List(Of TopShape) From {New TopShape(EgtMsg(50707)), New TopShape(EgtMsg(50708))} + Public ReadOnly Property TopShapeList As List(Of TopShape) + Get + Return m_TopShapeList + End Get + End Property + + Private m_SelectedShape As TopShape = m_TopShapeList(0) + Public Property SelectedShape As TopShape + Get + Return m_SelectedShape + End Get + Set(value As TopShape) + m_SelectedShape = value + If value.Name.Trim() = m_TopShapeList(0).Name.Trim Then + TopArcIsChecked = True + TopAngleIsChecked = False + ElseIf value.Name.Trim() = m_TopShapeList(1).Name.Trim Then + TopAngleIsChecked = True + TopArcIsChecked = False + End If + NotifyPropertyChanged(NameOf(VisibilityTopArch)) + NotifyPropertyChanged(NameOf(VisibilityTopAngle)) + End Set + End Property + +#End Region ' Fields & Properties + #Region "GENERAL" -#Region "Nuove proprietà delle parti" +#Region "NUOVE PROPIETA' DELLE PARTI" + +#Region "FIELDS & PROPERTIES" ' serve ad attribuire il nome all'oggetto che stiamo per creare (Il vecchio frame ora indicato nel DDF come piece) Private m_TypePart As String @@ -102,9 +167,13 @@ Public Class Part NotifyPropertyChanged(NameOf(DispositionItem)) End Sub +#End Region ' Fields & Properties + #End Region ' Nuove proprietà delle parti -#Region "Info Generali del ddf" +#Region "INFO GENERALI DEL DDF" + +#Region "FIELDS & PROPERTIES" Private m_Measure As String Public Property Measure As String @@ -196,9 +265,14 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Info generali del ddf -#Region "PROPERTIES and MATERIAL" +#Region "PROPERTIES AND MATERIAL" + +#Region "FIELDS & PROPERTIES" + ' la lista dei materiali è caricta nell'init dell'OptionPage Friend Shared m_MaterilaList As ObservableCollection(Of MaterialType) Public Property MaterialsList As ObservableCollection(Of MaterialType) @@ -236,7 +310,6 @@ Public Class Part End If End Set End Property - Public Sub SetMaterial(ItemMaterial As MaterialType) For Each Item In m_MaterilaList If ItemMaterial.NameDDF = Item.NameDDF Then @@ -298,7 +371,6 @@ Public Class Part Map.refSceneManagerVM.RefreshBtn() End Set End Property - ' seleziona la lista delle proprietà senza aggiornare il disegno della porta Public Sub SetPropertiesList(ByVal List As ObservableCollection(Of PropertyItem)) If Not IsNothing(m_PropertiesList) AndAlso m_PropertiesList.Count > 0 Then @@ -324,7 +396,6 @@ Public Class Part NotifyPropertyChanged(NameOf(SelectedProperty)) End Set End Property - Public Sub SetProperty(ByVal nSelProperty As PropertyItem) m_SelectedProperty = nSelProperty NotifyPropertyChanged(NameOf(SelectedProperty)) @@ -342,10 +413,14 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Properties and Material #Region "SIZE" +#Region "FIELDS & PROPERTIES" + Private m_Height As String Public Property Height As String Get @@ -467,6 +542,9 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End If End Sub + +#Region "ToolTip" + Public ReadOnly Property ToolTipEvaluatedThickness As String Get Dim dVal As Double @@ -478,10 +556,16 @@ Public Class Part End Get End Property +#End Region ' ToolTip + +#End Region ' Fields & Properties + #End Region ' Size #Region "WEIGHT" +#Region "FIELDS & PROPERTIES" + Private m_Weight As String Public Property Weight As String Get @@ -529,10 +613,14 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Weight #Region "SWING" +#Region "FIELDS & PROPERTIES" + Public ReadOnly Property VisibilityInvertBevel As Visibility Get Return OptionModule.m_DisableInvertBevel @@ -583,17 +671,20 @@ Public Class Part Map.refSceneManagerVM.RefreshBtn() End Set End Property - Public Sub SetSwing(sSwing As String) OptionModule.SetCurrSwing(m_SwingAlias, sSwing) m_Swing = m_SwingAlias.AliasName NotifyPropertyChanged(NameOf(Swing)) End Sub +#End Region ' Fields & Properties + #End Region ' Swing #Region "EDGE" +#Region "FIELDS & PROPERTIES" + Friend Shared m_LockEdgeTypeList As New ObservableCollection(Of EdgeType) Friend Shared m_HingeEdgeTypeList As New ObservableCollection(Of EdgeType) Friend Shared m_BottomEdgeTypeList As New ObservableCollection(Of EdgeType) @@ -725,10 +816,14 @@ Public Class Part NotifyPropertyChanged(NameOf(InvertBevel)) End Sub +#End Region ' Fields & Properties + #End Region ' Edge #Region "RESIZE" +#Region "FIELDS & PROPERTIES" + Private m_ResizeLockHinge As Boolean Public Property ResizeLockHinge As Boolean Get @@ -751,10 +846,14 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Resize #Region "MACHINING" +#Region "FIELDS & PROPERTIES" + Private m_TopMachining As Boolean Public Property TopMachining As Boolean Get @@ -799,53 +898,13 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Machining #Region "OVERMATERIAL" - Public ReadOnly Property ToolTipEvaluatedLockOverMaterial As String - Get - Dim dVal As Double - If StringToDouble(m_LockEdgeOverMaterial, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property - - Public ReadOnly Property ToolTipEvaluatedHingeOverMaterial As String - Get - Dim dVal As Double - If StringToDouble(m_HingeEdgeOverMaterial, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property - - Public ReadOnly Property ToolTipEvaluatedTopOverMaterial As String - Get - Dim dVal As Double - If StringToDouble(m_TopOverMaterial, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property - - Public ReadOnly Property ToolTipEvaluatedBottomOverMaterial As String - Get - Dim dVal As Double - If StringToDouble(m_BottomOverMaterial, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property +#Region "FIELDS & PROPERTIES" Private m_LockEdgeOverMaterial As String = String.Empty Public Property LockEdgeOverMaterial As String @@ -895,10 +954,62 @@ Public Class Part End Set End Property +#Region "ToolTip" + + Public ReadOnly Property ToolTipEvaluatedLockOverMaterial As String + Get + Dim dVal As Double + If StringToDouble(m_LockEdgeOverMaterial, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Public ReadOnly Property ToolTipEvaluatedHingeOverMaterial As String + Get + Dim dVal As Double + If StringToDouble(m_HingeEdgeOverMaterial, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Public ReadOnly Property ToolTipEvaluatedTopOverMaterial As String + Get + Dim dVal As Double + If StringToDouble(m_TopOverMaterial, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Public ReadOnly Property ToolTipEvaluatedBottomOverMaterial As String + Get + Dim dVal As Double + If StringToDouble(m_BottomOverMaterial, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + +#End Region ' ToolTip + +#End Region ' Fields & Properties + #End Region ' OverMaterial #Region "CUT" +#Region "FIELDS & PROPERTIES" + Private m_CutIsChecked As Boolean = False Public Property CutIsChecked As Boolean Get @@ -923,6 +1034,26 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property + + Private m_CutDirectionList As New List(Of String) From {"Horizontal", "Vertical"} + Public ReadOnly Property CutDirectionList As List(Of String) + Get + Return m_CutDirectionList + End Get + End Property + + Private m_SelectedDirection As String = m_CutDirectionList(0) + Public Property SelectedDirection As String + Get + Return m_SelectedDirection + End Get + Set(value As String) + m_SelectedDirection = value + End Set + End Property + +#Region "ToolTip" + Public ReadOnly Property ToolTipEvaluatedPosCut As String Get Dim dVal As Double @@ -934,26 +1065,16 @@ Public Class Part End Get End Property - Private m_CutDirectionList As New List(Of String) From {"Horizontal", "Vertical"} - Public ReadOnly Property CutDirectionList As List(Of String) - Get - Return m_CutDirectionList - End Get - End Property - Private m_SelectedDirection As String = m_CutDirectionList(0) - Public Property SelectedDirection As String - Get - Return m_SelectedDirection - End Get - Set(value As String) - m_SelectedDirection = value - End Set - End Property +#End Region ' ToolTip + +#End Region ' Fields & Properties #End Region ' Cut #Region "Position" +#Region "FIELDS & PROPERTIES" + Private m_Position As New List(Of String) From {"0", "0", "0"} Public Property Position As List(Of String) Get @@ -964,47 +1085,14 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Position - Private m_TopShapeIsChecked As Boolean = False - Public Property TopShapeIsChecked As Boolean - Get - Return m_TopShapeIsChecked - End Get - Set(value As Boolean) - m_TopShapeIsChecked = value - Map.refSceneManagerVM.RefreshBtn() - End Set - End Property - - Private Property m_TopShapeList As New List(Of TopShape) From {New TopShape(EgtMsg(50707)), New TopShape(EgtMsg(50708))} - Public ReadOnly Property TopShapeList As List(Of TopShape) - Get - Return m_TopShapeList - End Get - End Property - - Private m_SelectedShape As TopShape = m_TopShapeList(0) - Public Property SelectedShape As TopShape - Get - Return m_SelectedShape - End Get - Set(value As TopShape) - m_SelectedShape = value - If value.Name.Trim() = m_TopShapeList(0).Name.Trim Then - TopArcIsChecked = True - TopAngleIsChecked = False - ElseIf value.Name.Trim() = m_TopShapeList(1).Name.Trim Then - TopAngleIsChecked = True - TopArcIsChecked = False - End If - NotifyPropertyChanged(NameOf(VisibilityTopArch)) - NotifyPropertyChanged(NameOf(VisibilityTopAngle)) - End Set - End Property - #Region "TOP ARC" +#Region "FIELDS & PROPERTIES" + Private m_Radius As String = "W" Public Property Radius As String Get @@ -1017,16 +1105,6 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property - Public ReadOnly Property ToolTipEvaluatedRadius As String - Get - Dim dVal As Double - If StringToDouble(m_Radius, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property Private m_Posx As String = "0" Public Property Posx As String @@ -1040,16 +1118,6 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property - Public ReadOnly Property ToolTipEvaluatedPosx As String - Get - Dim dVal As Double - If StringToDouble(m_Posx, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property Private m_TopArcIsChecked As Boolean = True Public Property TopArcIsChecked As Boolean @@ -1080,10 +1148,40 @@ Public Class Part End Get End Property +#Region "ToolTip" + + Public ReadOnly Property ToolTipEvaluatedRadius As String + Get + Dim dVal As Double + If StringToDouble(m_Radius, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Public ReadOnly Property ToolTipEvaluatedPosx As String + Get + Dim dVal As Double + If StringToDouble(m_Posx, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + +#End Region ' ToolTip + +#End Region ' Fields & Properties + #End Region ' Top Arc #Region "TOP ANGLE" +#Region "FIELDS & PROPERTIES" + Private m_Angle As String = "0" Public Property Angle As String Get @@ -1096,16 +1194,6 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property - Public ReadOnly Property ToolTipEvaluatedAngle As String - Get - Dim dVal As Double - If StringToDouble(m_Angle, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property Private m_PosxAngle As String = "W/2" Public Property PosxAngle As String @@ -1119,16 +1207,6 @@ Public Class Part Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.IsModified = True End Set End Property - Public ReadOnly Property ToolTipEvaluatedPosxAngle As String - Get - Dim dVal As Double - If StringToDouble(m_PosxAngle, dVal) Then - Return DoubleToString(dVal, 4) - Else - Return EgtMsg(50143) - End If - End Get - End Property Private m_TopAngleIsChecked As Boolean Public Property TopAngleIsChecked As Boolean @@ -1159,12 +1237,41 @@ Public Class Part End Get End Property +#Region "ToolTip" + + Public ReadOnly Property ToolTipEvaluatedAngle As String + Get + Dim dVal As Double + If StringToDouble(m_Angle, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + + Public ReadOnly Property ToolTipEvaluatedPosxAngle As String + Get + Dim dVal As Double + If StringToDouble(m_PosxAngle, dVal) Then + Return DoubleToString(dVal, 4) + Else + Return EgtMsg(50143) + End If + End Get + End Property + +#End Region ' ToolTip + +#End Region ' Fields & Properties + #End Region ' Top Angle #Region "OPTIONS" - Private m_sOptions As String = String.Empty +#Region "FIELDS & PROPERTIES" + Private m_sOptions As String = String.Empty Public Property sOptions As String Get Return m_sOptions @@ -1174,33 +1281,15 @@ Public Class Part End Set End Property +#End Region ' Fields & Properties + #End Region ' Options #End Region ' General - ' lista delle componenti - Friend m_CompoList As New ObservableCollection(Of Compo) - Public Property CompoList As ObservableCollection(Of Compo) - Get - Return m_CompoList - End Get - Set(value As ObservableCollection(Of Compo)) - m_CompoList = value - End Set - End Property +#Region "ADDCOMPO" - Private m_SelCompo As Compo - Public Property SelCompo As Compo - Get - Return m_SelCompo - End Get - Set(value As Compo) - m_SelCompo = value - MarkCompoInScena() - End Set - End Property - -#Region "AddCompo" +#Region "METHODS" ' utilizzata nell'Hardware Friend Function AddNewHardware(HardwareGeneral As CompoType, TempHardwFile As String) As Boolean @@ -1508,9 +1597,13 @@ Public Class Part End Sub +#End Region ' Methods + #End Region 'AddCompo -#Region "Selection compo" +#Region "SELECTION COMPO" + +#Region "METHODS" Public Sub ResetAllMark() Dim nIdFirstPart As Integer = EgtGetFirstPart() @@ -1561,9 +1654,13 @@ Public Class Part EgtDraw() End Sub +#End Region ' Methods + #End Region -#Region "RemoveCompo" +#Region "REMOVECOMPO" + +#Region "METHODS" Friend Sub RemoveCompo(CompoToRemove As Compo, Optional OnlyOnJamb As Boolean = False) If IsNothing(CompoToRemove) Then Return @@ -1596,21 +1693,14 @@ Public Class Part CompoList.Remove(CompoToRemove) End Sub +#End Region ' Methods + #End Region ' RemoveCompo - ' aggiorna il ToolTip delle TextBox di Height, Width, Thickness - Private Sub UpdateToolTip() - For CompoIndex = 0 To m_CompoList.Count - 1 - For ParamIndex = 0 To m_CompoList(CompoIndex).CompoParamList.Count - 1 - If TypeOf m_CompoList(CompoIndex).CompoParamList(ParamIndex) Is TextBoxParam Then - Dim TextBoxParam As TextBoxParam = DirectCast(m_CompoList(CompoIndex).CompoParamList(ParamIndex), TextBoxParam) - TextBoxParam.NotifyPropertyChanged(NameOf(TextBoxParam.ToolTipValue)) - End If - Next - Next - End Sub - #Region "LETTURA DDF" + +#Region "FIELDS & PROPERTIES" + Private bModifyProperties As Boolean = False Private sNameDDFMaterial As String = "" Private sNameDDFProperty As String = "" @@ -1618,6 +1708,10 @@ Public Class Part Private bDeleteTopShape As Boolean = False Private FileContent As String() +#End Region ' Fields & Properties + +#Region "METHODS" + ' Genero una nuova porta da usare nella lettura di un DDF Shared Sub ReadDDFPartDoor(ArrayFile() As String, ByRef LineIndex As Integer, ByRef ReadDoor As Part) ' Inizializzazioni @@ -3421,9 +3515,11 @@ Public Class Part Return False End Function +#End Region ' Methods + #End Region ' Lettura ddf -#Region "COSTRUTTORE" +#Region "CONSTRUCTOR" Sub New(ref_PartDoor As PartDoor) m_refPartDoor = ref_PartDoor @@ -3562,16 +3658,36 @@ Public Class Part Me.TypePart = ConstGen.PART_DO_ & "1" End Sub -#End Region ' Costruttore +#End Region ' Constructor + +#Region "METHODS" + + ' aggiorna il ToolTip delle TextBox di Height, Width, Thickness + Private Sub UpdateToolTip() + For CompoIndex = 0 To m_CompoList.Count - 1 + For ParamIndex = 0 To m_CompoList(CompoIndex).CompoParamList.Count - 1 + If TypeOf m_CompoList(CompoIndex).CompoParamList(ParamIndex) Is TextBoxParam Then + Dim TextBoxParam As TextBoxParam = DirectCast(m_CompoList(CompoIndex).CompoParamList(ParamIndex), TextBoxParam) + TextBoxParam.NotifyPropertyChanged(NameOf(TextBoxParam.ToolTipValue)) + End If + Next + Next + End Sub Public Function ShallowCopy() As Part Return DirectCast(Me.MemberwiseClone(), Part) End Function +#End Region ' Methods + +#Region "EVENTS" + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class diff --git a/DoorParameters/PartPageV.xaml.vb b/DoorParameters/PartPageV.xaml.vb index e5a7472..38dd971 100644 --- a/DoorParameters/PartPageV.xaml.vb +++ b/DoorParameters/PartPageV.xaml.vb @@ -1,5 +1,7 @@ Public Class PartPageV +#Region "METHODS" + Public Sub ItemsControl_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Dim ListControl As ListBox = DirectCast(sender, ListBox) If Not IsNothing(ListControl.SelectedItem) Then @@ -27,8 +29,6 @@ End Sub - Private Sub UserControl_IsEnabledChanged(sender As Object, e As DependencyPropertyChangedEventArgs) - - End Sub +#End Region ' Methods End Class diff --git a/DoorParameters/PartPageVM.vb b/DoorParameters/PartPageVM.vb index 5a1d693..a255950 100644 --- a/DoorParameters/PartPageVM.vb +++ b/DoorParameters/PartPageVM.vb @@ -6,6 +6,8 @@ Imports EgtUILib Public Class PartPageVM Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Friend bSetChange As Boolean = False Private m_CurrPart As Part Public Property CurrPart As Part @@ -75,6 +77,8 @@ Public Class PartPageVM #Region "DISPOSITION SCREEN" +#Region "FIELDS & PROPERTIES" + Public ReadOnly Property WidthColumn1 As String Get If OptionModule.m_nDispostionScreen = 0 Or OptionModule.m_nDispostionScreen = 1 Then @@ -115,38 +119,103 @@ Public Class PartPageVM End Get End Property +#End Region ' Fields & Properties + #End Region ' Disposition Screen -#Region "CONSTUCTOR" - - Sub New() - Map.SetRefDoorParametersVM(Me) - If IsNothing(Map.refCompoPanelVM) Then Map.SetRefCompoPanelVM(New CompoPanelVM("PartPage")) - If IsNothing(m_CompoPanelPart) Then m_CompoPanelPart = New CompoPanelV - m_CompoPanelPart.DataContext = Map.refCompoPanelVM - m_IsReadOnly = OptionModule.ReadOnlyDDF + Private m_IsResize As Boolean + Public Property IsResize As Boolean + Get + Return m_IsResize + End Get + Set(value As Boolean) + m_IsResize = value + NotifyPropertyChanged(NameOf(IsResize)) + End Set + End Property + Sub SetStatusPage() + NotifyPropertyChanged(NameOf(EnablePageDoor)) End Sub - Sub PrepareEvent() - If Not IsNothing(Map.refInstrumentPanelVM) Then - AddHandler Map.refInstrumentPanelVM.EnableCurrentPage, AddressOf Me.SetStatusPage - End If - End Sub + Public ReadOnly Property EnablePageDoor As Boolean + Get + Map.refProjectManagerVM.NotifyPropertyChanged(NameOf(Map.refProjectManagerVM.EnableProjectManager)) + Map.refAssemblyManagerVM.NotifyPropertyChanged(NameOf(Map.refAssemblyManagerVM.EnableAssebmlyManager)) + If Not IsNothing(Map.refInstrumentPanelVM) Then + Return Map.refInstrumentPanelVM.EnablePage + Else + Return True + End If + End Get + End Property -#End Region + Private m_IsReadOnly As Boolean + Public Property IsRaedOnly As Boolean + Get + Return m_IsReadOnly + End Get + Set(value As Boolean) + m_IsReadOnly = value + NotifyPropertyChanged(NameOf(IsRaedOnly)) + NotifyPropertyChanged(NameOf(DisableHeight)) + NotifyPropertyChanged(NameOf(DisableWidth)) + End Set + End Property + + ' vero se la porta è Inactive, Falso il contrario + Private m_IsInactive As Boolean = False + Public Property IsInactive As Boolean + Get + Return m_IsInactive + End Get + Set(value As Boolean) + m_IsInactive = value + NotifyPropertyChanged(NameOf(IsInactive)) + End Set + End Property + + Public ReadOnly Property DisableHeight As Boolean + Get + If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then + Return Map.refAssemblyPageVM.CurrAssembly.Dimension + Else + Return m_IsReadOnly + End If + End Get + End Property + + Public ReadOnly Property DisableWidth As Boolean + Get + If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then + Return Map.refAssemblyPageVM.CurrAssembly.Dimension + Else + Return m_IsReadOnly + End If + End Get + End Property + + Private m_Image As String + Public Property Image As String + Get + Return m_Image + End Get + Set(value As String) + m_Image = value + End Set + End Property #Region "Messages" 'General' Public ReadOnly Property MachMsg As String Get - ' 50711 = Mach. + ' 50711 = Mach. Return EgtMsg(50711) End Get End Property Public ReadOnly Property ResizeMsg As String Get - '50311=Resize + '50311=Resize Return EgtMsg(50311) End Get End Property @@ -237,47 +306,47 @@ Public Class PartPageVM End Property Public ReadOnly Property RadiusMsg As String Get - ' 50704 = Radius + ' 50704 = Radius Return EgtMsg(50704) End Get End Property Public ReadOnly Property AngleMsg As String Get - ' 50705 = Angle + ' 50705 = Angle Return EgtMsg(50705) End Get End Property Public ReadOnly Property PosxMsg As String Get - ' 50706 = Pos_x + ' 50706 = Pos_x Return EgtMsg(50706) End Get End Property Public ReadOnly Property TopArcMsg As String Get - ' 50707 = Top Arc + ' 50707 = Top Arc Return EgtMsg(50707) End Get End Property Public ReadOnly Property TopAngleMsg As String Get - ' 50708 = Top Angle + ' 50708 = Top Angle Return EgtMsg(50708) End Get End Property Public ReadOnly Property PropertyMsg As String Get - ' 50709 = Properties + ' 50709 = Properties Return EgtMsg(50709) End Get End Property Public ReadOnly Property MaterialMsg As String Get - ' 50710 = Material + ' 50710 = Material Return EgtMsg(50710) End Get End Property - + Public ReadOnly Property CutMsg As String Get Return "Cut" @@ -313,96 +382,42 @@ Public Class PartPageVM End Get End Property -#End Region - - Private m_IsResize As Boolean - Public Property IsResize As Boolean - Get - Return m_IsResize - End Get - Set(value As Boolean) - m_IsResize = value - NotifyPropertyChanged(NameOf(IsResize)) - End Set - End Property - - Sub SetStatusPage() - NotifyPropertyChanged(NameOf(EnablePageDoor)) - End Sub - Public ReadOnly Property EnablePageDoor As Boolean - Get - Map.refProjectManagerVM.NotifyPropertyChanged(NameOf(Map.refProjectManagerVM.EnableProjectManager)) - Map.refAssemblyManagerVM.NotifyPropertyChanged(NameOf(Map.refAssemblyManagerVM.EnableAssebmlyManager)) - If Not IsNothing(Map.refInstrumentPanelVM) Then - Return Map.refInstrumentPanelVM.EnablePage - Else - Return True - End If - End Get - End Property - - Private m_IsReadOnly As Boolean - Public Property IsRaedOnly As Boolean - Get - Return m_IsReadOnly - End Get - Set(value As Boolean) - m_IsReadOnly = value - NotifyPropertyChanged(NameOf(IsRaedOnly)) - NotifyPropertyChanged(NameOf(DisableHeight)) - NotifyPropertyChanged(NameOf(DisableWidth)) - End Set - End Property - - ' vero se la porta è Inactive, Falso il contrario - Private m_IsInactive As Boolean = False - Public Property IsInactive As Boolean - Get - Return m_IsInactive - End Get - Set(value As Boolean) - m_IsInactive = value - NotifyPropertyChanged(NameOf(IsInactive)) - End Set - End Property - - Public ReadOnly Property DisableHeight As Boolean - Get - If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then - Return Map.refAssemblyPageVM.CurrAssembly.Dimension - Else - Return m_IsReadOnly - End If - End Get - End Property - - Public ReadOnly Property DisableWidth As Boolean - Get - If Not IsNothing(Map.refAssemblyPageVM.CurrAssembly) AndAlso Map.refPartPageVM.CurrPart.TypePart.Contains("DO_") Then - Return Map.refAssemblyPageVM.CurrAssembly.Dimension - Else - Return m_IsReadOnly - End If - End Get - End Property - - Private m_Image As String - Public Property Image As String - Get - Return m_Image - End Get - Set(value As String) - m_Image = value - End Set - End Property +#End Region ' Messages ' definizione comando Private m_EnterRefreshCmd As ICommand Private m_F1GuideCmd As ICommand Private m_cmdOrderBtn As ICommand +#End Region ' Fields & Properties + +#Region "CONSTUCTOR" + + Sub New() + Map.SetRefDoorParametersVM(Me) + If IsNothing(Map.refCompoPanelVM) Then Map.SetRefCompoPanelVM(New CompoPanelVM("PartPage")) + If IsNothing(m_CompoPanelPart) Then m_CompoPanelPart = New CompoPanelV + m_CompoPanelPart.DataContext = Map.refCompoPanelVM + m_IsReadOnly = OptionModule.ReadOnlyDDF + End Sub + + +#End Region ' Constructor + +#Region "METHODS" + + Sub PrepareEvent() + If Not IsNothing(Map.refInstrumentPanelVM) Then + AddHandler Map.refInstrumentPanelVM.EnableCurrentPage, AddressOf Me.SetStatusPage + End If + End Sub + +#End Region ' Methods + #Region "COMMANDS" +#Region "RefreshCmd" + Public ReadOnly Property RefreshCmd As ICommand Get If m_EnterRefreshCmd Is Nothing Then @@ -416,6 +431,10 @@ Public Class PartPageVM Map.refSceneManagerVM.RefreshBtn() End Sub +#End Region ' RefreshCmd + +#Region "GuideCmd" + ' Comando Guida Public ReadOnly Property GuideCmd As ICommand Get @@ -434,6 +453,10 @@ Public Class PartPageVM Map.refProjectManagerVM.Guide() End Sub +#End Region ' GuideCmd + +#Region "OrderCmd" + Public ReadOnly Property OrderCmd As ICommand Get If m_cmdOrderBtn Is Nothing Then @@ -443,14 +466,20 @@ Public Class PartPageVM End Get End Property +#End Region ' OrderCmd + #End Region ' Command +#Region "EVENTS" + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class Public Class DoorVisibilityConverter diff --git a/DoorParameters/PropertyItem.vb b/DoorParameters/PropertyItem.vb index 7b4d246..de812fe 100644 --- a/DoorParameters/PropertyItem.vb +++ b/DoorParameters/PropertyItem.vb @@ -4,6 +4,8 @@ Imports System.ComponentModel Public Class PropertyItem Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + Private m_GraphicName As String Public Property GraphicName As String Get @@ -36,18 +38,28 @@ Public Class PropertyItem End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sName As String, sGraphicName As String, bIsChecked As Boolean) m_Name = sName m_GraphicName = sGraphicName m_IsChecked = bIsChecked End Sub - Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged +#End Region ' Constructor + +#Region "EVENTS" + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class @@ -55,6 +67,8 @@ Public Class MaterialType 'Inherits VMBase Implements INotifyPropertyChanged +#Region "FIELDS & PROPERTIES" + ' nome caricato dalla lista dei messaggi Private m_Name As String Public Property Name As String @@ -88,17 +102,27 @@ Public Class MaterialType End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sName As String, sGraphicName As String) m_NameDDF = sName m_Name = sGraphicName - End Sub + End Sub - Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged +#End Region ' Constructor + +#Region "EVENTS" + + Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged Public Sub NotifyPropertyChanged(propName As String) RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName)) End Sub +#End Region ' Events + End Class Public Class TopShape diff --git a/EgtDOORCreator.vbproj b/EgtDOORCreator.vbproj index af7d9a9..a23d46a 100644 --- a/EgtDOORCreator.vbproj +++ b/EgtDOORCreator.vbproj @@ -299,6 +299,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/EgtDOORCreatorDarkDictionary.xaml b/EgtDOORCreatorDarkDictionary.xaml index 27849a0..24c92c8 100644 --- a/EgtDOORCreatorDarkDictionary.xaml +++ b/EgtDOORCreatorDarkDictionary.xaml @@ -488,7 +488,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Guide/GuideV.xaml.vb b/Guide/GuideV.xaml.vb index ad9b445..6c2bd28 100644 --- a/Guide/GuideV.xaml.vb +++ b/Guide/GuideV.xaml.vb @@ -2,9 +2,15 @@ Public Class GuideV +#Region "FIELDS & PROPERTIES" + Private m_GuideVM As GuideVM Public Shared m_Language As String +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(Owner As Window, GuideVM As GuideVM) MyBase.New(Owner) ' This call is required by the designer. @@ -43,4 +49,6 @@ Public Class GuideV End Sub +#End Region ' Constructor + End Class diff --git a/Guide/GuideViewModel.vb b/Guide/GuideViewModel.vb index 29e66ee..e6dbee9 100644 --- a/Guide/GuideViewModel.vb +++ b/Guide/GuideViewModel.vb @@ -1,4 +1,7 @@ Public Class GuideVM + +#Region "FIELDS & PROPERTIES" + ' se non è stata selezionato ancora nulla allora faccio partire il menu principale Public Shared m_AddressGuide As String = "Index" @@ -8,4 +11,6 @@ End Get End Property +#End Region ' Fields & Properties + End Class diff --git a/HardwareGeometry/GeometryListConfigVM.vb b/HardwareGeometry/GeometryListConfigVM.vb index f790e39..4421187 100644 --- a/HardwareGeometry/GeometryListConfigVM.vb +++ b/HardwareGeometry/GeometryListConfigVM.vb @@ -5,45 +5,14 @@ Imports EgtWPFLib5 Public Class GeometryListConfigVM Inherits VMBase +#Region "FIELDS & PROPERTIES" + Dim m_HardwareTemp As Hardware -#Region "MESSAGES" - - Public ReadOnly Property Title As String - Get - ' 50721=New Geometry - Return EgtMsg(50721) - End Get - End Property - Public ReadOnly Property GeometryNameMsg As String - Get - ' 50722=Geometry Name - Return EgtMsg(50722) - End Get - End Property - Public ReadOnly Property TypeHardwareMsg As String - Get - ' 50723=Type Hardware - Return EgtMsg(50723) - End Get - End Property - Public ReadOnly Property ParameterMsg As String - Get - ' 50724=Parameter - Return EgtMsg(50724) - End Get - End Property - Public ReadOnly Property SaveMsg As String - Get - ' 50410=Save - Return EgtMsg(50410) - End Get - End Property - -#End Region ' Messages - #Region "GEOMETRY NAME" +#Region "FIELDS & PROPERTIES" + Private m_ColorText As SolidColorBrush = DirectCast(New BrushConverter().ConvertFrom("Black"), SolidColorBrush) Public Property ColorText As SolidColorBrush Get @@ -89,10 +58,14 @@ Public Class GeometryListConfigVM End Set End Property +#End Region ' Fields & Properties + #End Region ' Geommetry Name #Region "HARDWARE LIST" +#Region "FIELDS & PROPERTIES" + Private m_HardwareList As New ObservableCollection(Of CompoType) Private m_SelHardware As CompoType @@ -126,10 +99,14 @@ Public Class GeometryListConfigVM End Set End Property +#End Region ' Fields & Properties + #End Region ' Hardware List #Region "PARAMETER LIST" +#Region "FIELDS & PROPERTIES" + 'Private m_Parameter As CompoParam Private m_ParameterList As New ObservableCollection(Of ItemGeometry) @@ -146,9 +123,50 @@ Public Class GeometryListConfigVM Private m_SelParameter As String Private m_CurrentWork() As String +#End Region ' Fileds & Properties + #End Region ' Parameter List -#Region "METODI" +#Region "Messages" + + Public ReadOnly Property Title As String + Get + ' 50721=New Geometry + Return EgtMsg(50721) + End Get + End Property + Public ReadOnly Property GeometryNameMsg As String + Get + ' 50722=Geometry Name + Return EgtMsg(50722) + End Get + End Property + Public ReadOnly Property TypeHardwareMsg As String + Get + ' 50723=Type Hardware + Return EgtMsg(50723) + End Get + End Property + Public ReadOnly Property ParameterMsg As String + Get + ' 50724=Parameter + Return EgtMsg(50724) + End Get + End Property + Public ReadOnly Property SaveMsg As String + Get + ' 50410=Save + Return EgtMsg(50410) + End Get + End Property + +#End Region ' Messages + + Private m_CmdSave As ICommand + +#End Region ' Fields & Properties + +#Region "METHODS" Public Function LoadNameComboBoxLua(LocalHardware As Hardware) As Boolean ' prima di ricaricare la lista deve essere svuotata @@ -242,11 +260,35 @@ Public Class GeometryListConfigVM Return bNameExists End Function -#End Region +#End Region ' Methods - Private m_CmdSave As ICommand +#Region "CONSTRUCTOR" -#Region "SAVE" + Sub New(ParamName As String) + ' carico la lista degli Hardware + For Each Element In Map.refCompoPanelVM.CompoTypeList + m_HardwareList.Add(Element) + m_GraphicHardwareList.Add(Element.Name) + m_HardwareTemp = Map.refHardwarePageVM.CurrHardware + If Map.refHardwarePageVM.CurrHardware.HardwareGeneral.Name = Element.Name Then + ' selziono il nome da mostrare in grafica + m_SelGraphicHardware = m_GraphicHardwareList(m_GraphicHardwareList.Count - 1) + m_SelHardware = Element + End If + Next + If Not String.IsNullOrEmpty(ParamName) Then + GeometryName = ParamName + End If + ' carico la lista dei Parametri + LoadNameComboBoxLua(Map.refHardwarePageVM.CurrHardware) + GetWorkListGeometryName(m_HardwareTemp.HardwareGeneral.DDFName) + End Sub + +#End Region ' Constructor + +#Region "COMMANDS" + +#Region "SaveCommand" Public ReadOnly Property SaveCommand As ICommand Get @@ -375,33 +417,17 @@ Public Class GeometryListConfigVM AddNewGeometryNameList() End Sub -#End Region ' Save +#End Region ' SaveCommand - Sub New(ParamName As String) - ' carico la lista degli Hardware - For Each Element In Map.refCompoPanelVM.CompoTypeList - m_HardwareList.Add(Element) - m_GraphicHardwareList.Add(Element.Name) - m_HardwareTemp = Map.refHardwarePageVM.CurrHardware - If Map.refHardwarePageVM.CurrHardware.HardwareGeneral.Name = Element.Name Then - ' selziono il nome da mostrare in grafica - m_SelGraphicHardware = m_GraphicHardwareList(m_GraphicHardwareList.Count - 1) - m_SelHardware = Element - End If - Next - If Not String.IsNullOrEmpty(ParamName) Then - GeometryName = ParamName - End If - ' carico la lista dei Parametri - LoadNameComboBoxLua(Map.refHardwarePageVM.CurrHardware) - GetWorkListGeometryName(m_HardwareTemp.HardwareGeneral.DDFName) - End Sub +#End Region ' Commands End Class Public Class ItemGeometry Inherits VMBase +#Region "FIELDS & PROPERTIES" + Private m_NameDDF As String = String.Empty Public ReadOnly Property NameDDF As String Get @@ -431,8 +457,14 @@ Public Class ItemGeometry End Set End Property +#End Region ' Fields & Properties + +#Region "CONSTRUCTOR" + Sub New(sNameDDF As String) m_NameDDF = sNameDDF End Sub +#End Region ' Constructor + End Class diff --git a/HardwareManager/HardwarePageV.xaml b/HardwareManager/HardwarePageV.xaml index 79176df..b953457 100644 --- a/HardwareManager/HardwarePageV.xaml +++ b/HardwareManager/HardwarePageV.xaml @@ -123,12 +123,6 @@ Visibility="{Binding GroupVisibilityChapter}" IsEnabled="{Binding EnableChapter}" Style="{DynamicResource HardwareExpander}"> -