├── .vs
├── Booksonic Editor
│ ├── v14
│ │ └── .suo
│ └── v15
│ │ ├── .suo
│ │ └── Server
│ │ └── sqlite3
│ │ ├── db.lock
│ │ ├── storage.ide
│ │ ├── storage.ide-shm
│ │ └── storage.ide-wal
└── Booksonic Library Editor
│ └── v14
│ └── .suo
├── Booksonic Editor.sln
├── Booksonic Editor
├── Booksonic Library Editor.csproj
├── Booksonic Library Editor.csproj.user
├── Editor.Designer.cs
├── Editor.cs
├── Editor.resx
├── Program.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── Resources
│ ├── DescBuilder.jar
│ └── booksonic.ico
├── app.config
├── bin
│ ├── Debug
│ │ ├── Booksonic Editor.exe
│ │ ├── Booksonic Editor.exe.config
│ │ ├── Booksonic Editor.pdb
│ │ ├── Booksonic Editor.vshost.exe
│ │ ├── Booksonic Editor.vshost.exe.config
│ │ ├── Booksonic Editor.vshost.exe.manifest
│ │ ├── log
│ │ │ └── booksonic-library-editor.log
│ │ ├── log4net.dll
│ │ └── log4net.xml
│ ├── Debugeditor.log
│ └── Release
│ │ ├── Booksonic Editor.exe
│ │ ├── Booksonic Editor.exe.config
│ │ ├── Booksonic Editor.pdb
│ │ ├── Booksonic Editor.vshost.exe
│ │ ├── Booksonic Editor.vshost.exe.config
│ │ ├── Booksonic Editor.vshost.exe.manifest
│ │ ├── log4net.dll
│ │ └── log4net.xml
├── obj
│ ├── Debug
│ │ ├── Booksonic Editor.exe
│ │ ├── Booksonic Editor.pdb
│ │ ├── Booksonic Library Editor.csproj.CopyComplete
│ │ ├── Booksonic Library Editor.csproj.CoreCompileInputs.cache
│ │ ├── Booksonic Library Editor.csproj.FileListAbsolute.txt
│ │ ├── Booksonic Library Editor.csproj.GenerateResource.Cache
│ │ ├── Booksonic Library Editor.csprojAssemblyReference.cache
│ │ ├── Booksonic Library Editor.csprojResolveAssemblyReference.cache
│ │ ├── Booksonic_Editor.Editor.resources
│ │ ├── Booksonic_Editor.Properties.Resources.resources
│ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ └── TempPE
│ │ │ └── Properties.Resources.Designer.cs.dll
│ └── Release
│ │ ├── Booksonic Editor.exe
│ │ ├── Booksonic Editor.pdb
│ │ ├── Booksonic Library Editor.csproj.CopyComplete
│ │ ├── Booksonic Library Editor.csproj.CoreCompileInputs.cache
│ │ ├── Booksonic Library Editor.csproj.FileListAbsolute.txt
│ │ ├── Booksonic Library Editor.csproj.GenerateResource.Cache
│ │ ├── Booksonic Library Editor.csprojAssemblyReference.cache
│ │ ├── Booksonic_Editor.Editor.resources
│ │ ├── Booksonic_Editor.Properties.Resources.resources
│ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ └── TempPE
│ │ └── Properties.Resources.Designer.cs.dll
└── packages.config
├── Booksonic Library Editor 2.png
├── Booksonic Library Editor 3.png
├── Booksonic Library Editor 4.png
├── Booksonic Library Editor 5.png
├── Booksonic Library Editor.png
├── Booksonic Setup
├── Booksonic Setup.vdproj
├── BooksonicLibraryEditorInstaller.SED
├── Debug
│ ├── Booksonic Setup.msi
│ └── setup.exe
└── Release
│ └── Booksonic Library Editor 2.0.zip
├── README.md
├── UpgradeLog.htm
└── packages
└── log4net.2.0.8
├── .signature.p7s
├── lib
├── net20-full
│ ├── log4net.dll
│ └── log4net.xml
├── net35-client
│ ├── log4net.dll
│ └── log4net.xml
├── net35-full
│ ├── log4net.dll
│ └── log4net.xml
├── net40-client
│ ├── log4net.dll
│ └── log4net.xml
├── net40-full
│ ├── log4net.dll
│ └── log4net.xml
├── net45-full
│ ├── log4net.dll
│ └── log4net.xml
└── netstandard1.3
│ └── log4net.dll
└── log4net.2.0.8.nupkg
/.vs/Booksonic Editor/v14/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v14/.suo
--------------------------------------------------------------------------------
/.vs/Booksonic Editor/v15/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v15/.suo
--------------------------------------------------------------------------------
/.vs/Booksonic Editor/v15/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v15/Server/sqlite3/db.lock
--------------------------------------------------------------------------------
/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide
--------------------------------------------------------------------------------
/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide-shm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide-shm
--------------------------------------------------------------------------------
/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide-wal:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Editor/v15/Server/sqlite3/storage.ide-wal
--------------------------------------------------------------------------------
/.vs/Booksonic Library Editor/v14/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/galacticat/booksonic-library-editor/c2cecf9bef7212eacb3e276c8ecd7579f25de581/.vs/Booksonic Library Editor/v14/.suo
--------------------------------------------------------------------------------
/Booksonic Editor.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Booksonic Library Editor", "Booksonic Editor\Booksonic Library Editor.csproj", "{E41055A4-4892-424D-8B4A-D56E458A976E}"
7 | EndProject
8 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Booksonic Setup", "Booksonic Setup\Booksonic Setup.vdproj", "{DA0F87E4-49EB-4843-BE13-AC7EAE34024C}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{50667633-E67A-4CA0-9285-4F9C06C20ECD}"
11 | ProjectSection(SolutionItems) = preProject
12 | Booksonic Library Editor.png = Booksonic Library Editor.png
13 | README.md = README.md
14 | EndProjectSection
15 | EndProject
16 | Global
17 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
18 | Debug|Any CPU = Debug|Any CPU
19 | Release|Any CPU = Release|Any CPU
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {E41055A4-4892-424D-8B4A-D56E458A976E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {E41055A4-4892-424D-8B4A-D56E458A976E}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {E41055A4-4892-424D-8B4A-D56E458A976E}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {E41055A4-4892-424D-8B4A-D56E458A976E}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {DA0F87E4-49EB-4843-BE13-AC7EAE34024C}.Debug|Any CPU.ActiveCfg = Debug
27 | {DA0F87E4-49EB-4843-BE13-AC7EAE34024C}.Release|Any CPU.ActiveCfg = Release
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/Booksonic Editor/Booksonic Library Editor.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {E41055A4-4892-424D-8B4A-D56E458A976E}
8 | WinExe
9 | Properties
10 | Booksonic_Editor
11 | Booksonic Editor
12 | v4.0
13 | 512
14 | publish\
15 | true
16 | Disk
17 | false
18 | Foreground
19 | 7
20 | Days
21 | false
22 | false
23 | true
24 | 0
25 | 1.0.0.%2a
26 | false
27 | false
28 | true
29 |
30 |
31 |
32 |
33 |
34 | AnyCPU
35 | true
36 | full
37 | false
38 | bin\Debug\
39 | DEBUG;TRACE
40 | prompt
41 | 4
42 |
43 |
44 | AnyCPU
45 | pdbonly
46 | true
47 | bin\Release\
48 | TRACE
49 | prompt
50 | 4
51 |
52 |
53 | Resources\booksonic.ico
54 |
55 |
56 |
57 | ..\packages\log4net.2.0.8\lib\net40-full\log4net.dll
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Form
73 |
74 |
75 | Editor.cs
76 |
77 |
78 |
79 |
80 | Editor.cs
81 |
82 |
83 | ResXFileCodeGenerator
84 | Resources.Designer.cs
85 | Designer
86 |
87 |
88 | True
89 | Resources.resx
90 | True
91 |
92 |
93 |
94 |
95 | SettingsSingleFileGenerator
96 | Settings.Designer.cs
97 |
98 |
99 | True
100 | Settings.settings
101 | True
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | False
110 | .NET Framework 3.5 SP1
111 | true
112 |
113 |
114 |
115 |
122 |
--------------------------------------------------------------------------------
/Booksonic Editor/Booksonic Library Editor.csproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | publish\
5 |
6 |
7 |
8 |
9 |
10 | en-US
11 | false
12 |
13 |
--------------------------------------------------------------------------------
/Booksonic Editor/Editor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Diagnostics;
6 | using System.Drawing;
7 | using System.Drawing.Imaging;
8 | using System.Linq;
9 | using System.Text;
10 | using System.IO;
11 | using System.Windows.Forms;
12 | using System.Xml;
13 |
14 | namespace Booksonic_Editor
15 | {
16 | public partial class Editor : Form
17 | {
18 | private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
19 | public XmlDocument xmlLibrary;
20 |
21 | private string _strRootDirectory = string.Empty;
22 | public string strRootDirectory
23 | {
24 | get
25 | {
26 | _strRootDirectory = Properties.Settings.Default.libraryPath;
27 | return _strRootDirectory;
28 | }
29 | set
30 | {
31 | _strRootDirectory = value;
32 | callRootDirectoryChanged();
33 | }
34 | }
35 | protected void callRootDirectoryChanged()
36 | {
37 | tbLibraryPathValue.Text = _strRootDirectory;
38 | labelLibraryPathValue.Text = _strRootDirectory;
39 | }
40 | private void tbLibraryPathValue_TextChanged(object sender, EventArgs e)
41 | {
42 | if (tbLibraryPathValue.Text != Properties.Settings.Default.libraryPath)
43 | {
44 | buttonConfigSave.Enabled = true;
45 | }
46 | }
47 | private void buttonLibraryBrowse_Click(object sender, EventArgs e)
48 | {
49 | FolderBrowserDialog choofldlog = new FolderBrowserDialog();
50 | DialogResult result = choofldlog.ShowDialog();
51 | if (result == DialogResult.OK)
52 | {
53 | tbLibraryPathValue.Text = choofldlog.SelectedPath;
54 | }
55 | }
56 |
57 | private string _strJavaPath = string.Empty;
58 | public string strJavaPath
59 | {
60 | get
61 | {
62 | _strJavaPath = Properties.Settings.Default.javaPath;
63 | return _strJavaPath;
64 | }
65 | set
66 | {
67 | _strJavaPath = value;
68 | callJavaPathChanged();
69 | }
70 | }
71 | protected void callJavaPathChanged()
72 | {
73 | tbJavaPathValue.Text = _strJavaPath;
74 | if (_strJavaPath != string.Empty && _strScriptPath != string.Empty)
75 | {
76 | script_button.Enabled = true;
77 | }
78 | else
79 | {
80 | script_button.Enabled = false;
81 | }
82 | }
83 | private void tbJavaPathValue_TextChanged(object sender, EventArgs e)
84 | {
85 | if (tbJavaPathValue.Text != Properties.Settings.Default.javaPath)
86 | {
87 | buttonConfigSave.Enabled = true;
88 | }
89 | }
90 | private void buttonJavaPathBrowse_Click(object sender, EventArgs e)
91 | {
92 | OpenFileDialog choofdlog = new OpenFileDialog();
93 | choofdlog.Filter = "Executable (*.exe)|*.exe|All files (*.*)|*.*";
94 | choofdlog.FilterIndex = 1;
95 | choofdlog.Multiselect = false;
96 | DialogResult result = choofdlog.ShowDialog();
97 | if (result == DialogResult.OK)
98 | {
99 | tbJavaPathValue.Text = choofdlog.FileName;
100 | }
101 | }
102 |
103 | private string _strScriptPath = string.Empty;
104 | public string strScriptPath
105 | {
106 | get
107 | {
108 | _strScriptPath = Properties.Settings.Default.scriptPath;
109 | return _strScriptPath;
110 | }
111 | set
112 | {
113 | _strScriptPath = value;
114 | callScriptPathChanged();
115 | }
116 | }
117 | protected void callScriptPathChanged()
118 | {
119 | tbScriptPathValue.Text = _strScriptPath;
120 | if (_strJavaPath != string.Empty && _strScriptPath != string.Empty)
121 | {
122 | script_button.Enabled = true;
123 | }
124 | else
125 | {
126 | script_button.Enabled = false;
127 | }
128 | }
129 | private void tbScriptPathValue_TextChanged(object sender, EventArgs e)
130 | {
131 | if (tbScriptPathValue.Text != Properties.Settings.Default.scriptPath)
132 | {
133 | buttonConfigSave.Enabled = true;
134 | }
135 | }
136 | private void buttonScriptPathBrowse_Click(object sender, EventArgs e)
137 | {
138 | OpenFileDialog choofdlog = new OpenFileDialog();
139 | choofdlog.Filter = "Java Script (*.jar)|*.jar|All files (*.*)|*.*";
140 | choofdlog.FilterIndex = 1;
141 | choofdlog.Multiselect = false;
142 | DialogResult result = choofdlog.ShowDialog();
143 | if (result == DialogResult.OK)
144 | {
145 | tbScriptPathValue.Text = choofdlog.FileName;
146 | }
147 | }
148 |
149 | private Encoding[] AvailableEncoding = { Encoding.UTF7, Encoding.UTF8, Encoding.Unicode, Encoding.BigEndianUnicode, Encoding.UTF32, Encoding.ASCII };
150 | private Encoding _defaultEncoding = Encoding.UTF8;
151 | private string _txtEncoding = "Unicode (UTF-8)";
152 | public string txtEncoding
153 | {
154 | get
155 | {
156 | _txtEncoding = Properties.Settings.Default.encoding;
157 | return _txtEncoding;
158 | }
159 | set
160 | {
161 | _txtEncoding = value;
162 | callTxtEncodingChanged();
163 | }
164 | }
165 | protected void callTxtEncodingChanged()
166 | {
167 | cbEncodings.SelectedIndex = cbEncodings.FindStringExact(_txtEncoding);
168 | }
169 | private void cbEncodings_SelectedIndexChanged(object sender, EventArgs e)
170 | {
171 | if (cbEncodings.SelectedIndex != cbEncodings.FindStringExact(Properties.Settings.Default.encoding))
172 | {
173 | buttonConfigSave.Enabled = true;
174 | }
175 | }
176 |
177 | private bool _boolLibraryCheck = false;
178 | public bool boolLibraryCheck
179 | {
180 | get
181 | {
182 | _boolLibraryCheck = Properties.Settings.Default.libraryCheck;
183 | return _boolLibraryCheck;
184 | }
185 | set
186 | {
187 | _boolLibraryCheck = value;
188 | callLibraryCheckChanged();
189 | }
190 | }
191 | protected void callLibraryCheckChanged()
192 | {
193 | cbCheckLibraryStartup.Checked = _boolLibraryCheck;
194 | }
195 | private void cbCheckLibraryStartup_CheckedChanged(object sender, EventArgs e)
196 | {
197 | if (cbCheckLibraryStartup.Checked != Properties.Settings.Default.libraryCheck)
198 | {
199 | buttonConfigSave.Enabled = true;
200 | }
201 | }
202 |
203 | private void buttonConfigSave_Click(object sender, EventArgs e)
204 | {
205 | try
206 | {
207 | _strRootDirectory = tbLibraryPathValue.Text;
208 | Properties.Settings.Default.libraryPath = _strRootDirectory;
209 | _strJavaPath = tbJavaPathValue.Text;
210 | Properties.Settings.Default.javaPath = _strJavaPath;
211 | _strScriptPath = tbScriptPathValue.Text;
212 | Properties.Settings.Default.scriptPath = _strScriptPath;
213 | _txtEncoding = cbEncodings.Text;
214 | Properties.Settings.Default.encoding = _txtEncoding;
215 | _boolLibraryCheck = cbCheckLibraryStartup.Checked;
216 | Properties.Settings.Default.libraryCheck = _boolLibraryCheck;
217 | Properties.Settings.Default.Save();
218 | buttonConfigSave.Enabled = false;
219 | Settings_Load();
220 | }
221 | catch (Exception ex)
222 | {
223 | log.Error(ex);
224 | }
225 | }
226 |
227 | private string _strSelectedPath = string.Empty;
228 | public string strSelectedPath
229 | {
230 | get
231 | {
232 | if (library_list.SelectedNode != null)
233 | {
234 | _strSelectedPath = _strRootDirectory + "\\" + library_list.SelectedNode.FullPath;
235 | }
236 | return _strSelectedPath;
237 | }
238 | set
239 | {
240 | _strSelectedPath = _strRootDirectory + "\\" + value;
241 | callSelectedPathChanged();
242 | }
243 | }
244 | protected void callSelectedPathChanged()
245 | {
246 | labelBookPathValue.Text = _strSelectedPath;
247 | open_button.Enabled = true;
248 | int subCount = 0;
249 | try { subCount = Directory.GetDirectories(_strSelectedPath).Count(); }
250 | catch { }
251 | if (subCount == 0)
252 | {
253 | strBookTitle = Path.GetFileName(_strSelectedPath);
254 | strReaderTxtPath = _strSelectedPath;
255 | strDescTxtPath = _strSelectedPath;
256 | strCoverPath = _strSelectedPath;
257 | narrator_textBox.Enabled = true;
258 | cmsCoverImage.Enabled = true;
259 | coverPictureBox.Enabled = true;
260 | synopsis_textBox.Enabled = true;
261 | previousNode_button.Enabled = true;
262 | nextNode_button.Enabled = true;
263 | }
264 | else
265 | {
266 | strBookTitle = "No Selection";
267 | strReaderTxtPath = "No Selection";
268 | strDescTxtPath = "No Selection";
269 | strCoverPath = "No Selection";
270 | narrator_textBox.Enabled = false;
271 | cmsCoverImage.Enabled = false;
272 | coverPictureBox.Enabled = false;
273 | synopsis_textBox.Enabled = false;
274 | previousNode_button.Enabled = false;
275 | nextNode_button.Enabled = false;
276 | save_button.Enabled = false;
277 | }
278 | }
279 |
280 | private string _strBookTitle = string.Empty;
281 | public string strBookTitle
282 | {
283 | get
284 | {
285 | _strBookTitle = Path.GetFileName(Path.GetDirectoryName(_strSelectedPath));
286 | return _strBookTitle;
287 | }
288 | set
289 | {
290 | _strBookTitle = value;
291 | callBookTitleChanged();
292 | }
293 | }
294 | protected void callBookTitleChanged()
295 | {
296 | book_title.Text = _strBookTitle;
297 | }
298 |
299 | private string _strReaderTxtPath = string.Empty;
300 | public string strReaderTxtPath
301 | {
302 | get
303 | {
304 | _strReaderTxtPath = _strSelectedPath + @"\reader.txt";
305 | return _strReaderTxtPath;
306 | }
307 | set
308 | {
309 | if (value == "No Selection")
310 | {
311 | _strReaderTxtPath = value;
312 | }
313 | else
314 | {
315 | _strReaderTxtPath = value + @"\reader.txt";
316 | }
317 | callReaderTxtPathChanged();
318 | }
319 | }
320 | protected void callReaderTxtPathChanged()
321 | {
322 | if (File.Exists(_strReaderTxtPath) && _txtEncoding != null)
323 | {
324 | strNarrator = File.ReadAllText(_strReaderTxtPath, GetEncoding(_strReaderTxtPath));
325 | }
326 | else
327 | {
328 | strNarrator = string.Empty;
329 | }
330 | }
331 |
332 | private string _strNarrator = string.Empty;
333 | public string strNarrator
334 | {
335 | get
336 | {
337 | if (_txtEncoding != string.Empty && _strReaderTxtPath != string.Empty && File.Exists(_strReaderTxtPath))
338 | {
339 | if (new FileInfo(_strReaderTxtPath).Length != 0)
340 | {
341 | _strNarrator = File.ReadAllText(_strReaderTxtPath, GetEncoding(_strReaderTxtPath));
342 | }
343 | else
344 | {
345 | _strNarrator = string.Empty;
346 | }
347 | }
348 | return _strNarrator;
349 | }
350 | set
351 | {
352 | _strNarrator = value;
353 | callNarratorChanged();
354 | }
355 | }
356 | protected void callNarratorChanged()
357 | {
358 | narrator_textBox.Text = _strNarrator;
359 | if (strNarrator != _strNarrator)
360 | {
361 | save_button.Enabled = true;
362 | }
363 | }
364 | private void narrator_textBox_TextChanged(object sender, EventArgs e)
365 | {
366 | if (narrator_textBox.Text != _strNarrator)
367 | {
368 | save_button.Enabled = true;
369 | }
370 | }
371 |
372 | private string _strTempCoverPath = string.Empty;
373 | public string strTempCoverPath
374 | {
375 | get
376 | {
377 | return _strTempCoverPath;
378 | }
379 | set
380 | {
381 | _strTempCoverPath = value;
382 | callTempCoverPath();
383 | }
384 | }
385 | protected void callTempCoverPath()
386 | {
387 | if (_strTempCoverPath != _strCoverPath)
388 | {
389 | cover_image.Text = "Image to Save: " + _strTempCoverPath;
390 | cover_image.Font = new Font(cover_image.Font, FontStyle.Italic);
391 | coverPictureBox.ImageLocation = _strTempCoverPath;
392 | save_button.Enabled = true;
393 | }
394 | }
395 |
396 | private string _strCoverPath = string.Empty;
397 | public string strCoverPath
398 | {
399 | get
400 | {
401 | _strCoverPath = _strSelectedPath + @"\cover.jpg";
402 | return _strCoverPath;
403 | }
404 | set
405 | {
406 | _strCoverPath = value + @"\cover.jpg";
407 | callCoverPathChanged();
408 | }
409 | }
410 | protected void callCoverPathChanged()
411 | {
412 | if (System.IO.File.Exists(_strCoverPath))
413 | {
414 | cover_image.Text = _strCoverPath;
415 | cover_image.Font = new Font(cover_image.Font, FontStyle.Regular);
416 | coverPictureBox.ImageLocation = _strCoverPath;
417 | }
418 | else
419 | {
420 | cover_image.Text = String.Empty;
421 | coverPictureBox.ImageLocation = String.Empty;
422 | }
423 | }
424 | private void cover_textBox_TextChanged(object sender, EventArgs e)
425 | {
426 | if(cover_image.Text != _strCoverPath)
427 | {
428 | save_button.Enabled = true;
429 | }
430 | }
431 |
432 | private string _strDescTxtPath = string.Empty;
433 | public string strDescTxtPath
434 | {
435 | get
436 | {
437 | _strDescTxtPath = _strSelectedPath + @"\desc.txt";
438 | return _strDescTxtPath;
439 | }
440 | set
441 | {
442 | if(value == "No Selection")
443 | {
444 | _strDescTxtPath = value;
445 | }
446 | else
447 | {
448 | _strDescTxtPath = value + @"\desc.txt";
449 | }
450 | callDescTxtPathChanged();
451 | }
452 | }
453 | protected void callDescTxtPathChanged()
454 | {
455 | if (File.Exists(_strDescTxtPath))
456 | {
457 | strSynopsis = File.ReadAllText(_strDescTxtPath, GetEncoding(_strDescTxtPath));
458 | }
459 | else
460 | {
461 | strSynopsis = string.Empty;
462 | }
463 | }
464 |
465 | private string _strSynopsis = string.Empty;
466 | public string strSynopsis
467 | {
468 | get
469 | {
470 | if (_txtEncoding != string.Empty && _strDescTxtPath != string.Empty && File.Exists(_strDescTxtPath))
471 | {
472 | if(new FileInfo(_strDescTxtPath).Length != 0)
473 | {
474 | _strSynopsis = File.ReadAllText(_strDescTxtPath, GetEncoding(_strDescTxtPath));
475 | }
476 | else
477 | {
478 | _strSynopsis = string.Empty;
479 | }
480 | }
481 | return _strSynopsis;
482 | }
483 | set
484 | {
485 | _strSynopsis = value;
486 | callSynopsisChanged();
487 | }
488 | }
489 | protected void callSynopsisChanged()
490 | {
491 | synopsis_textBox.Text = _strSynopsis;
492 | if (strSynopsis != _strSynopsis)
493 | {
494 | save_button.Enabled = true;
495 | }
496 | }
497 | private void synopsis_textBox_TextChanged(object sender, EventArgs e)
498 | {
499 | if (synopsis_textBox.Text != strSynopsis)
500 | {
501 | save_button.Enabled = true;
502 | }
503 | }
504 |
505 | public Editor()
506 | {
507 | InitializeComponent();
508 | //Enables hot keys handler
509 | this.KeyPreview = true;
510 | this.KeyDown += new KeyEventHandler(Form_KeyDown);
511 |
512 | //Creates tooltips
513 | ToolTip toolTip1 = new ToolTip();
514 | toolTip1.SetToolTip(search_button, "Applies the search filter" + Environment.NewLine + "Hotkey: Enter");
515 | toolTip1.SetToolTip(previousNode_button, "Selects the previous book from the tree" + Environment.NewLine + "Hotkey: Page Up");
516 | toolTip1.SetToolTip(nextNode_button, "Selects the next book from the tree" + Environment.NewLine + "Hotkey: Page Down");
517 | toolTip1.SetToolTip(save_button, "Saves the reader.txt and desc.txt" + Environment.NewLine + "Hotkey: Ctrl+S");
518 | toolTip1.SetToolTip(script_button, "Script Runs with the following syntax:" + Environment.NewLine + " -jar