• R/O
  • SSH
  • HTTPS

autocodeforsql: Commit


Commit MetaInfo

Revision108 (tree)
Time2018-06-14 10:39:42
Authorhilinwei

Log Message

Change Summary

Incremental Difference

--- AutoEpub3/cEpub5.vb (revision 107)
+++ AutoEpub3/cEpub5.vb (revision 108)
@@ -147,10 +147,21 @@
147147 uChart.sbText.Append(htmlAddText(uLine.Trim()))
148148 Next
149149 uChart.sbText.Append(htmlBodyEnd)
150+
151+ If mChart.HtmlText.Trim().Length > 0 Then
152+
153+ uChart.sbText.Clear()
154+ uChart.sbText.Append(mChart.HtmlText)
155+
156+ End If
157+
150158 System.IO.File.WriteAllText(uChart.sPath, uChart.sbText.ToString(), encUTF8)
151159 Next
152160
153161 cfVolume.sbText.Append(htmlBodyEnd)
162+
163+
164+
154165 System.IO.File.WriteAllText(cfVolume.sPath, cfVolume.sbText.ToString(), encUTF8)
155166 EndVolume()
156167
@@ -776,6 +787,7 @@
776787
777788 Public Property listText As New List(Of String)
778789
790+ Public Property HtmlText As String
779791
780792 End Class
781793
--- AutoEpub3/AutoEpub3.Designer.vb (revision 107)
+++ AutoEpub3/AutoEpub3.Designer.vb (revision 108)
@@ -24,6 +24,7 @@
2424 Private Sub InitializeComponent()
2525 Me.btnText = New System.Windows.Forms.Button()
2626 Me.btnTitle = New System.Windows.Forms.Button()
27+ Me.Button1 = New System.Windows.Forms.Button()
2728 Me.SuspendLayout()
2829 '
2930 'btnText
@@ -44,11 +45,21 @@
4445 Me.btnTitle.Text = "btn JP Text Dep 1 Title"
4546 Me.btnTitle.UseVisualStyleBackColor = True
4647 '
48+ 'Button1
49+ '
50+ Me.Button1.Location = New System.Drawing.Point(277, 146)
51+ Me.Button1.Name = "Button1"
52+ Me.Button1.Size = New System.Drawing.Size(187, 65)
53+ Me.Button1.TabIndex = 2
54+ Me.Button1.Text = "btn JP Text Dep 1 Title"
55+ Me.Button1.UseVisualStyleBackColor = True
56+ '
4757 'AutoEpub3
4858 '
4959 Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
5060 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
5161 Me.ClientSize = New System.Drawing.Size(509, 262)
62+ Me.Controls.Add(Me.Button1)
5263 Me.Controls.Add(Me.btnTitle)
5364 Me.Controls.Add(Me.btnText)
5465 Me.Name = "AutoEpub3"
@@ -60,4 +71,5 @@
6071
6172 Friend WithEvents btnText As Button
6273 Friend WithEvents btnTitle As Button
74+ Friend WithEvents Button1 As Button
6375 End Class
--- AutoEpub3/AutoEpub2.vb (revision 107)
+++ AutoEpub3/AutoEpub2.vb (revision 108)
@@ -24,9 +24,13 @@
2424
2525 End Sub
2626
27+ Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
2728
29+ End Sub
2830
2931
32+
33+
3034 'Cover Img Size 600*850
3135
3236
--- AutoEpub3/AutoEpub3.vb (revision 107)
+++ AutoEpub3/AutoEpub3.vb (revision 108)
@@ -1,5 +1,9 @@
1-Public Class AutoEpub3
1+Imports System.IO
2+Imports System.IO.Compression
23
4+
5+Public Class AutoEpub3
6+
37 Private Sub btnText_Click(sender As Object, e As EventArgs) Handles btnText.Click
48
59 Dim sTemp As String = String.Empty
@@ -45,6 +49,7 @@
4549
4650 cEpub.CreateEpub()
4751
52+
4853 MessageBox.Show("Finished")
4954
5055 End Sub
@@ -107,14 +112,71 @@
107112
108113 Next
109114
110- Dim cEpub As New cEpub5(emEpub5.emEncCode.SHIFT_JIS, emEpub5.emLan.JA, "風の扉", "夏樹静子", "LW_KANOTOBIRA", modelEpub)
115+ Dim cEpub As New cEpub5(emEpub5.emEncCode.SHIFT_JIS, emEpub5.emLan.JA, "A", "A", "A", modelEpub)
111116 cEpub.CreateEpub()
112117 MessageBox.Show("Finished")
113118
114119
115120
121+
116122 End Sub
117123
124+ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
118125
126+ Dim sPath As String = "C:\Soft\Temp\toc.ncx"
127+ Dim fs As System.IO.FileStream = New System.IO.FileStream(sPath, System.IO.FileMode.Open)
128+ Dim serializer As System.Xml.Serialization.XmlSerializer = New System.Xml.Serialization.XmlSerializer(GetType(ncx))
129+ Dim model As ncx = CType(serializer.Deserialize(fs), ncx)
119130
131+ Dim unitOne As ncxNavPoint = model.navMap(1)
132+ Dim modelEpub As New mEpub
133+
134+
135+ For Each ncxVolume As ncxNavPointNavPoint In unitOne.navPoint
136+ Dim unitVolume As New mVolume
137+ unitVolume.Title = ncxVolume.navLabel.text
138+
139+ For Each ncxChart As ncxNavPointNavPointNavPoint In ncxVolume.navPoint
140+ Dim unitChart As New mCharter
141+ unitChart.Title = ncxChart.navLabel.text
142+
143+ sPath = Path.Combine("C:\Users\vmware\Downloads\Reader 01-06", ncxChart.content.src)
144+ Dim pickPaht As String() = sPath.Split("#")
145+
146+ Dim srInPut As System.IO.StreamReader = Nothing
147+ srInPut = New System.IO.StreamReader(pickPaht(0))
148+
149+
150+
151+ Dim sBook As String = srInPut.ReadToEnd()
152+ unitChart.HtmlText = sBook
153+
154+
155+
156+ If pickPaht(0).IndexOf("split_000") > 0 Then
157+ sPath = pickPaht(0).Replace("split_000", "split_001")
158+ srInPut = New System.IO.StreamReader(sPath)
159+ Dim sBookAdd As String = srInPut.ReadToEnd()
160+ unitChart.HtmlText = unitChart.HtmlText & sBookAdd
161+ End If
162+
163+
164+ unitVolume.listCharter.Add(unitChart)
165+
166+ Next
167+
168+ modelEpub.listVolume.Add(unitVolume)
169+
170+ Next
171+
172+ Dim cEpub As New cEpub5(emEpub5.emEncCode.SHIFT_JIS, emEpub5.emLan.JA, "《读者》2017年第1期 ", "文摘", "Reader_201701", modelEpub)
173+ cEpub.CreateEpub()
174+ MessageBox.Show("Finished")
175+
176+
177+
178+
179+ End Sub
180+
181+
120182 End Class
\ No newline at end of file
--- AutoEpub3/modelNCX.vb (revision 0)
+++ AutoEpub3/modelNCX.vb (revision 108)
@@ -0,0 +1,381 @@
1+
2+'''<remarks/>
3+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/"),
4+ System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://www.daisy.org/z3986/2005/ncx/", IsNullable:=False)>
5+Partial Public Class ncx
6+
7+ Private navMapField() As ncxNavPoint
8+
9+ Private versionField As String
10+
11+ Private langField As String
12+
13+ '''<remarks/>
14+ <System.Xml.Serialization.XmlArrayItemAttribute("navPoint", IsNullable:=False)>
15+ Public Property navMap() As ncxNavPoint()
16+ Get
17+ Return Me.navMapField
18+ End Get
19+ Set
20+ Me.navMapField = Value
21+ End Set
22+ End Property
23+
24+ '''<remarks/>
25+ <System.Xml.Serialization.XmlAttributeAttribute()>
26+ Public Property version() As String
27+ Get
28+ Return Me.versionField
29+ End Get
30+ Set
31+ Me.versionField = Value
32+ End Set
33+ End Property
34+
35+ '''<remarks/>
36+ <System.Xml.Serialization.XmlAttributeAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Qualified, [Namespace]:="http://www.w3.org/XML/1998/namespace")>
37+ Public Property lang() As String
38+ Get
39+ Return Me.langField
40+ End Get
41+ Set
42+ Me.langField = Value
43+ End Set
44+ End Property
45+End Class
46+
47+'''<remarks/>
48+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
49+Partial Public Class ncxNavPoint
50+
51+ Private navLabelField As ncxNavPointNavLabel
52+
53+ Private contentField As ncxNavPointContent
54+
55+ Private navPointField() As ncxNavPointNavPoint
56+
57+ Private classField As String
58+
59+ Private idField As String
60+
61+ Private playOrderField As UShort
62+
63+ '''<remarks/>
64+ Public Property navLabel() As ncxNavPointNavLabel
65+ Get
66+ Return Me.navLabelField
67+ End Get
68+ Set
69+ Me.navLabelField = Value
70+ End Set
71+ End Property
72+
73+ '''<remarks/>
74+ Public Property content() As ncxNavPointContent
75+ Get
76+ Return Me.contentField
77+ End Get
78+ Set
79+ Me.contentField = Value
80+ End Set
81+ End Property
82+
83+ '''<remarks/>
84+ <System.Xml.Serialization.XmlElementAttribute("navPoint")>
85+ Public Property navPoint() As ncxNavPointNavPoint()
86+ Get
87+ Return Me.navPointField
88+ End Get
89+ Set
90+ Me.navPointField = Value
91+ End Set
92+ End Property
93+
94+ '''<remarks/>
95+ <System.Xml.Serialization.XmlAttributeAttribute()>
96+ Public Property [class]() As String
97+ Get
98+ Return Me.classField
99+ End Get
100+ Set
101+ Me.classField = Value
102+ End Set
103+ End Property
104+
105+ '''<remarks/>
106+ <System.Xml.Serialization.XmlAttributeAttribute()>
107+ Public Property id() As String
108+ Get
109+ Return Me.idField
110+ End Get
111+ Set
112+ Me.idField = Value
113+ End Set
114+ End Property
115+
116+ '''<remarks/>
117+ <System.Xml.Serialization.XmlAttributeAttribute()>
118+ Public Property playOrder() As UShort
119+ Get
120+ Return Me.playOrderField
121+ End Get
122+ Set
123+ Me.playOrderField = Value
124+ End Set
125+ End Property
126+End Class
127+
128+'''<remarks/>
129+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
130+Partial Public Class ncxNavPointNavLabel
131+
132+ Private textField As String
133+
134+ '''<remarks/>
135+ Public Property text() As String
136+ Get
137+ Return Me.textField
138+ End Get
139+ Set
140+ Me.textField = Value
141+ End Set
142+ End Property
143+End Class
144+
145+'''<remarks/>
146+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
147+Partial Public Class ncxNavPointContent
148+
149+ Private srcField As String
150+
151+ '''<remarks/>
152+ <System.Xml.Serialization.XmlAttributeAttribute()>
153+ Public Property src() As String
154+ Get
155+ Return Me.srcField
156+ End Get
157+ Set
158+ Me.srcField = Value
159+ End Set
160+ End Property
161+End Class
162+
163+'''<remarks/>
164+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
165+Partial Public Class ncxNavPointNavPoint
166+
167+ Private navLabelField As ncxNavPointNavPointNavLabel
168+
169+ Private contentField As ncxNavPointNavPointContent
170+
171+ Private navPointField() As ncxNavPointNavPointNavPoint
172+
173+ Private classField As String
174+
175+ Private idField As String
176+
177+ Private playOrderField As UShort
178+
179+ '''<remarks/>
180+ Public Property navLabel() As ncxNavPointNavPointNavLabel
181+ Get
182+ Return Me.navLabelField
183+ End Get
184+ Set
185+ Me.navLabelField = Value
186+ End Set
187+ End Property
188+
189+ '''<remarks/>
190+ Public Property content() As ncxNavPointNavPointContent
191+ Get
192+ Return Me.contentField
193+ End Get
194+ Set
195+ Me.contentField = Value
196+ End Set
197+ End Property
198+
199+ '''<remarks/>
200+ <System.Xml.Serialization.XmlElementAttribute("navPoint")>
201+ Public Property navPoint() As ncxNavPointNavPointNavPoint()
202+ Get
203+ Return Me.navPointField
204+ End Get
205+ Set
206+ Me.navPointField = Value
207+ End Set
208+ End Property
209+
210+ '''<remarks/>
211+ <System.Xml.Serialization.XmlAttributeAttribute()>
212+ Public Property [class]() As String
213+ Get
214+ Return Me.classField
215+ End Get
216+ Set
217+ Me.classField = Value
218+ End Set
219+ End Property
220+
221+ '''<remarks/>
222+ <System.Xml.Serialization.XmlAttributeAttribute()>
223+ Public Property id() As String
224+ Get
225+ Return Me.idField
226+ End Get
227+ Set
228+ Me.idField = Value
229+ End Set
230+ End Property
231+
232+ '''<remarks/>
233+ <System.Xml.Serialization.XmlAttributeAttribute()>
234+ Public Property playOrder() As UShort
235+ Get
236+ Return Me.playOrderField
237+ End Get
238+ Set
239+ Me.playOrderField = Value
240+ End Set
241+ End Property
242+End Class
243+
244+'''<remarks/>
245+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
246+Partial Public Class ncxNavPointNavPointNavLabel
247+
248+ Private textField As String
249+
250+ '''<remarks/>
251+ Public Property text() As String
252+ Get
253+ Return Me.textField
254+ End Get
255+ Set
256+ Me.textField = Value
257+ End Set
258+ End Property
259+End Class
260+
261+'''<remarks/>
262+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
263+Partial Public Class ncxNavPointNavPointContent
264+
265+ Private srcField As String
266+
267+ '''<remarks/>
268+ <System.Xml.Serialization.XmlAttributeAttribute()>
269+ Public Property src() As String
270+ Get
271+ Return Me.srcField
272+ End Get
273+ Set
274+ Me.srcField = Value
275+ End Set
276+ End Property
277+End Class
278+
279+'''<remarks/>
280+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
281+Partial Public Class ncxNavPointNavPointNavPoint
282+
283+ Private navLabelField As ncxNavPointNavPointNavPointNavLabel
284+
285+ Private contentField As ncxNavPointNavPointNavPointContent
286+
287+ Private classField As String
288+
289+ Private idField As String
290+
291+ Private playOrderField As UShort
292+
293+ '''<remarks/>
294+ Public Property navLabel() As ncxNavPointNavPointNavPointNavLabel
295+ Get
296+ Return Me.navLabelField
297+ End Get
298+ Set
299+ Me.navLabelField = Value
300+ End Set
301+ End Property
302+
303+ '''<remarks/>
304+ Public Property content() As ncxNavPointNavPointNavPointContent
305+ Get
306+ Return Me.contentField
307+ End Get
308+ Set
309+ Me.contentField = Value
310+ End Set
311+ End Property
312+
313+ '''<remarks/>
314+ <System.Xml.Serialization.XmlAttributeAttribute()>
315+ Public Property [class]() As String
316+ Get
317+ Return Me.classField
318+ End Get
319+ Set
320+ Me.classField = Value
321+ End Set
322+ End Property
323+
324+ '''<remarks/>
325+ <System.Xml.Serialization.XmlAttributeAttribute()>
326+ Public Property id() As String
327+ Get
328+ Return Me.idField
329+ End Get
330+ Set
331+ Me.idField = Value
332+ End Set
333+ End Property
334+
335+ '''<remarks/>
336+ <System.Xml.Serialization.XmlAttributeAttribute()>
337+ Public Property playOrder() As UShort
338+ Get
339+ Return Me.playOrderField
340+ End Get
341+ Set
342+ Me.playOrderField = Value
343+ End Set
344+ End Property
345+End Class
346+
347+'''<remarks/>
348+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
349+Partial Public Class ncxNavPointNavPointNavPointNavLabel
350+
351+ Private textField As String
352+
353+ '''<remarks/>
354+ Public Property text() As String
355+ Get
356+ Return Me.textField
357+ End Get
358+ Set
359+ Me.textField = Value
360+ End Set
361+ End Property
362+End Class
363+
364+'''<remarks/>
365+<System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=True, [Namespace]:="http://www.daisy.org/z3986/2005/ncx/")>
366+Partial Public Class ncxNavPointNavPointNavPointContent
367+
368+ Private srcField As String
369+
370+ '''<remarks/>
371+ <System.Xml.Serialization.XmlAttributeAttribute()>
372+ Public Property src() As String
373+ Get
374+ Return Me.srcField
375+ End Get
376+ Set
377+ Me.srcField = Value
378+ End Set
379+ End Property
380+End Class
381+
Show on old repository browser