C# Class DocumentExplorerExample.MainForm

The main form of the DocumentExplorer demo. DocumentExplorer allows to open documents using Aspose.Words. Once a document is opened, you can explore its object model in the tree. You can also save the document into DOC, DOCX, ODF, EPUB, PDF, SWF, RTF, WordML, HTML, MHTML and plain text formats.
Inheritance: System.Windows.Forms.Form
Exibir arquivo Open project: aspose-words/Aspose.Words-for-.NET

Public Properties

Property Type Description
StatusBar System.Windows.Forms.StatusBar
Text1 System.Windows.Forms.TextBox
Tree System.Windows.Forms.TreeView

Public Methods

Method Description
MainForm ( ) : System

Ctor.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
CollapseAll ( ) : void

Collapses all nodes under currently selected node.

ExpandAll ( ) : void

Expands all nodes under currently selected node.

FindAndApplyLicense ( ) : void

Search for Aspose.Words license in the application directory. The File.Exists check is only needed in this demo so it will work Both when the license file is missing and when it is present. In your real application you just need to call SetLicense.

InitializeComponent ( ) : void
LicenseAsposeWords ( string licenseFile ) : void

This code activates Aspose.Words license. If you don't specify a license, Aspose.Words will work in evaluation mode.

OpenDocument ( ) : void

Shows the open file dialog box and opens a document.

PrintPreview ( ) : void
Remove ( ) : void

Removes currently selected node.

RenderDocument ( ) : void
Run ( ) : void
SaveDocument ( ) : void

Saves the document with the name and format provided in standard Save As dialog.

SelectOpenFileName ( ) : string

Selects file name for a document to open or null.

SelectSaveFileName ( ) : string

Selects file name for saving currently opened document or null.

Tree_AfterSelect ( object sender, TreeViewEventArgs e ) : void

Informs Item class, which provides GUI representation of a document node, That the corresponding TreeNode was selected.

Tree_BeforeExpand ( object sender, System.Windows.Forms.TreeViewCancelEventArgs e ) : void

Informs Item class, which provides GUI representation of a document node, That the corresponding TreeNode is about being expanded.

Tree_KeyDown ( object sender, KeyEventArgs e ) : void
Tree_MouseDown ( object sender, MouseEventArgs e ) : void

Ensures that tree nodes are selected by right-click also.

menuAbout_Click ( object sender, EventArgs e ) : void
menuCollapseAll_Click ( object sender, EventArgs e ) : void
menuExit_Click ( object sender, EventArgs e ) : void
menuExpandAll_Click ( object sender, EventArgs e ) : void
menuOpen_Click ( object sender, EventArgs e ) : void
menuPreview_Click ( object sender, System e ) : void
menuRemoveNode_Click ( object sender, EventArgs e ) : void
menuRender_Click ( object sender, System e ) : void
menuSaveAs_Click ( object sender, EventArgs e ) : void
toolBar1_ButtonClick ( object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e ) : void

Method Details

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

MainForm() public method

Ctor.
public MainForm ( ) : System
return System

Property Details

StatusBar public_oe property

public StatusBar,System.Windows.Forms StatusBar
return System.Windows.Forms.StatusBar

Text1 public_oe property

public TextBox,System.Windows.Forms Text1
return System.Windows.Forms.TextBox

Tree public_oe property

public TreeView,System.Windows.Forms Tree
return System.Windows.Forms.TreeView