C# Класс OneNoteConversionTool.OutputGenerator.OneNoteGenerator

Handles the interaction with the OneNote document output, including creating notebook, section, page, adding content, and other things
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
GetNSManager ( XmlNameTable nameTable ) : XmlNamespaceManager

Returns the namespace manager from the passed xml name table.

Описание методов

AddImageToPage() публичный Метод

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
Результат void

AddPageContent() публичный Метод

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
Результат void

AddPageContentAsHtmlBlock() публичный Метод

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
Результат void

AppendImageToPage() публичный Метод

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
Результат void

AppendPageContent() публичный Метод

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
Результат void

AppendPageContentAsHtmlBlock() публичный Метод

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
Результат void

CreateNotebook() публичный Метод

Creates a new OneNote notebook with the given name
public CreateNotebook ( string notebookName ) : string
notebookName string
Результат string

CreatePage() публичный Метод

Creates a one note page under the given section ID
public CreatePage ( string pageName, string sectionId ) : string
pageName string
sectionId string
Результат string

CreateSection() публичный Метод

Creates one note section under the given notebook ID
public CreateSection ( string sectionName, string notebookId ) : string
sectionName string
notebookId string
Результат string

CreateTableOfContentPage() публичный Метод

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
Результат string

GetChildrenScopeHierarchy() публичный Метод

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
Результат string

GetHyperLinkToObject() публичный Метод

get the hyper link to the object
public GetHyperLinkToObject ( string objectId ) : string
objectId string
Результат string

GetNotebook() публичный Метод

Gets the ID of an existing notebook in the current directory
public GetNotebook ( string notebookName ) : string
notebookName string name of the notebook of interest
Результат string

GetPage() публичный Метод

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
Результат string

GetPageAttribute() публичный Метод

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
Результат string

GetPageContent() публичный Метод

GetPageContent return DOM representation of onenote's page
public GetPageContent ( string pageId ) : XmlDocument
pageId string
Результат System.Xml.XmlDocument

GetPageHeight() публичный Метод

Get the height of the page
public GetPageHeight ( string pageId ) : double
pageId string id of the page
Результат double

GetPageScopeHierarchy() публичный Метод

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
Результат string

GetPageWidth() публичный Метод

Get the height of the page
public GetPageWidth ( string pageId ) : double
pageId string id of the page
Результат double

GetSection() публичный Метод

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
Результат string

GetSectionScopeHierarchy() публичный Метод

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
Результат string

OneNoteGenerator() публичный Метод

Constructor
public OneNoteGenerator ( string mOutputDir ) : System
mOutputDir string
Результат System

RemoveAuthor() публичный Метод

Removes the author from any node in the page
public RemoveAuthor ( string pageId ) : void
pageId string
Результат void

SetAsFirstPage() публичный Метод

set a page as the first page in the section
public SetAsFirstPage ( string pageId, string sectionId ) : void
pageId string
sectionId string
Результат void

SetCollapsePage() публичный Метод

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
Результат void

SetPageAttribute() публичный Метод

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
Результат void

SetPageLevel() публичный Метод

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
Результат void

SetPageTitleAttribute() публичный Метод

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
Результат void

SetShowDate() публичный Метод

Sets whether the date should be shown or not in the page
public SetShowDate ( string pageId, bool isShown = true ) : void
pageId string
isShown bool
Результат void

SetShowTime() публичный Метод

Sets whether the time should be shown or not in the page
public SetShowTime ( string pageId, bool isShown = true ) : void
pageId string
isShown bool
Результат void

SetSubPage() публичный Метод

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
Результат void

UpdatePageContent() публичный Метод

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
Результат void