C# Класс WikiFunctions.Parse.FindandReplace

Provides a form and functions for setting and applying multiple find and replacements on a text string.
Наследование: System.Windows.Forms.Form
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ChangeChecked void
Decode string
Encode string
FindAndReplaceContextMenu_Opening void
FindandReplace_FormClosing void
FindandReplace_Shown void
FindandReplace_VisibleChanged void
InitializeComponent void
PrepareReplacePart string
RowToReplacement Replacement
SelectRowAndFocusColumn void
addRowToolStripMenuItem_Click void
allCaseSensitiveToolStripMenuItem_Click void
btnCancel_Click void
btnClear_Click void
btnDone_Click void
btnSearch_Click void
checkAllBeforeOrAfterToolStripMenuItem_Click void
checkAllMinorToolStripMenuItem_Click void
checkAllMultlineToolStripMenuItem_Click void
checkAllRegularExpressionsToolStripMenuItem_Click void
checkAllSinglelineToolStripMenuItem_Click void
chkIgnoreMore_CheckedChanged void
createRetfRuleToolStripMenuItem_Click void
dataGridView1_RowsAdded void
deleteRowToolStripMenuItem_Click void
disableAllToolStripMenuItem_Click void
enableAllToolStripMenuItem_Click void
lblMsdn_LinkClicked void
linkLabel2_LinkClicked void
moveDownToolStripMenuItem_Click void
moveToBottomToolStripMenuItem_Click void
moveToTopToolStripMenuItem_Click void
moveUpToolStripMenuItem_Click void
testRegexToolStripMenuItem_Click void
txtSearch_KeyPress void
txtSearch_TextChanged void
uncheckAllBeforeOrAfterToolStripMenuItem_Click void
uncheckAllCaseSensitiveToolStripMenuItem_Click void
uncheckAllMinorToolStripMenuItem_Click void
uncheckAllMultilineToolStripMenuItem_Click void
uncheckAllRegularExpressionsToolStripMenuItem_Click void
uncheckAllSinglelineToolStripMenuItem_Click void

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

Метод Описание
AddNew ( List rList ) : void

Loads list of replacement entries into the find and replace data grid

AddNew ( Replacement r ) : void

Loads a single replacement entry into the find and replace data grid

AddNew ( Replacement r, bool decodeRequired ) : void

Loads a single replacement entry into the find and replace data grid

Clear ( ) : void

Clears the set replacements.

FindandReplace ( ) : System
GetList ( ) : List

Gets the find and replace settings.

HasProcessingReplacements ( bool after ) : bool

Returns whether any of the enabled find & replace entries are specified to be run at before/after as input

MakeList ( ) : void

Builds backup list of find and replace entries in case user later wants to restore them

MultipleFindAndReplace ( string articleText, string strTitle, bool beforeOrAfter, string &editSummary, bool &majorChangesMade ) : string

Applies a series of defined find and replacements to the supplied article text.

PerformFindAndReplace ( Replacement rep, string articleText, string articleTitle, bool &changeMade ) : string

Executes a single find & replace rule against the article text. First applies keywords to the find and replace portions of the rule, then executes the rule. Edit summary is generated from the first match of the rule that changes the article text on replacement. Count of changes is replacements affecting article, not total matches i.e. no-change replacements are not counted in the edit summary

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Clean up any resources being used.

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

Метод Описание
ChangeChecked ( string col, bool value ) : void
Decode ( string text ) : string

Decode the specified text, replacing LF newline with \r\n text

Encode ( string text ) : string

Encode the specified text, replacing \r\n text with actual CRLF newline

FindAndReplaceContextMenu_Opening ( object sender, System e ) : void
FindandReplace_FormClosing ( object sender, FormClosingEventArgs e ) : void
FindandReplace_Shown ( object sender, EventArgs e ) : void
FindandReplace_VisibleChanged ( object sender, EventArgs e ) : void
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

PrepareReplacePart ( string replace ) : string
RowToReplacement ( System.Windows.Forms.DataGridViewRow dataGridRow ) : Replacement
SelectRowAndFocusColumn ( int row ) : void

After a user has just moved a row: selects the moved row and returns focus to the previously selected column

addRowToolStripMenuItem_Click ( object sender, EventArgs e ) : void
allCaseSensitiveToolStripMenuItem_Click ( object sender, EventArgs e ) : void
btnCancel_Click ( object sender, EventArgs e ) : void
btnClear_Click ( object sender, EventArgs e ) : void
btnDone_Click ( object sender, EventArgs e ) : void
btnSearch_Click ( object sender, EventArgs e ) : void
checkAllBeforeOrAfterToolStripMenuItem_Click ( object sender, EventArgs e ) : void
checkAllMinorToolStripMenuItem_Click ( object sender, EventArgs e ) : void
checkAllMultlineToolStripMenuItem_Click ( object sender, EventArgs e ) : void
checkAllRegularExpressionsToolStripMenuItem_Click ( object sender, EventArgs e ) : void
checkAllSinglelineToolStripMenuItem_Click ( object sender, EventArgs e ) : void
chkIgnoreMore_CheckedChanged ( object sender, EventArgs e ) : void
createRetfRuleToolStripMenuItem_Click ( object sender, EventArgs e ) : void
dataGridView1_RowsAdded ( object sender, System.Windows.Forms.DataGridViewRowsAddedEventArgs e ) : void
deleteRowToolStripMenuItem_Click ( object sender, EventArgs e ) : void
disableAllToolStripMenuItem_Click ( object sender, EventArgs e ) : void
enableAllToolStripMenuItem_Click ( object sender, EventArgs e ) : void
lblMsdn_LinkClicked ( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) : void
linkLabel2_LinkClicked ( object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e ) : void
moveDownToolStripMenuItem_Click ( object sender, EventArgs e ) : void
moveToBottomToolStripMenuItem_Click ( object sender, EventArgs e ) : void
moveToTopToolStripMenuItem_Click ( object sender, EventArgs e ) : void
moveUpToolStripMenuItem_Click ( object sender, EventArgs e ) : void
testRegexToolStripMenuItem_Click ( object sender, EventArgs e ) : void
txtSearch_KeyPress ( object sender, KeyPressEventArgs e ) : void
txtSearch_TextChanged ( object sender, EventArgs e ) : void
uncheckAllBeforeOrAfterToolStripMenuItem_Click ( object sender, EventArgs e ) : void
uncheckAllCaseSensitiveToolStripMenuItem_Click ( object sender, EventArgs e ) : void
uncheckAllMinorToolStripMenuItem_Click ( object sender, EventArgs e ) : void
uncheckAllMultilineToolStripMenuItem_Click ( object sender, EventArgs e ) : void
uncheckAllRegularExpressionsToolStripMenuItem_Click ( object sender, EventArgs e ) : void
uncheckAllSinglelineToolStripMenuItem_Click ( object sender, EventArgs e ) : void

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

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

Loads list of replacement entries into the find and replace data grid
public AddNew ( List rList ) : void
rList List
Результат void

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

Loads a single replacement entry into the find and replace data grid
public AddNew ( Replacement r ) : void
r Replacement
Результат void

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

Loads a single replacement entry into the find and replace data grid
public AddNew ( Replacement r, bool decodeRequired ) : void
r Replacement The red component.
decodeRequired bool Whether decoding of newlines in find and replace text required. Required when loading settings from XML. NOT required when restoring from backup after Cancel
Результат void

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

Clears the set replacements.
public Clear ( ) : void
Результат void

Dispose() защищенный Метод

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
Результат void

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

public FindandReplace ( ) : System
Результат System

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

Gets the find and replace settings.
public GetList ( ) : List
Результат List

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

Returns whether any of the enabled find & replace entries are specified to be run at before/after as input
public HasProcessingReplacements ( bool after ) : bool
after bool
Результат bool

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

Builds backup list of find and replace entries in case user later wants to restore them
public MakeList ( ) : void
Результат void

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

Applies a series of defined find and replacements to the supplied article text.
public MultipleFindAndReplace ( string articleText, string strTitle, bool beforeOrAfter, string &editSummary, bool &majorChangesMade ) : string
articleText string The wiki text of the article.
strTitle string
beforeOrAfter bool False if "before", true if "after"
editSummary string
majorChangesMade bool
Результат string

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

Executes a single find & replace rule against the article text. First applies keywords to the find and replace portions of the rule, then executes the rule. Edit summary is generated from the first match of the rule that changes the article text on replacement. Count of changes is replacements affecting article, not total matches i.e. no-change replacements are not counted in the edit summary
public PerformFindAndReplace ( Replacement rep, string articleText, string articleTitle, bool &changeMade ) : string
rep Replacement F&R rule to execute
articleText string The article text
articleTitle string The article title
changeMade bool Whether the F&R rule caused changes to the article text
Результат string