Skip to content

Commit 1b7bc3c

Browse files
committed
try to view as html
1 parent 200cc6c commit 1b7bc3c

6 files changed

Lines changed: 85 additions & 35 deletions

File tree

src/viewers/HDSViewer/DataViewer/FormHtmlViewer.Designer.vb

Lines changed: 31 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/viewers/HDSViewer/DataViewer/FormHtmlViewer.resx

Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -117,4 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="VS2015LightTheme1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>201, 17</value>
122+
</metadata>
120123
</root>
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
Public Class FormHtmlViewer
1+
Imports Galaxy.Workbench
22

3+
Public Class FormHtmlViewer
4+
5+
Private Async Sub FormHtmlViewer_Load(sender As Object, e As EventArgs) Handles Me.Load
6+
Await WebViewLoader.Init(WebView21)
7+
End Sub
8+
9+
Public Function ViewHtml(html As String) As FormHtmlViewer
10+
Call WebViewLoader.NavigateToLargeString(WebView21, html)
11+
Return Me
12+
End Function
313
End Class

src/viewers/HDSViewer/DataViewer/FormXMLViewer.Designer.vb

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/viewers/HDSViewer/DataViewer/FormXMLViewer.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="VS2015LightTheme1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121+
<value>201, 17</value>
122+
</metadata>
120123
</root>

src/viewers/HDSViewer/FormExplorer.vb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Public Class FormExplorer
1818
Call ApplyVsTheme(ToolStrip1, packTree.GetContextMenu)
1919
Call packTree.BringToFront()
2020
Call packTree.AddContextMenuItem("View As PlainText", "view_text")
21+
Call packTree.AddContextMenuItem("View As Html", "view_html")
2122
End Sub
2223

2324
Public Sub LoadTree()
@@ -74,6 +75,7 @@ Public Class FormExplorer
7475
Case "xml"
7576
Call CommonRuntime.ShowDocument(Of FormXMLViewer)(, file.fileName).RenderXml(pack.LoadStream(file))
7677
Case "html"
78+
Call CommonRuntime.ShowDocument(Of FormHtmlViewer)(, file.fileName).ViewHtml(pack.ReadText(file))
7779
Case "csv"
7880

7981
Case "rtf"
@@ -93,7 +95,8 @@ Public Class FormExplorer
9395
Dim pack As StreamPack = viewer.pack
9496

9597
Select Case sender.Name
96-
Case "view_text" : Call CommonRuntime.ShowDocument(Of FormTextViewer)(, file.fileName).ShowTextData(Pack.ReadText(file))
98+
Case "view_text" : Call CommonRuntime.ShowDocument(Of FormTextViewer)(, file.fileName).ShowTextData(pack.ReadText(file))
99+
Case "view_html" : Call CommonRuntime.ShowDocument(Of FormHtmlViewer)(, file.fileName).ViewHtml(pack.ReadText(file))
97100
End Select
98101
End Sub
99102

0 commit comments

Comments
 (0)