C# Класс Kimono.KReplace

Наследование: KFind, IDisposable
Показать файл Открыть проект

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

Метод Описание
CloseReplaceNextDialog ( ) : void Close the "replace next?" dialog. The application should do this when the last match was hit. If the application deletes the KReplace, then "find previous" won't be possible anymore.
Dispose ( ) : void
KReplace ( string pattern, string replacement, long options ) : System
KReplace ( string pattern, string replacement, long options, QWidget parent ) : System Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
KReplace ( string pattern, string replacement, long options, QWidget parent, QWidget replaceDialog ) : System This is the recommended constructor if you also use KReplaceDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KReplace will notice if the find dialog is closed.
NumReplacements ( ) : int Return the number of replacements made (i.e. the number of times the replace signal was emitted). Can be used in a dialog box to tell the user how many replacements were made. The final dialog does so already, unless you used setDisplayFinalDialog(false).
Replace ( ) : KFind.Result Walk the text fragment (e.g. kwrite line, kspread cell) looking for matches. For each match, if prompt-on-replace is specified, emits the highlight() signal and displays the prompt-for-replace dialog before doing the replace.
Replace ( StringBuilder text, Qyoto.QRegExp pattern, string replacement, int index, long options, int &replacedLength ) : int
Replace ( StringBuilder text, string pattern, string replacement, int index, long options, int &replacedLength ) : int Search the given string, replaces with the given replacement string, and returns whether a match was found. If one is, the replacement string length is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="replacement" The replacement string to insert into the text. name="index" The starting index into the string. name="options" The options to use. name="replacedLength" Output parameter, contains the length of the replaced string. Not always the same as replacement.length(), when backreferences are used.
ReplaceNextDialog ( ) : Kimono.KDialog
ReplaceNextDialog ( bool create ) : Kimono.KDialog Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.

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

Метод Описание
CreateProxy ( ) : void
KReplace ( Type dummy ) : System

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

Метод Описание
DisplayFinalDialog ( ) : void
KReplace ( ) : System
ResetCounts ( ) : void
ShouldRestart ( ) : bool
ShouldRestart ( bool forceAsking ) : bool
ShouldRestart ( bool forceAsking, bool showNumMatches ) : bool

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

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

Close the "replace next?" dialog. The application should do this when the last match was hit. If the application deletes the KReplace, then "find previous" won't be possible anymore.
public CloseReplaceNextDialog ( ) : void
Результат void

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

protected CreateProxy ( ) : void
Результат void

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

public Dispose ( ) : void
Результат void

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

protected KReplace ( Type dummy ) : System
dummy System.Type
Результат System

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

public KReplace ( string pattern, string replacement, long options ) : System
pattern string
replacement string
options long
Результат System

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

Only use this constructor if you don't use KFindDialog, or if you use it as a modal dialog.
public KReplace ( string pattern, string replacement, long options, QWidget parent ) : System
pattern string
replacement string
options long
parent Qyoto.QWidget
Результат System

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

This is the recommended constructor if you also use KReplaceDialog (non-modal). You should pass the pointer to it here, so that when a message box appears it has the right parent. Don't worry about deletion, KReplace will notice if the find dialog is closed.
public KReplace ( string pattern, string replacement, long options, QWidget parent, QWidget replaceDialog ) : System
pattern string
replacement string
options long
parent Qyoto.QWidget
replaceDialog Qyoto.QWidget
Результат System

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

Return the number of replacements made (i.e. the number of times the replace signal was emitted). Can be used in a dialog box to tell the user how many replacements were made. The final dialog does so already, unless you used setDisplayFinalDialog(false).
public NumReplacements ( ) : int
Результат int

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

Walk the text fragment (e.g. kwrite line, kspread cell) looking for matches. For each match, if prompt-on-replace is specified, emits the highlight() signal and displays the prompt-for-replace dialog before doing the replace.
public Replace ( ) : KFind.Result
Результат KFind.Result

Replace() публичный статический Метод

public static Replace ( StringBuilder text, Qyoto.QRegExp pattern, string replacement, int index, long options, int &replacedLength ) : int
text StringBuilder
pattern Qyoto.QRegExp
replacement string
index int
options long
replacedLength int
Результат int

Replace() публичный статический Метод

Search the given string, replaces with the given replacement string, and returns whether a match was found. If one is, the replacement string length is also returned. A performance optimised version of the function is provided for use with regular expressions. name="text" The string to search. name="pattern" The pattern to look for. name="replacement" The replacement string to insert into the text. name="index" The starting index into the string. name="options" The options to use. name="replacedLength" Output parameter, contains the length of the replaced string. Not always the same as replacement.length(), when backreferences are used.
public static Replace ( StringBuilder text, string pattern, string replacement, int index, long options, int &replacedLength ) : int
text StringBuilder
pattern string
replacement string
index int
options long
replacedLength int
Результат int

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

public ReplaceNextDialog ( ) : Kimono.KDialog
Результат Kimono.KDialog

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

Return (or create) the dialog that shows the "find next?" prompt. Usually you don't need to call this. One case where it can be useful, is when the user selects the "Find" menu item while a find operation is under way. In that case, the program may want to call setActiveWindow() on that dialog.
public ReplaceNextDialog ( bool create ) : Kimono.KDialog
create bool
Результат Kimono.KDialog