• R/O
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++linuxc#objective-ccocoa誰得qtrubybathyscaphegamephpguicwindows翻訳pythonomegattwitterframeworkbtronarduinovb.net計画中(planning stage)directxpreviewertestゲームエンジンdom

圧縮フォルダを解凍する。画像が複数含まれるので分割する。フォルダごとにpdfに変換


コミットメタ情報

リビジョン7 (tree)
日時2017-09-15 18:01:10
作者bellyoshi

ログメッセージ

変更サマリ

差分

--- WindowsApp1/WindowsApp1/Form1.Designer.vb (revision 6)
+++ WindowsApp1/WindowsApp1/Form1.Designer.vb (revision 7)
@@ -25,12 +25,13 @@
2525 Me.btnExecute = New System.Windows.Forms.Button()
2626 Me.TextBox1 = New System.Windows.Forms.TextBox()
2727 Me.lstLog = New System.Windows.Forms.ListBox()
28+ Me.Button1 = New System.Windows.Forms.Button()
2829 Me.SuspendLayout()
2930 '
3031 'btnExecute
3132 '
3233 Me.btnExecute.Location = New System.Drawing.Point(55, 101)
33- Me.btnExecute.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
34+ Me.btnExecute.Margin = New System.Windows.Forms.Padding(4)
3435 Me.btnExecute.Name = "btnExecute"
3536 Me.btnExecute.Size = New System.Drawing.Size(100, 29)
3637 Me.btnExecute.TabIndex = 0
@@ -40,7 +41,7 @@
4041 'TextBox1
4142 '
4243 Me.TextBox1.Location = New System.Drawing.Point(55, 50)
43- Me.TextBox1.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
44+ Me.TextBox1.Margin = New System.Windows.Forms.Padding(4)
4445 Me.TextBox1.Name = "TextBox1"
4546 Me.TextBox1.Size = New System.Drawing.Size(643, 22)
4647 Me.TextBox1.TabIndex = 1
@@ -51,21 +52,31 @@
5152 Me.lstLog.FormattingEnabled = True
5253 Me.lstLog.ItemHeight = 15
5354 Me.lstLog.Location = New System.Drawing.Point(25, 156)
54- Me.lstLog.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
55+ Me.lstLog.Margin = New System.Windows.Forms.Padding(4)
5556 Me.lstLog.Name = "lstLog"
5657 Me.lstLog.ScrollAlwaysVisible = True
5758 Me.lstLog.Size = New System.Drawing.Size(696, 349)
5859 Me.lstLog.TabIndex = 2
5960 '
61+ 'Button1
62+ '
63+ Me.Button1.Location = New System.Drawing.Point(257, 101)
64+ Me.Button1.Name = "Button1"
65+ Me.Button1.Size = New System.Drawing.Size(75, 23)
66+ Me.Button1.TabIndex = 3
67+ Me.Button1.Text = "Button1"
68+ Me.Button1.UseVisualStyleBackColor = True
69+ '
6070 'Form1
6171 '
6272 Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
6373 Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
6474 Me.ClientSize = New System.Drawing.Size(800, 567)
75+ Me.Controls.Add(Me.Button1)
6576 Me.Controls.Add(Me.lstLog)
6677 Me.Controls.Add(Me.TextBox1)
6778 Me.Controls.Add(Me.btnExecute)
68- Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4)
79+ Me.Margin = New System.Windows.Forms.Padding(4)
6980 Me.Name = "Form1"
7081 Me.Text = "Form1"
7182 Me.ResumeLayout(False)
@@ -76,4 +87,5 @@
7687 Friend WithEvents btnExecute As Button
7788 Friend WithEvents TextBox1 As TextBox
7889 Friend WithEvents lstLog As ListBox
90+ Friend WithEvents Button1 As Button
7991 End Class
--- WindowsApp1/WindowsApp1/Form1.vb (revision 6)
+++ WindowsApp1/WindowsApp1/Form1.vb (revision 7)
@@ -59,13 +59,12 @@
5959 Dim files As String() = System.IO.Directory.GetFiles(srcFiles.Path, "*.jpg", System.IO.SearchOption.AllDirectories)
6060 For Each filepath As String In files
6161 Dim filename = System.IO.Path.GetFileName(filepath)
62- '先頭ファイルはそのままとする。001.jpg
63- If filename.Contains("001") Then
64- Dim image As New Bitmap(filepath)
62+ Dim image As New Bitmap(filepath)
63+ If image.Width < 700 Then
64+ '小さいサイズなので一ページ分
6565 SaveTo(image, tempFiles.Path)
66- '左側画像を保存する。
6766 Else
68- Dim image As New Bitmap(filepath)
67+ '2ページ分なので分割
6968 width = image.Width / 2
7069 height = image.Height
7170 Dim desRect As New Drawing.Rectangle(0, 0, width, height)
@@ -105,5 +104,7 @@
105104
106105 End Sub
107106
107+ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
108108
109+ End Sub
109110 End Class
--- WindowsApp2/WindowsApp1/AppTempDir.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/AppTempDir.vb (revision 7)
@@ -0,0 +1,34 @@
1+Imports System.IO
2+
3+
4+Public Class AppTempDir
5+ Implements IDisposable
6+
7+ Public ReadOnly Property Path As String
8+
9+ Private log As Logger
10+
11+ Sub New(path As String, logger As Logger)
12+ Me.log = logger
13+ Me.Path = path
14+ Dim unzipSrcFilesPath = path
15+ IfExistDirDelete(unzipSrcFilesPath)
16+ Directory.CreateDirectory(unzipSrcFilesPath)
17+ End Sub
18+
19+ Private Sub IDisposable_Dispose() Implements IDisposable.Dispose
20+ 'todo:後片付け IfExistDirDelete(Path)
21+ End Sub
22+
23+ ''' <summary>
24+ ''' もしディレクトリがあれば削除
25+ ''' </summary>
26+ ''' <param name="path"></param>
27+ Private Sub IfExistDirDelete(path As String)
28+ 'tempフォルダを削除する。
29+ If Directory.Exists(path) Then
30+ Directory.Delete(path, True)
31+ log.Info(path + "を削除")
32+ End If
33+ End Sub
34+End Class
--- WindowsApp2/WindowsApp1/Form1.Designer.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/Form1.Designer.vb (revision 7)
@@ -0,0 +1,91 @@
1+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
2+Partial Class Form1
3+ Inherits System.Windows.Forms.Form
4+
5+ 'フォームがコンポーネントの一覧をクリーンアップするために dispose をオーバーライドします。
6+ <System.Diagnostics.DebuggerNonUserCode()> _
7+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
8+ Try
9+ If disposing AndAlso components IsNot Nothing Then
10+ components.Dispose()
11+ End If
12+ Finally
13+ MyBase.Dispose(disposing)
14+ End Try
15+ End Sub
16+
17+ 'Windows フォーム デザイナーで必要です。
18+ Private components As System.ComponentModel.IContainer
19+
20+ 'メモ: 以下のプロシージャは Windows フォーム デザイナーで必要です。
21+ 'Windows フォーム デザイナーを使用して変更できます。
22+ 'コード エディターを使って変更しないでください。
23+ <System.Diagnostics.DebuggerStepThrough()> _
24+ Private Sub InitializeComponent()
25+ Me.btnExecute = New System.Windows.Forms.Button()
26+ Me.TextBox1 = New System.Windows.Forms.TextBox()
27+ Me.lstLog = New System.Windows.Forms.ListBox()
28+ Me.Button1 = New System.Windows.Forms.Button()
29+ Me.SuspendLayout()
30+ '
31+ 'btnExecute
32+ '
33+ Me.btnExecute.Location = New System.Drawing.Point(55, 101)
34+ Me.btnExecute.Margin = New System.Windows.Forms.Padding(4)
35+ Me.btnExecute.Name = "btnExecute"
36+ Me.btnExecute.Size = New System.Drawing.Size(100, 29)
37+ Me.btnExecute.TabIndex = 0
38+ Me.btnExecute.Text = "実行"
39+ Me.btnExecute.UseVisualStyleBackColor = True
40+ '
41+ 'TextBox1
42+ '
43+ Me.TextBox1.Location = New System.Drawing.Point(55, 50)
44+ Me.TextBox1.Margin = New System.Windows.Forms.Padding(4)
45+ Me.TextBox1.Name = "TextBox1"
46+ Me.TextBox1.Size = New System.Drawing.Size(643, 22)
47+ Me.TextBox1.TabIndex = 1
48+ Me.TextBox1.Text = "C:\Users\bellm\Downloads\E-HentaiGalleries\comp"
49+ '
50+ 'lstLog
51+ '
52+ Me.lstLog.FormattingEnabled = True
53+ Me.lstLog.ItemHeight = 15
54+ Me.lstLog.Location = New System.Drawing.Point(25, 156)
55+ Me.lstLog.Margin = New System.Windows.Forms.Padding(4)
56+ Me.lstLog.Name = "lstLog"
57+ Me.lstLog.ScrollAlwaysVisible = True
58+ Me.lstLog.Size = New System.Drawing.Size(696, 349)
59+ Me.lstLog.TabIndex = 2
60+ '
61+ 'Button1
62+ '
63+ Me.Button1.Location = New System.Drawing.Point(257, 101)
64+ Me.Button1.Name = "Button1"
65+ Me.Button1.Size = New System.Drawing.Size(75, 23)
66+ Me.Button1.TabIndex = 3
67+ Me.Button1.Text = "Button1"
68+ Me.Button1.UseVisualStyleBackColor = True
69+ '
70+ 'Form1
71+ '
72+ Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 15.0!)
73+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
74+ Me.ClientSize = New System.Drawing.Size(800, 567)
75+ Me.Controls.Add(Me.Button1)
76+ Me.Controls.Add(Me.lstLog)
77+ Me.Controls.Add(Me.TextBox1)
78+ Me.Controls.Add(Me.btnExecute)
79+ Me.Margin = New System.Windows.Forms.Padding(4)
80+ Me.Name = "Form1"
81+ Me.Text = "Form1"
82+ Me.ResumeLayout(False)
83+ Me.PerformLayout()
84+
85+ End Sub
86+
87+ Friend WithEvents btnExecute As Button
88+ Friend WithEvents TextBox1 As TextBox
89+ Friend WithEvents lstLog As ListBox
90+ Friend WithEvents Button1 As Button
91+End Class
--- WindowsApp2/WindowsApp1/Form1.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/Form1.vb (revision 7)
@@ -0,0 +1,98 @@
1+Imports System.IO, com
2+Imports iTextSharp.text.pdf
3+Imports iTextSharp.text
4+Imports WindowsApp1
5+
6+
7+Public Class Form1
8+
9+ Private Class Form1Logger
10+ Inherits LoggerTemplate
11+ Private form As Form1
12+ Public Sub New(form As Form1)
13+ Me.form = form
14+ End Sub
15+ Public Overrides Sub output(message As String)
16+ form.lstLog.Items.Add(message)
17+ End Sub
18+ End Class
19+ Private log As Logger = New Form1Logger(Me)
20+
21+
22+ Private Sub btnExecute_Click(sender As Object, e As EventArgs) Handles btnExecute.Click
23+ log.Info("処理開始")
24+ Dim allPath = TextBox1.Text '全冊フォルダ
25+ '全冊フォルダのzipファイルを列挙するし以下を繰り返す。
26+ Dim files As String() = System.IO.Directory.GetDirectories(allPath)
27+ For Each path In files
28+ log.Info(path)
29+ topdf(path)
30+ Next
31+
32+ log.Info("処理終了")
33+ End Sub
34+
35+
36+
37+
38+ Private Sub topdf(path As String)
39+
40+ Dim dirInfo = New System.IO.DirectoryInfo(path)
41+
42+ '2番目以降のファイルを読み込む。
43+ '2つに分割し右側をfilename_count.jpeg,左側をfilename_count+1.jpegとして保存する
44+ 'tempフォルダをpdf化する
45+ 'A4サイズを横向きで
46+ Dim psize As New iTextSharp.text.Rectangle(831, 1200)
47+ Dim pdfDocument = New Document(psize, 0, 0, 0, 0)
48+ '出力先のファイル名
49+ Dim makePdfFilePath = $"{dirInfo.Name}.pdf"
50+ Dim fileStream = New FileStream(makePdfFilePath, FileMode.Create)
51+ Dim writer = PdfWriter.GetInstance(pdfDocument, fileStream)
52+ 'PDFドキュメントを開く
53+ pdfDocument.Open()
54+ Dim files = System.IO.Directory.GetFiles(path, "*.jpg", System.IO.SearchOption.AllDirectories)
55+ For Each filepath As String In files
56+ Dim img = iTextSharp.text.Image.GetInstance(New Uri(filepath))
57+ If 832 < img.Width Then
58+ img.RotationDegrees = 90
59+ End If
60+ pdfDocument.Add(img)
61+ Next
62+ 'PDFドキュメントを閉じる
63+ pdfDocument.Close()
64+
65+ End Sub
66+
67+ Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
68+ Dim dirs As String() = System.IO.Directory.GetDirectories("C:\Users\bellm\Downloads\test")
69+ Dim psize As New iTextSharp.text.Rectangle(768, 1024)
70+ '出力先のファイル名
71+ Dim makePdfFilePath = $"HH.pdf"
72+ Dim fileStream = New FileStream(makePdfFilePath, FileMode.Create)
73+ Dim pdfDocument = New Document(psize, 0, 0, 0, 0)
74+ Dim writer = PdfWriter.GetInstance(pdfDocument, fileStream)
75+ 'PDFドキュメントを開く
76+ pdfDocument.Open()
77+
78+ For Each path In dirs
79+
80+
81+ Dim dirInfo = New System.IO.DirectoryInfo(path)
82+
83+
84+
85+ Dim files = System.IO.Directory.GetFiles(path, "*.jpg", System.IO.SearchOption.AllDirectories)
86+ For Each filepath As String In files
87+ Dim img = iTextSharp.text.Image.GetInstance(New Uri(filepath))
88+ If 768 < img.Width Then
89+ img.RotationDegrees = 90
90+ End If
91+ pdfDocument.Add(img)
92+ Next
93+
94+ Next
95+ 'PDFドキュメントを閉じる
96+ pdfDocument.Close()
97+ End Sub
98+End Class
--- WindowsApp2/WindowsApp1/Logger.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/Logger.vb (revision 7)
@@ -0,0 +1,4 @@
1+Public Interface Logger
2+ Sub ErrorLog(ByVal message As String)
3+ Sub Info(ByVal message As String)
4+End Interface
--- WindowsApp2/WindowsApp1/LoggerTemplate.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/LoggerTemplate.vb (revision 7)
@@ -0,0 +1,19 @@
1+Imports WindowsApp1
2+
3+Public MustInherit Class LoggerTemplate
4+ Implements Logger
5+
6+ Public Sub ErrorLog(message As String) Implements Logger.ErrorLog
7+ output("ERROR", message)
8+ End Sub
9+
10+ Public Sub Info(message As String) Implements Logger.Info
11+ output("INFO", message)
12+ End Sub
13+
14+ Public Sub output(level As String, message As String)
15+ output($"{level}:{message}")
16+ End Sub
17+
18+ Public MustOverride Sub output(message As String)
19+End Class
--- WindowsApp2/WindowsApp1/My Project/Application.Designer.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/My Project/Application.Designer.vb (revision 7)
@@ -0,0 +1,38 @@
1+'------------------------------------------------------------------------------
2+' <auto-generated>
3+' This code was generated by a tool.
4+' Runtime Version:4.0.30319.42000
5+'
6+' Changes to this file may cause incorrect behavior and will be lost if
7+' the code is regenerated.
8+' </auto-generated>
9+'------------------------------------------------------------------------------
10+
11+Option Strict On
12+Option Explicit On
13+
14+
15+Namespace My
16+
17+ 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
18+ ' or if you encounter build errors in this file, go to the Project Designer
19+ ' (go to Project Properties or double-click the My Project node in
20+ ' Solution Explorer), and make changes on the Application tab.
21+ '
22+ Partial Friend Class MyApplication
23+
24+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
25+ Public Sub New()
26+ MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
27+ Me.IsSingleInstance = false
28+ Me.EnableVisualStyles = true
29+ Me.SaveMySettingsOnExit = true
30+ Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
31+ End Sub
32+
33+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
34+ Protected Overrides Sub OnCreateMainForm()
35+ Me.MainForm = Global.WindowsApp1.Form1
36+ End Sub
37+ End Class
38+End Namespace
--- WindowsApp2/WindowsApp1/My Project/AssemblyInfo.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/My Project/AssemblyInfo.vb (revision 7)
@@ -0,0 +1,35 @@
1+Imports System
2+Imports System.Reflection
3+Imports System.Runtime.InteropServices
4+
5+' アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
6+' アセンブリに関連付けられている情報を変更するには、
7+' これらの属性値を変更してください。
8+
9+' アセンブリ属性の値を確認します
10+
11+<Assembly: AssemblyTitle("WindowsApp1")>
12+<Assembly: AssemblyDescription("")>
13+<Assembly: AssemblyCompany("")>
14+<Assembly: AssemblyProduct("WindowsApp1")>
15+<Assembly: AssemblyCopyright("Copyright © 2017")>
16+<Assembly: AssemblyTrademark("")>
17+
18+<Assembly: ComVisible(False)>
19+
20+'このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
21+<Assembly: Guid("258d3519-f0bb-470b-93e7-fc879c252e4e")>
22+
23+' アセンブリのバージョン情報は次の 4 つの値で構成されています:
24+'
25+' メジャー バージョン
26+' マイナー バージョン
27+' ビルド番号
28+' Revision
29+'
30+' すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
31+' 既定値にすることができます:
32+' <Assembly: AssemblyVersion("1.0.*")>
33+
34+<Assembly: AssemblyVersion("1.0.0.0")>
35+<Assembly: AssemblyFileVersion("1.0.0.0")>
--- WindowsApp2/WindowsApp1/My Project/Resources.Designer.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/My Project/Resources.Designer.vb (revision 7)
@@ -0,0 +1,62 @@
1+'------------------------------------------------------------------------------
2+' <auto-generated>
3+' This code was generated by a tool.
4+' Runtime Version:4.0.30319.42000
5+'
6+' Changes to this file may cause incorrect behavior and will be lost if
7+' the code is regenerated.
8+' </auto-generated>
9+'------------------------------------------------------------------------------
10+
11+Option Strict On
12+Option Explicit On
13+
14+
15+Namespace My.Resources
16+
17+ 'This class was auto-generated by the StronglyTypedResourceBuilder
18+ 'class via a tool like ResGen or Visual Studio.
19+ 'To add or remove a member, edit your .ResX file then rerun ResGen
20+ 'with the /str option, or rebuild your VS project.
21+ '''<summary>
22+ ''' A strongly-typed resource class, for looking up localized strings, etc.
23+ '''</summary>
24+ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
25+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
26+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
27+ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
28+ Friend Module Resources
29+
30+ Private resourceMan As Global.System.Resources.ResourceManager
31+
32+ Private resourceCulture As Global.System.Globalization.CultureInfo
33+
34+ '''<summary>
35+ ''' Returns the cached ResourceManager instance used by this class.
36+ '''</summary>
37+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
38+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
39+ Get
40+ If Object.ReferenceEquals(resourceMan, Nothing) Then
41+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApp1.Resources", GetType(Resources).Assembly)
42+ resourceMan = temp
43+ End If
44+ Return resourceMan
45+ End Get
46+ End Property
47+
48+ '''<summary>
49+ ''' Overrides the current thread's CurrentUICulture property for all
50+ ''' resource lookups using this strongly typed resource class.
51+ '''</summary>
52+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
53+ Friend Property Culture() As Global.System.Globalization.CultureInfo
54+ Get
55+ Return resourceCulture
56+ End Get
57+ Set(ByVal value As Global.System.Globalization.CultureInfo)
58+ resourceCulture = value
59+ End Set
60+ End Property
61+ End Module
62+End Namespace
--- WindowsApp2/WindowsApp1/My Project/Settings.Designer.vb (nonexistent)
+++ WindowsApp2/WindowsApp1/My Project/Settings.Designer.vb (revision 7)
@@ -0,0 +1,73 @@
1+'------------------------------------------------------------------------------
2+' <auto-generated>
3+' This code was generated by a tool.
4+' Runtime Version:4.0.30319.42000
5+'
6+' Changes to this file may cause incorrect behavior and will be lost if
7+' the code is regenerated.
8+' </auto-generated>
9+'------------------------------------------------------------------------------
10+
11+Option Strict On
12+Option Explicit On
13+
14+
15+Namespace My
16+
17+ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
18+ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0"), _
19+ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
20+ Partial Friend NotInheritable Class MySettings
21+ Inherits Global.System.Configuration.ApplicationSettingsBase
22+
23+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
24+
25+#Region "My.Settings Auto-Save Functionality"
26+#If _MyType = "WindowsForms" Then
27+ Private Shared addedHandler As Boolean
28+
29+ Private Shared addedHandlerLockObject As New Object
30+
31+ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
32+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
33+ If My.Application.SaveMySettingsOnExit Then
34+ My.Settings.Save()
35+ End If
36+ End Sub
37+#End If
38+#End Region
39+
40+ Public Shared ReadOnly Property [Default]() As MySettings
41+ Get
42+
43+#If _MyType = "WindowsForms" Then
44+ If Not addedHandler Then
45+ SyncLock addedHandlerLockObject
46+ If Not addedHandler Then
47+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
48+ addedHandler = True
49+ End If
50+ End SyncLock
51+ End If
52+#End If
53+ Return defaultInstance
54+ End Get
55+ End Property
56+ End Class
57+End Namespace
58+
59+Namespace My
60+
61+ <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
62+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
63+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
64+ Friend Module MySettingsProperty
65+
66+ <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
67+ Friend ReadOnly Property Settings() As Global.WindowsApp1.My.MySettings
68+ Get
69+ Return Global.WindowsApp1.My.MySettings.Default
70+ End Get
71+ End Property
72+ End Module
73+End Namespace