デュアルディスプレイのセカンドモニターにPDF、動画、画像を表示。
@@ -42,5 +42,10 @@ | ||
42 | 42 | |
43 | 43 | End Sub |
44 | 44 | |
45 | + Public Sub ControlEnabled() | |
45 | 46 | |
47 | + Me.Enabled = Not (_fileViewParam Is Nothing) | |
48 | + | |
49 | + End Sub | |
50 | + | |
46 | 51 | End Class |
@@ -41,11 +41,16 @@ | ||
41 | 41 | End Sub |
42 | 42 | |
43 | 43 | |
44 | + Public Sub ControlEnabled() | |
44 | 45 | |
46 | + Me.Enabled = Not (_fileViewParam Is Nothing) | |
45 | 47 | |
48 | + End Sub | |
46 | 49 | |
47 | 50 | |
48 | 51 | |
49 | 52 | |
53 | + | |
54 | + | |
50 | 55 | #End Region |
51 | 56 | End Class |
@@ -26,8 +26,14 @@ | ||
26 | 26 | End Sub |
27 | 27 | #End Region |
28 | 28 | |
29 | + Public Sub ControlEnabled() | |
29 | 30 | |
31 | + Me.Enabled = Not (_fileViewParam Is Nothing) | |
30 | 32 | |
33 | + End Sub | |
34 | + | |
35 | + | |
36 | + | |
31 | 37 | Private _backFileName As String |
32 | 38 | Private _fileViewParam As FileViewParam |
33 | 39 | Public Sub SetFileInfo(f As FileViewParam) |
@@ -1,9 +1,26 @@ | ||
1 | 1 | Public Class frmOperation |
2 | 2 | |
3 | + ''' <summary> | |
4 | + ''' 開ける動画の拡張子 | |
5 | + ''' </summary> | |
6 | + Private movieExts = {"avi", "mpeg", "mp4", "wmv", "mov"} | |
7 | + | |
8 | + ''' <summary> | |
9 | + ''' 開ける画像の拡張子 | |
10 | + ''' </summary> | |
11 | + Private ImageExts = {"jpeg", "jpg", "bmp", "png", "gif", "tiff", "tif"} | |
12 | + | |
13 | + ''' <summary> | |
14 | + ''' PDFの拡張子 | |
15 | + ''' </summary> | |
16 | + Private PDFExts = {"pdf"} | |
17 | + | |
3 | 18 | #Region "初期処理" |
4 | 19 | |
5 | 20 | Private Sub ControlEnable() |
6 | - 'todo | |
21 | + CtlPdf1.ControlEnabled() | |
22 | + CtlMovie1.ControlEnabled() | |
23 | + CtlImage1.ControlEnabled() | |
7 | 24 | End Sub |
8 | 25 | Private Sub frmOperation_Load(sender As Object, e As EventArgs) Handles MyBase.Load |
9 | 26 | screenDetect() |
@@ -182,7 +199,7 @@ | ||
182 | 199 | End If |
183 | 200 | txtPDFFileName.Text = fileviewinfo.FileName |
184 | 201 | Dim ext = IO.Path.GetExtension(fileviewinfo.FileName) |
185 | - If IsContain(ext, {".pdf"}) Then | |
202 | + If IsPDFExt(ext) Then | |
186 | 203 | tbcFileOpes.SelectTab(tpAdobePDF.TabIndex) |
187 | 204 | CtlPdf1.SetFileInfo(fileviewinfo) |
188 | 205 |
@@ -196,6 +213,7 @@ | ||
196 | 213 | ControlEnable() |
197 | 214 | End Sub |
198 | 215 | |
216 | + | |
199 | 217 | Private Function IsContain(ext As String, exts As String()) As Boolean |
200 | 218 | For Each target In exts |
201 | 219 | If String.Compare($".{target}", ext, True) = 0 Then |
@@ -205,9 +223,11 @@ | ||
205 | 223 | Return False |
206 | 224 | End Function |
207 | 225 | |
208 | - Private movieExts = {"avi", "mpeg", "mp4", "wmv"} | |
209 | 226 | |
210 | - Private ImageExts = {"jpeg", "jpg", "bmp", "png", "gif", "tiff", "tif"} | |
227 | + Private Function IsPDFExt(ext) As Boolean | |
228 | + Return IsContain(ext, PDFExts) | |
229 | + End Function | |
230 | + | |
211 | 231 | Private Function IsImageExt(ext) As Boolean |
212 | 232 | Return IsContain(ext, ImageExts) |
213 | 233 | End Function |
@@ -261,6 +281,7 @@ | ||
261 | 281 | Private Sub btnUnSelect_Click(sender As Object, e As EventArgs) Handles btnUnSelect.Click |
262 | 282 | lstPDFFiles.SelectedItem = Nothing |
263 | 283 | _dispacher.CloseViewers() |
284 | + ControlEnable() | |
264 | 285 | End Sub |
265 | 286 | |
266 | 287 | Private Sub lstPDFFiles_DragEnter(sender As Object, e As DragEventArgs) Handles lstPDFFiles.DragEnter |