1- using Avalonia . Controls ;
2- using System ;
1+ using System ;
2+ using System . Collections . Generic ;
33using System . Diagnostics . CodeAnalysis ;
44using System . IO ;
55using System . Text ;
66using System . Text . Encodings . Web ;
77using System . Text . Json ;
8- using VP . NET . GUI . ViewModels ;
98
109namespace VP . NET . GUI . Models
1110{
11+ public class ExternalPreviewApp
12+ {
13+ public string Path { get ; set ; } = string . Empty ;
14+ public string Arguments { get ; set ; } = string . Empty ;
15+ public string Extension { get ; set ; } = string . Empty ;
16+
17+ public ExternalPreviewApp ( string path , string arguments , string extension )
18+ {
19+ Path = path ;
20+ Arguments = arguments ;
21+ Extension = extension ;
22+ }
23+ }
24+
1225 /// <summary>
1326 /// Class to store VP Net GUI settings
1427 /// </summary>
@@ -28,6 +41,8 @@ public class Settings
2841 public string ? ToolLastFolderToVPFolderPath { get ; set ; } = null ;
2942 public string ? ToolLastFolderToVPVPSavePath { get ; set ; } = null ;
3043 public bool PreviewerEnabled { get ; set ; } = true ;
44+ public bool PreviewerTextViewer { get ; set ; } = true ;
45+ public List < ExternalPreviewApp > ExternalExtensions { get ; set ; } = new List < ExternalPreviewApp > ( ) ;
3146
3247 [ UnconditionalSuppressMessage ( "Trimming" , "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code" , Justification = "<Pending>" ) ]
3348 public void Load ( )
@@ -53,6 +68,8 @@ public void Load()
5368 ToolLastVPCompressionDestinationPath = tempSettings . ToolLastVPCompressionDestinationPath ;
5469 PreviewerEnabled = tempSettings . PreviewerEnabled ;
5570 LastAddFilesPath = tempSettings . LastAddFilesPath ;
71+ PreviewerTextViewer = tempSettings . PreviewerTextViewer ;
72+ ExternalExtensions = tempSettings . ExternalExtensions ;
5673 }
5774
5875 }
@@ -63,8 +80,27 @@ public void Load()
6380 }
6481 }
6582
83+ public void Reset ( )
84+ {
85+ LastFileExtractionPath = null ;
86+ LastVPLoadPath = null ;
87+ ToolLastLZ41FileDecompressionOpenPath = null ;
88+ ToolLastLZ41FileDecompressionDestinationPath = null ;
89+ ToolLastLZ41FileCompressionOpenPath = null ;
90+ ToolLastLZ41FileCompressionDestinationPath = null ;
91+ ToolLastVPDecompressionOpenPath = null ;
92+ ToolLastVPDecompressionDestinationPath = null ;
93+ ToolLastVPCompressionOpenPath = null ;
94+ ToolLastVPCompressionDestinationPath = null ;
95+ PreviewerEnabled = true ;
96+ PreviewerTextViewer = true ;
97+ LastAddFilesPath = null ;
98+ ExternalExtensions . Clear ( ) ;
99+ Save ( ) ;
100+ }
101+
66102 [ UnconditionalSuppressMessage ( "Trimming" , "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code" , Justification = "<Pending>" ) ]
67- public void Save ( bool writeIni = true )
103+ public void Save ( )
68104 {
69105 try
70106 {
0 commit comments