2 using System.Collections.Generic;
\r
11 // var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(AppSetting));
\r
12 // FileStream fs = new FileStream(設定ファイル名, FileMode.Create);
\r
13 // xmlsl.Serialize(fs, this.アプリ設定);
\r
19 // var xmlsl = new System.Xml.Serialization.XmlSerializer(typeof(AppSetting));
\r
20 // FileStream fs = new FileStream(設定ファイル名, FileMode.Open);
\r
21 // this.アプリ設定 = (AppSetting)xmlsl.Deserialize(fs);
\r
24 // catch (Exception)
\r
26 // Debug.WriteLine("アプリ設定ファイルの読み込みに失敗しました。");
\r
30 public class AppSetting
\r
36 this._SoundListColumnWidth[ 0 ] = 80;
\r
37 this._SoundListColumnWidth[ 1 ] = 28;
\r
38 this._SoundListColumnWidth[ 2 ] = 80;
\r
39 this._SoundListColumnWidth[ 3 ] = 40;
\r
40 this._SoundListColumnWidth[ 4 ] = 60;
\r
41 this._GraphicListColumnWidth[ 0 ] = 34;
\r
42 this._GraphicListColumnWidth[ 1 ] = 127;
\r
43 this._GraphicListColumnWidth[ 2 ] = 28;
\r
44 this._GraphicListColumnWidth[ 3 ] = 120;
\r
45 this._MovieListColumnWidth[ 0 ] = 127;
\r
46 this._MovieListColumnWidth[ 1 ] = 28;
\r
47 this._MovieListColumnWidth[ 2 ] = 120;
\r
48 this._LastWorkFolder = Directory.GetCurrentDirectory();
\r
49 this._ViewerInfo = new Viewer();
\r
54 // プロパティ(1) オプション項目関連
\r
56 #region [ List<string> RecentUsedFile - 最近使ったファイル名のリスト ]
\r
58 public List<string> RecentUsedFile
\r
63 private List<string> _RecentUsedFile = new List<string>();
\r
67 public void AddRecentUsedFile( string fileName )
\r
69 for( int i = 0; i < this._RecentUsedFile.Count; i++ )
\r
71 if( this._RecentUsedFile[ i ].Equals( fileName ) )
\r
73 this._RecentUsedFile.RemoveAt( i );
\r
77 this._RecentUsedFile.Insert( 0, fileName );
\r
78 if( this._RecentUsedFile.Count > 10 )
\r
80 int num2 = this._RecentUsedFile.Count - 10;
\r
81 for( int j = 0; j < num2; j++ )
\r
83 this._RecentUsedFile.RemoveAt( 10 + j );
\r
87 public bool bSameVersion()
\r
89 return ( this._ConfigVersion == _ConfigSchemaVersion );
\r
91 public void Confirm()
\r
93 if( this._RecentFilesNum <= 0 )
\r
95 this._RecentFilesNum = 5;
\r
96 this._ShowRecentFiles = false;
\r
98 else if( this._RecentFilesNum > 10 )
\r
100 this._RecentFilesNum = 10;
\r
104 public bool AutoFocus
\r
108 return this._AutoFocus;
\r
112 this._AutoFocus = value;
\r
115 public int ConfigVersion
\r
119 return this._ConfigVersion;
\r
123 this._ConfigVersion = value;
\r
126 public int[] GraphicListColumnWidth
\r
130 return this._GraphicListColumnWidth;
\r
134 this._GraphicListColumnWidth = value;
\r
137 public int GuideIndex
\r
141 return this._GuideIndex;
\r
145 this._GuideIndex = value;
\r
146 if( this._GuideIndex < 0 )
\r
148 this._GuideIndex = 0;
\r
150 else if( this._GuideIndex > 8 )
\r
152 this._GuideIndex = 8;
\r
160 return this._Height;
\r
164 this._Height = value;
\r
165 if( this._Height < 0 )
\r
171 public int HViewScaleIndex
\r
175 return this._HViewScaleIndex;
\r
179 this._HViewScaleIndex = value;
\r
180 if( this._HViewScaleIndex < 0 )
\r
182 this._HViewScaleIndex = 0;
\r
184 else if( this._HViewScaleIndex > 9 )
\r
186 this._HViewScaleIndex = 9;
\r
190 public string LastWorkFolder
\r
194 return this._LastWorkFolder;
\r
198 this._LastWorkFolder = value;
\r
201 public bool Maximized
\r
205 return this._Maximized;
\r
209 this._Maximized = value;
\r
212 public int[] MovieListColumnWidth
\r
216 return this._MovieListColumnWidth;
\r
220 this._MovieListColumnWidth = value;
\r
223 public bool NoPreviewBGM
\r
227 return this._NoPreviewBGM;
\r
231 this._NoPreviewBGM = value;
\r
234 public bool PlaySoundOnWAVChipAllocated
\r
238 return this._PlaySoundOnWAVChipAllocated;
\r
242 this._PlaySoundOnWAVChipAllocated = value;
\r
245 public int RecentFilesNum
\r
249 return this._RecentFilesNum;
\r
253 this._RecentFilesNum = value;
\r
256 public bool ShowRecentFiles
\r
260 return this._ShowRecentFiles;
\r
264 this._ShowRecentFiles = value;
\r
267 public int[] SoundListColumnWidth
\r
271 return this._SoundListColumnWidth;
\r
275 this._SoundListColumnWidth = value;
\r
278 public int SplitterDistance
\r
282 return this._SplitterDistance;
\r
286 this._SplitterDistance = value;
\r
289 public Viewer ViewerInfo
\r
293 return this._ViewerInfo;
\r
297 this._ViewerInfo = value;
\r
304 return this._Width;
\r
308 this._Width = value;
\r
309 if( this._Width < 0 )
\r
338 public class Viewer
\r
340 public string Path = "DTXV.exe";
\r
341 public string PlayStartFromOption = "-N";
\r
342 public string PlayStartOption = "-N-1";
\r
343 public string PlayStopOption = "-S";
\r
346 #region [ private ]
\r
347 //-----------------
\r
348 private bool _AutoFocus = true;
\r
349 private static int _ConfigSchemaVersion = 0x69;
\r
350 private int _ConfigVersion = _ConfigSchemaVersion;
\r
351 private int[] _GraphicListColumnWidth = new int[ 4 ];
\r
352 private int _GuideIndex = 3;
\r
353 private int _Height = 0x1db;
\r
354 private int _HViewScaleIndex;
\r
355 private string _LastWorkFolder = "";
\r
356 private bool _Maximized;
\r
357 private int[] _MovieListColumnWidth = new int[ 3 ];
\r
358 private bool _NoPreviewBGM = true;
\r
359 private bool _PlaySoundOnWAVChipAllocated = true;
\r
360 private int _RecentFilesNum = 5;
\r
361 private bool _ShowRecentFiles = true;
\r
362 private int[] _SoundListColumnWidth = new int[ 5 ];
\r
363 private int _SplitterDistance = 0x128;
\r
364 private Viewer _ViewerInfo;
\r
365 private int _Width = 600;
\r
368 //-----------------
\r