@ -41,14 +41,6 @@ namespace SearchAndReplace
( offset + length + 1 > = document . Length | | Char . IsWhiteSpace ( document . GetCharAt ( offset + length ) ) ) ;
( offset + length + 1 > = document . Length | | Char . IsWhiteSpace ( document . GetCharAt ( offset + length ) ) ) ;
}
}
public static int CalcCurrentOffset ( IDocument document )
{
// TODO:
// int endOffset = document.Caret.Offset % document.TextLength;
// return endOffset;
return 0 ;
}
public static ISearchStrategy CreateSearchStrategy ( SearchStrategyType type )
public static ISearchStrategy CreateSearchStrategy ( SearchStrategyType type )
{
{
switch ( type ) {
switch ( type ) {
@ -70,6 +62,15 @@ namespace SearchAndReplace
case DocumentIteratorType . CurrentSelection :
case DocumentIteratorType . CurrentSelection :
return new CurrentDocumentIterator ( ) ;
return new CurrentDocumentIterator ( ) ;
case DocumentIteratorType . Directory :
case DocumentIteratorType . Directory :
try {
if ( ! Directory . Exists ( SearchOptions . LookIn ) ) {
MessageService . ShowMessageFormatted ( "${res:Dialog.NewProject.SearchReplace.SearchStringNotFound.Title}" , "${res:Dialog.NewProject.SearchReplace.LookIn.DirectoryNotFound}" , Path . GetFullPath ( SearchOptions . LookIn ) ) ;
return new DummyDocumentIterator ( ) ;
}
} catch ( Exception ex ) {
MessageService . ShowMessage ( ex . Message ) ;
return new DummyDocumentIterator ( ) ;
}
return new DirectoryDocumentIterator ( SearchOptions . LookIn ,
return new DirectoryDocumentIterator ( SearchOptions . LookIn ,
SearchOptions . LookInFiletypes ,
SearchOptions . LookInFiletypes ,
SearchOptions . IncludeSubdirectories ) ;
SearchOptions . IncludeSubdirectories ) ;