JournalReader Class
Assembly: Microsoft.Ink (in microsoft.ink.dll)
The following Microsoft Visual Basic® .NET example of a handler for a Click event creates an instance of the JournalReader class and uses it to read an existing Journal file.
Note: |
|---|
| The DisplayXml method called from this example is not shown. The specific implementation of such a method is dependent on your application's needs. |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles Button1.Click Dim jntStream As Stream Dim xmlStream As Stream Dim jntReader As New Microsoft.Ink.JournalReader() Dim openFileDialog1 As New OpenFileDialog() ' Get the filename from the user by using a File Open dialog openFileDialog1.InitialDirectory = "C:\" openFileDialog1.Filter = _ "Journal files (*.jnt)|*.jnt|All files (*.*)|*.*" openFileDialog1.FilterIndex = 1 openFileDialog1.RestoreDirectory = True If openFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then Try jntStream = openFileDialog1.OpenFile() ' Read in the Journal file xmlStream = jntReader.ReadFromStream(jntStream) ' Show the results DisplayXml(xmlStream) Catch ex As Exception Debug.WriteLine(ex.Message) Finally ' Clean up xmlStream.Close() jntStream.Close() End Try End If End Sub
The following C# example of a handler for a Click event creates an instance of the JournalReader class and uses it to read an existing Journal file.
Note: |
|---|
| The DisplayXml method called from this example is not shown. The specific implementation of such a method is dependent on your application's needs. |
private void btnLoad_Click(object sender, System.EventArgs e) { Stream jntStream; Stream xmlStream; Microsoft.Ink.JournalReader jntReader = new Microsoft.Ink.JournalReader(); OpenFileDialog openFileDialog1 = new OpenFileDialog(); // Get the filename from the user by using a File Open dialog openFileDialog1.InitialDirectory = "c:\\"; openFileDialog1.Filter = "Journal files (*.jnt)|*.jnt|All files (*.*)|*.*"; openFileDialog1.FilterIndex = 1; openFileDialog1.RestoreDirectory = true; if (openFileDialog1.ShowDialog() == DialogResult.OK) { try { if ((jntStream = openFileDialog1.OpenFile()) != null) { // Read in the Journal file xmlStream = jntReader.ReadFromStream(jntStream); // Display results DisplayXml(xmlStream); } } catch (System.Exception ex) { Debug.WriteLine(ex.Message); } finally { // Clean up xmlStream.Close(); jntStream.Close(); } } }
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Reference
JournalReader MembersMicrosoft.Ink Namespace
ReadFromStream
Note: