C# Класс XWord.AddinActions

Provides implementations for the common addin actions. This class should contain most VSTO specific code.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AddNewPage ( String space, String pageName ) : void

Starts editing a new wiki page. The page will not be created in the wiki until the fisrt save.

AddNewPage ( String spaceName, String pageName, String pageTitle, Form sender ) : void

Starts editing a new wiki page. The page will not be created in the wiki until the fisrt save.

AddinActions ( XWikiAddIn addin ) : System

Creates an instance for this class.

AttachCurrentFile ( String pageFullName ) : bool

Saves the document and attaches it to a wiki page

AttachCurrentFile ( String space, String page ) : bool

Saves the document and attaches it to a wiki page

CheckForErrors ( string content ) : bool

Searches the server response for error strings.

ConvertToNormalFolder ( string folder ) : void

Converts the folder to a "Normal" type folder.

DownloadAttachment ( String pageFullName, String attachmentName, String path ) : FileInfo

Downloads the file to a local folder. The folder is located in MyDocuments

EditPage ( String pageFullName ) : void

Edits a wiki page. The LoadingDialog is shown during the operation. EditPage

GetActivePageName ( ) : String

Gets the fullname of the wiki page edited in the active document.

HideProtectedPages ( Wiki wiki, List wildcards ) : void

Removes all protected pages from the Word wiki structure.

IsOpened ( String pageFullName ) : bool

Specifies if a wiki page is opened for editing.

IsProtectedPage ( String pageFullName, List wildCards ) : bool

Specifies if a page is protected or not.

RefreshActiveDocument ( ) : void

Reloads the active document, if it's a wiki page.

SaveFileDialog ( String fileName ) : String

Displays a SaveFileDialog

SaveToServer ( ) : void

Saves the currently edited page or document to the server. Displays the operation in progress dialog.

ShadowCopyDocument ( Microsoft.Office.Interop.Word document, string path, Microsoft.Office.Interop.Word saveFormat ) : bool

Copies a document to a specified path.

The document is saved in Unicode little endian encoding.

StartProcess ( String fullFileName ) : void

Starts a new process. - If the file is executable then it will execute that file. - If the file file is resistered to be opened with another application then it will be opened with that application - If the file doesnt have an assigned application then Windows Explorer openes it's directory.

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

Метод Описание
Application_MailMergeAfterMerge ( Microsoft Doc, Microsoft DocResult ) : void
CheckPageHistory ( String pageFullName, bool &wasModified, String &lastAuthor ) : XWiki.XmlRpc.PageHistorySummary[]

Updates the history of a page, the last author and specifies if the page was modified.

DisableGrammarAndSpellingChecking ( ) : void

Disable grammar and spelling checking.

GetPage ( Object _pageFullName ) : void

Edits a wiki page.

IndexPageHistory ( String pageFullName ) : void

Retrieves the versioning information for a wiki page, and registers it ot the history dictionary.

KeepNewWindowActivated ( Microsoft.Office.Interop.Word doc, Microsoft.Office.Interop.Word Wn ) : void

Activates the newest Word window.

MergeWithLatestVersion ( String pageFullName ) : bool

If the document was modified externally, prompts the user with the document merge screen.

OpenForMerge ( String pageFullName, String &localFileName ) : void

Retrieves a page from the wiki and save it locally in order to be merged to the active document.

OpenHTMLDocument ( String path ) : Microsoft.Office.Interop.Word.Document

Opens a local(document) file with Word.

ReportSaveProblem ( ) : void
RestoreGrammarAndSpellingSettings ( ) : void

Restore user settings for grammar and spelling checking.

SaveGrammarAndSpellingSettings ( ) : void

Save user settings for grammar and spelling checking.

SavePage ( String pageName, String &pageContent, String syntax ) : bool

Saves the page to the wiki. Shows a message box with an error if the operation fails.

SaveToXwiki ( ) : void

Saves the currently edited page or document to the server.

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

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

Starts editing a new wiki page. The page will not be created in the wiki until the fisrt save.
public AddNewPage ( String space, String pageName ) : void
space String The name of the wiki space
pageName String The name of page
Результат void

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

Starts editing a new wiki page. The page will not be created in the wiki until the fisrt save.
public AddNewPage ( String spaceName, String pageName, String pageTitle, Form sender ) : void
spaceName String The name of the wiki space.
pageName String The name of page.
pageTitle String The title of the page.
sender System.Windows.Forms.Form /// The instance of the fprm that started the action. /// This form need to be closed before swithing the Active Word Document. ///
Результат void

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

Creates an instance for this class.
public AddinActions ( XWikiAddIn addin ) : System
addin XWikiAddIn The instance of the current add-in.
Результат System

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

Saves the document and attaches it to a wiki page
public AttachCurrentFile ( String pageFullName ) : bool
pageFullName String The full name of the wiki page.
Результат bool

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

Saves the document and attaches it to a wiki page
public AttachCurrentFile ( String space, String page ) : bool
space String The name of the wiki space.
page String The name of the page.
Результат bool

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

Searches the server response for error strings.
public CheckForErrors ( string content ) : bool
content string The server response.
Результат bool

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

Converts the folder to a "Normal" type folder.
public ConvertToNormalFolder ( string folder ) : void
folder string
Результат void

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

Downloads the file to a local folder. The folder is located in MyDocuments
public DownloadAttachment ( String pageFullName, String attachmentName, String path ) : FileInfo
pageFullName String FullName of the wiki page - Space.Name
attachmentName String Name of the attached file
path String The location where the attachment will be downloaded. Use null for default location.
Результат System.IO.FileInfo

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

Edits a wiki page. The LoadingDialog is shown during the operation. EditPage
public EditPage ( String pageFullName ) : void
pageFullName String The full name of the wiki page that is being opened for editing.
Результат void

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

Gets the fullname of the wiki page edited in the active document.
public GetActivePageName ( ) : String
Результат String

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

Removes all protected pages from the Word wiki structure.
public HideProtectedPages ( Wiki wiki, List wildcards ) : void
wiki XWiki.Model.Wiki The wiki instance.
wildcards List The list of protected pages wildcards.
Результат void

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

Specifies if a wiki page is opened for editing.
public IsOpened ( String pageFullName ) : bool
pageFullName String The full name of the page.
Результат bool

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

Specifies if a page is protected or not.
public IsProtectedPage ( String pageFullName, List wildCards ) : bool
pageFullName String The full name of the page.
wildCards List The wildcard list of protected pages.
Результат bool

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

Reloads the active document, if it's a wiki page.
public RefreshActiveDocument ( ) : void
Результат void

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

Displays a SaveFileDialog
public SaveFileDialog ( String fileName ) : String
fileName String Optional name of file to be saved.
Результат String

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

Saves the currently edited page or document to the server. Displays the operation in progress dialog.
public SaveToServer ( ) : void
Результат void

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

Copies a document to a specified path.
The document is saved in Unicode little endian encoding.
When the file cannot be saved.
public ShadowCopyDocument ( Microsoft.Office.Interop.Word document, string path, Microsoft.Office.Interop.Word saveFormat ) : bool
document Microsoft.Office.Interop.Word The Document instance.
path string The path where the new file will be saved.
saveFormat Microsoft.Office.Interop.Word The save format.
Результат bool

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

Starts a new process. - If the file is executable then it will execute that file. - If the file file is resistered to be opened with another application then it will be opened with that application - If the file doesnt have an assigned application then Windows Explorer openes it's directory.
public StartProcess ( String fullFileName ) : void
fullFileName String The full path and name of the file.
Результат void