-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathViewDataFrame.vb
More file actions
55 lines (42 loc) · 1.84 KB
/
ViewDataFrame.vb
File metadata and controls
55 lines (42 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Imports System.Text
Imports Microsoft.VisualBasic.ComponentModel
Imports Microsoft.VisualBasic.Data.csv.IO
Imports Microsoft.VisualBasic.Net.Protocols.ContentTypes
Imports Microsoft.VisualBasic.Text
Imports WeifenLuo.WinFormsUI.Docking
Public Class ViewDataFrame : Implements Viewer
Public Property FilePath As String Implements IFileReference.FilePath
Public ReadOnly Property MimeType As ContentType() Implements IFileReference.MimeType
Get
Throw New NotImplementedException()
End Get
End Property
Public Function View(file As String) As DockContent Implements Viewer.View
Dim table As DataFrame = DataFrame.Load(file).MeasureTypeSchema
Dim col As DataGridViewTextBoxColumn
For Each name As String In table.HeadTitles
col = New DataGridViewTextBoxColumn With {
.HeaderText = name.Trim(""""c, " "c),
.[ReadOnly] = True
}
If table.GetFieldType(table.GetOrdinal(name)) Is GetType(Double) Then
col.DefaultCellStyle.Format = "G3"
End If
DataGridView1.Columns.Add(col)
Next
For Each row As Object() In table.EnumerateRowObjects
Call DataGridView1.Rows.Add(row)
Next
Text = file.FileName
Return Me
End Function
Public Function Save(path As String, encoding As Encoding) As Boolean Implements ISaveHandle.Save
Throw New NotImplementedException()
End Function
Public Function Save(path As String, Optional encoding As Encodings = Encodings.UTF8) As Boolean Implements ISaveHandle.Save
Throw New NotImplementedException()
End Function
Public Function Save(file As IO.Stream, encoding As Encoding) As Boolean Implements ISaveHandle.Save
Throw New NotImplementedException()
End Function
End Class