C# Class OneNoteConversionTool.OutputGenerator.OneNoteGenerator

Handles the interaction with the OneNote document output, including creating notebook, section, page, adding content, and other things
Afficher le fichier Open project: OneNoteDev/OneNoteConversionTool Class Usage Examples

Méthodes publiques

Méthode Description
AddImageToPage ( string pageId, Image img, int yPos = 80 ) : void

Adds an image to the page The width of the page is at most MaxPageWidth (960 pixels) If the width is bigger, the image is proportionally minimized to MaxPageWidth

AddPageContent ( string pageId, string content, int yPos = 80, int width = 520 ) : void

Adds the content to the corresponding page.

AddPageContentAsHtmlBlock ( string pageId, string content, int yPos = 80, int width = 520 ) : void

Adds the content as a HTML block.

AppendImageToPage ( string pageId, Image img ) : void

Adds the image at the end of the corresponding page

AppendPageContent ( string pageId, string content, int width = 520 ) : void

Adds the content at the end of the corresponding page.

AppendPageContentAsHtmlBlock ( string pageId, string content, int width = 520 ) : void

Adds the content as HTML block at the end of the corresponding page

CreateNotebook ( string notebookName ) : string

Creates a new OneNote notebook with the given name

CreatePage ( string pageName, string sectionId ) : string

Creates a one note page under the given section ID

CreateSection ( string sectionName, string notebookId ) : string

Creates one note section under the given notebook ID

CreateTableOfContentPage ( string sectionId, string tocPageTitle = "Table of Contents" ) : string

Generates a Table of Content Page of all the pages underneath the given section Also sets the Table of Content Page to be the first page in the given section

GetChildrenScopeHierarchy ( string objectId ) : string

Returns the children scope hierarchy of the OneNote object in XML format Gets the immediate child nodes of the start node, and no descendants in higher or lower subsection groups.

GetHyperLinkToObject ( string objectId ) : string

get the hyper link to the object

GetNotebook ( string notebookName ) : string

Gets the ID of an existing notebook in the current directory

GetPage ( string pageName, string sectionId ) : string

Gets the ID o fan existing page in the given section If more than one exists, it returns the first one

GetPageAttribute ( string pageId, string attr ) : string

Gets the value of an attribute of the page

GetPageContent ( string pageId ) : XmlDocument

GetPageContent return DOM representation of onenote's page

GetPageHeight ( string pageId ) : double

Get the height of the page

GetPageScopeHierarchy ( string objectId ) : string

Returns the page scope hierarchy of the onenote object(page\section\notebook) in XML format Gets all pages below the start node, including all pages in section groups and subsection groups.

GetPageWidth ( string pageId ) : double

Get the height of the page

GetSection ( string sectionName, string notebookId ) : string

Gets the ID of an existing section in the given notebook If more than one exists, it returns the first one

GetSectionScopeHierarchy ( string objectId ) : string

Returns the section scope hierarchy of the onenote object(section\notebook) in XML format Gets all sections below the start node, including sections in section groups and subsection groups.

OneNoteGenerator ( string mOutputDir ) : System

Constructor

RemoveAuthor ( string pageId ) : void

Removes the author from any node in the page

SetAsFirstPage ( string pageId, string sectionId ) : void

set a page as the first page in the section

SetCollapsePage ( string pageId, bool isCollapsed = true ) : void

Sets the collapse attribute of the page to hide or unhide the subpages under the given page

SetPageAttribute ( string pageId, string attr, string value ) : void

Sets the page attribute to the given value

SetPageLevel ( string pageId, int pageLevel ) : void

Sets the page level of a given page (note, page level must be {1, 2, or 3})

SetPageTitleAttribute ( string pageId, string attr, string value ) : void

Sets the page title attribute to the given value

SetShowDate ( string pageId, bool isShown = true ) : void

Sets whether the date should be shown or not in the page

SetShowTime ( string pageId, bool isShown = true ) : void

Sets whether the time should be shown or not in the page

SetSubPage ( string sectionId, string pageId, bool isSet = true ) : void

Make the page as subpage (if isSet true) or promote it (if isSet if false)

UpdatePageContent ( string pageId, string content ) : void

UpdatePageContent this method is invoked when a previous page word section needs to be updated

Private Methods

Méthode Description
GetNSManager ( XmlNameTable nameTable ) : XmlNamespaceManager

Returns the namespace manager from the passed xml name table.

Method Details

AddImageToPage() public méthode

Adds an image to the page The width of the page is at most MaxPageWidth (960 pixels) If the width is bigger, the image is proportionally minimized to MaxPageWidth
public AddImageToPage ( string pageId, Image img, int yPos = 80 ) : void
pageId string
img Image
yPos int
Résultat void

AddPageContent() public méthode

Adds the content to the corresponding page.
public AddPageContent ( string pageId, string content, int yPos = 80, int width = 520 ) : void
pageId string Page Identifier in which the content to be displayed.
content string The content which needs to be added to the page.
yPos int Starting vertical position of the block in the page in Pixels from the top of the page
width int Maximum width of the outline block where the content is added
Résultat void

AddPageContentAsHtmlBlock() public méthode

Adds the content as a HTML block.
public AddPageContentAsHtmlBlock ( string pageId, string content, int yPos = 80, int width = 520 ) : void
pageId string Id of the page
content string content to be added
yPos int Starting position of the block
width int Width of the block
Résultat void

AppendImageToPage() public méthode

Adds the image at the end of the corresponding page
public AppendImageToPage ( string pageId, Image img ) : void
pageId string ID of the page
img Image The Image to be added
Résultat void

AppendPageContent() public méthode

Adds the content at the end of the corresponding page.
public AppendPageContent ( string pageId, string content, int width = 520 ) : void
pageId string Id of the page
content string content to be added
width int Width of the block
Résultat void

AppendPageContentAsHtmlBlock() public méthode

Adds the content as HTML block at the end of the corresponding page
public AppendPageContentAsHtmlBlock ( string pageId, string content, int width = 520 ) : void
pageId string ID of the page
content string HTML block to be added
width int Width of the block
Résultat void

CreateNotebook() public méthode

Creates a new OneNote notebook with the given name
public CreateNotebook ( string notebookName ) : string
notebookName string
Résultat string

CreatePage() public méthode

Creates a one note page under the given section ID
public CreatePage ( string pageName, string sectionId ) : string
pageName string
sectionId string
Résultat string

CreateSection() public méthode

Creates one note section under the given notebook ID
public CreateSection ( string sectionName, string notebookId ) : string
sectionName string
notebookId string
Résultat string

CreateTableOfContentPage() public méthode

Generates a Table of Content Page of all the pages underneath the given section Also sets the Table of Content Page to be the first page in the given section
public CreateTableOfContentPage ( string sectionId, string tocPageTitle = "Table of Contents" ) : string
sectionId string
tocPageTitle string
Résultat string

GetChildrenScopeHierarchy() public méthode

Returns the children scope hierarchy of the OneNote object in XML format Gets the immediate child nodes of the start node, and no descendants in higher or lower subsection groups.
public GetChildrenScopeHierarchy ( string objectId ) : string
objectId string
Résultat string

GetHyperLinkToObject() public méthode

get the hyper link to the object
public GetHyperLinkToObject ( string objectId ) : string
objectId string
Résultat string

GetNotebook() public méthode

Gets the ID of an existing notebook in the current directory
public GetNotebook ( string notebookName ) : string
notebookName string name of the notebook of interest
Résultat string

GetPage() public méthode

Gets the ID o fan existing page in the given section If more than one exists, it returns the first one
public GetPage ( string pageName, string sectionId ) : string
pageName string page name
sectionId string ID of the section where the page exists
Résultat string

GetPageAttribute() public méthode

Gets the value of an attribute of the page
public GetPageAttribute ( string pageId, string attr ) : string
pageId string ID of the page
attr string the attribute of interest
Résultat string

GetPageContent() public méthode

GetPageContent return DOM representation of onenote's page
public GetPageContent ( string pageId ) : XmlDocument
pageId string
Résultat System.Xml.XmlDocument

GetPageHeight() public méthode

Get the height of the page
public GetPageHeight ( string pageId ) : double
pageId string id of the page
Résultat double

GetPageScopeHierarchy() public méthode

Returns the page scope hierarchy of the onenote object(page\section\notebook) in XML format Gets all pages below the start node, including all pages in section groups and subsection groups.
public GetPageScopeHierarchy ( string objectId ) : string
objectId string
Résultat string

GetPageWidth() public méthode

Get the height of the page
public GetPageWidth ( string pageId ) : double
pageId string id of the page
Résultat double

GetSection() public méthode

Gets the ID of an existing section in the given notebook If more than one exists, it returns the first one
public GetSection ( string sectionName, string notebookId ) : string
sectionName string section name
notebookId string ID of the notebook where the section exists
Résultat string

GetSectionScopeHierarchy() public méthode

Returns the section scope hierarchy of the onenote object(section\notebook) in XML format Gets all sections below the start node, including sections in section groups and subsection groups.
public GetSectionScopeHierarchy ( string objectId ) : string
objectId string
Résultat string

OneNoteGenerator() public méthode

Constructor
public OneNoteGenerator ( string mOutputDir ) : System
mOutputDir string
Résultat System

RemoveAuthor() public méthode

Removes the author from any node in the page
public RemoveAuthor ( string pageId ) : void
pageId string
Résultat void

SetAsFirstPage() public méthode

set a page as the first page in the section
public SetAsFirstPage ( string pageId, string sectionId ) : void
pageId string
sectionId string
Résultat void

SetCollapsePage() public méthode

Sets the collapse attribute of the page to hide or unhide the subpages under the given page
public SetCollapsePage ( string pageId, bool isCollapsed = true ) : void
pageId string ID of the page
isCollapsed bool isCollapsed attribute value
Résultat void

SetPageAttribute() public méthode

Sets the page attribute to the given value
public SetPageAttribute ( string pageId, string attr, string value ) : void
pageId string ID of the page
attr string The attribute of interest
value string The new value of the attribute
Résultat void

SetPageLevel() public méthode

Sets the page level of a given page (note, page level must be {1, 2, or 3})
public SetPageLevel ( string pageId, int pageLevel ) : void
pageId string
pageLevel int
Résultat void

SetPageTitleAttribute() public méthode

Sets the page title attribute to the given value
public SetPageTitleAttribute ( string pageId, string attr, string value ) : void
pageId string ID of the page
attr string The attribute of interest for one:Title node
value string The new value of the attribute
Résultat void

SetShowDate() public méthode

Sets whether the date should be shown or not in the page
public SetShowDate ( string pageId, bool isShown = true ) : void
pageId string
isShown bool
Résultat void

SetShowTime() public méthode

Sets whether the time should be shown or not in the page
public SetShowTime ( string pageId, bool isShown = true ) : void
pageId string
isShown bool
Résultat void

SetSubPage() public méthode

Make the page as subpage (if isSet true) or promote it (if isSet if false)
public SetSubPage ( string sectionId, string pageId, bool isSet = true ) : void
sectionId string
pageId string
isSet bool defaults to true, if true, increment pageLevel, else decrement pageLevel
Résultat void

UpdatePageContent() public méthode

UpdatePageContent this method is invoked when a previous page word section needs to be updated
public UpdatePageContent ( string pageId, string content ) : void
pageId string
content string
Résultat void