本文整理汇总了C#中SearchScope类的典型用法代码示例。如果您正苦于以下问题:C# SearchScope类的具体用法?C# SearchScope怎么用?C# SearchScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SearchScope类属于命名空间,在下文中一共展示了SearchScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawMainLeftElem
//--------------------------------------------------------------------------------------------------
// メインウィンドウ左側描画領域.
// 検索条件などを指定する領域.
private void drawMainLeftElem()
{
EditorGUILayout.BeginVertical( GUI.skin.box, GUILayout.Width( MAIN_LEFT_ELEM_WIDTH ) );
this.searchType = ( SearchType )EditorGUILayout.EnumPopup( "検索タイプ", this.searchType );
this.searchScope = ( SearchScope )EditorGUILayout.EnumPopup( "検索範囲", this.searchScope );
this.wholeWord = EditorGUILayout.Toggle( "完全一致か否か.", this.wholeWord );
if ( !this.wholeWord )
this.caseSencitive = EditorGUILayout.Toggle( "大小文字一致比較.", this.caseSencitive );
switch ( this.searchType ){
case SearchType.Name: EditorGUILayout.LabelField( "Input ObjectName" ); break;
case SearchType.Component: EditorGUILayout.LabelField( "Input ComponentName" ); break;
default: break;
}
this.searchText = EditorGUILayout.TextField( this.searchText, GUI.skin.textField );
if ( GUILayout.Button( "Search" ) ){
Debug.Log( "捜索します." );
this.search();
}
MyEditorLayout.space( 3 );
MyEditorLayout.separatorLine( MAIN_LEFT_ELEM_WIDTH );
this.dumpFoldout = EditorGUILayout.Foldout( this.dumpFoldout, "Show Dump Palameter" );
if ( this.dumpFoldout )
this.drawDumpPalameter();
EditorGUILayout.EndVertical();
}
示例2: Directories
public IEnumerable<IDirectory> Directories(string filter, SearchScope scope)
{
Contract.Requires(filter != null);
Contract.Ensures(Contract.Result<IEnumerable<IDirectory>>() != null);
throw new NotImplementedException();
}
示例3: Search
public static List<DirectoryEntry> Search(string rootDistinguishedName, string filter, SearchScope scope, LDAPSupportSettings settings)
{
DirectoryEntry de;
var type = AuthenticationTypes.ReadonlyServer | AuthenticationTypes.Secure;
if (settings.PortNumber == Constants.SSL_LDAP_PORT)
{
type |= AuthenticationTypes.SecureSocketsLayer;
}
string password;
try
{
password = new UnicodeEncoding().GetString(InstanceCrypto.Decrypt(settings.PasswordBytes));
}
catch (Exception)
{
password = string.Empty;
}
de = settings.Authentication ? CreateDirectoryEntry(rootDistinguishedName, settings.Login, password, type) :
CreateDirectoryEntry(rootDistinguishedName);
if (de != null)
{
return Search(de, filter, scope);
}
else
{
return null;
}
}
示例4: SearchRequest
public SearchRequest()
{
this.directoryAttributes = new StringCollection();
this.directoryScope = SearchScope.Subtree;
this.directoryTimeLimit = new TimeSpan(0L);
this.directoryAttributes = new StringCollection();
}
示例5: Replace
public void Replace(string textToFind, string textToReplace, Document doc, SearchFlags flags, SearchScope scope, int startPosition, int endPosition)
{
var ed = App.Editor(doc.GetType()) as ITextEditor;
if (lastSettings != null &&
(lastSettings.LastDocument != doc || ed.SelectionStart != lastSettings.LastStartPosition || ed.SelectionEnd != lastSettings.LastEndPosition))
lastSettings = null;
if (lastSettings != null)
{
ed.ReplaceText(lastSettings.LastStartPosition, lastSettings.LastEndPosition, lastSettings.TextToReplace);
lastSettings.LastEndPosition = lastSettings.LastStartPosition + lastSettings.TextToReplace.Length;
}
var res = Search(textToFind, doc, flags, scope, (d,r) => {
var editor = (ITextEditor)App.GetService<IEditorService>().GetEditor(d.GetType()).Instance;
var docServ = App.GetService<IDocumentService>();
if (docServ.GetActiveDocument() != d)
docServ.SetActiveDocument(d);
editor.SelectText(r.StartPosition, r.EndPosition - r.StartPosition);
lastSettings.LastStartPosition = r.StartPosition;
lastSettings.TextToReplace = textToReplace;
var sci = editor.Control as ScintillaControl;
if (sci != null)
sci.PutArrow(sci.GetLineFromPosition(r.StartPosition));
return true;
}, false, lastSettings != null ? lastSettings.LastEndPosition : startPosition, endPosition, null);
IsFinished(res);
}
示例6: Run
public static void Run(SearchScope scope) {
// Allow the menu to close
Application.DoEvents();
using(AsynchronousWaitDialog monitor = AsynchronousWaitDialog.ShowWaitDialog("${res:Hornung.ResourceToolkit.FindMissingResourceKeys}")) {
FindReferencesAndRenameHelper.ShowAsSearchResults(StringParser.Parse("${res:Hornung.ResourceToolkit.ReferencesToMissingKeys}"),
ResourceRefactoringService.FindReferencesToMissingKeys(monitor, scope));
}
}
示例7: CreateSearcher
private IDirectorySearcher CreateSearcher(IEntry entry, SearchScope searchScope, string rdnAttribute) {
var searcher = CreateSearcher(entry, searchScope);
if(serverConfig.PropertySortingSupport || serverConfig.VirtualListViewSupport) {
searcher.Sort.PropertyName = rdnAttribute;
searcher.Sort.Direction = SortDirection.Ascending;
}
return searcher;
}
示例8: ADSearcher
public ADSearcher(DirectoryEntry searchRoot, string filter, string[] propertiesToLoad, SearchScope scope)
{
this.searcher = new DirectorySearcher(searchRoot, filter, propertiesToLoad, scope);
this.searcher.CacheResults = false;
this.searcher.ClientTimeout = defaultTimeSpan;
this.searcher.ServerPageTimeLimit = defaultTimeSpan;
this.searcher.PageSize = 0x200;
}
示例9: SetSearchScope
/// <summary>
/// Specifies the scope to use when searching for files.
/// </summary>
/// <param name="settings">The sync settings.</param>
/// <param name="scope">The scope.</param>
/// <returns>The same <see cref="SyncSettings"/> instance so that multiple calls can be chained.</returns>
public static SyncSettings SetSearchScope(this SyncSettings settings, SearchScope scope = SearchScope.Current)
{
if (settings == null)
{
throw new ArgumentNullException("settings");
}
settings.SearchScope = scope;
return settings;
}
示例10: GetFiles
/// <summary>
/// See <see cref="DirectoryInfoUtility.GetFiles(string, SearchScope)"/>.
/// </summary>
/// <param name="fileSpec"></param>
/// <param name="scope"></param>
/// <returns></returns>
public static IList<ParsedPath> GetFiles(ParsedPath fileSpec, SearchScope scope)
{
IList<FileInfo> fileInfos = DirectoryInfoUtility.GetFiles(fileSpec, scope);
ParsedPath[] files = new ParsedPath[fileInfos.Count];
for (int i = 0; i < fileInfos.Count; i++)
files[i] = new ParsedPath(fileInfos[i].FullName, PathType.File);
return files;
}
示例11: GetDirectories
/// <summary>
/// See <see cref="DirectoryInfoUtility.GetDirectories(string, SearchScope)"/>
/// </summary>
/// <param name="dirSpec"></param>
/// <param name="scope"></param>
/// <returns></returns>
public static IList<ParsedPath> GetDirectories(ParsedPath dirSpec, SearchScope scope)
{
IList<DirectoryInfo> dirInfos = DirectoryInfoUtility.GetDirectories(dirSpec, scope);
ParsedPath[] dirs = new ParsedPath[dirInfos.Count];
for (int i = 0; i < dirInfos.Count; i++)
dirs[i] = new ParsedPath(dirInfos[i].FullName, PathType.Directory);
return dirs;
}
示例12: GetFiles
public IEnumerable<IFile> GetFiles(string filter, SearchScope scope)
{
var result = new List<IFile>();
var children = _fileSystem.Files.Where(x => x.Key.FullPath.StartsWith(_path.FullPath + "/", StringComparison.OrdinalIgnoreCase));
foreach (var child in children.Where(c => c.Value.Exists))
{
var relative = child.Key.FullPath.Substring(_path.FullPath.Length + 1);
if (!relative.Contains("/"))
{
result.Add(child.Value);
}
}
return result;
}
示例13: ADSearcher
public ADSearcher(DirectoryEntry searchRoot, string filter, string[] propertiesToLoad, SearchScope scope)
{
_searcher = new DirectorySearcher(searchRoot, filter, propertiesToLoad, scope);
// set all search preferences
// don't cache the results on the client
_searcher.CacheResults = false;
// set the timeout to 2 minutes
_searcher.ClientTimeout = s_defaultTimeSpan;
_searcher.ServerPageTimeLimit = s_defaultTimeSpan;
// Page Size needs to be set so that we
// can get all the results even when the number of results
// is greater than the server set limit (1000 in Win2000 and 1500 in Win2003)
_searcher.PageSize = 512;
}
示例14: Search
public ProxyResponse<SearchResponse> Search(string keywords, SearchScope scope, int pageNumber, int pageSize, string entityType = "", string includeSearchTermHighlights = "false")
{
OperationMethod = HttpMethod.Get;
var queryArgs = new StringBuilder();
AppendQueryArg(queryArgs, ApiConstants.FilterKeywords, keywords);
AppendQueryArg(queryArgs, ApiConstants.FilterSearchScope, scope.ToString("G"));
AppendQueryArg(queryArgs, ApiConstants.FilterSearchTransactionType, entityType);
AppendQueryArg(queryArgs, ApiConstants.FilterExampleIncludeSearchTermHighlights, includeSearchTermHighlights);
bool inclPageNumber;
bool inclPageSize;
base.GetPaging(queryArgs, pageNumber, pageSize, out inclPageNumber, out inclPageSize);
var uri = base.GetRequestUri(queryArgs.ToString(), inclDefaultPageNumber: inclPageNumber, inclDefaultPageSize: inclPageSize);
return base.GetResponse<SearchResponse>(uri);
}
示例15: GetFiles
/// <summary>
/// Returns a list of files given a file search pattern. Will also search sub-directories.
/// </summary>
/// <param name="searchPattern">Search pattern. Can include a full or partial path and standard wildcards for the file name.</param>
/// <param name="scope">The scope of the search.</param>
/// <param name="baseDir">Base directory to use for partially qualified paths</param>
/// <returns>An array of <c>FileInfo</c> objects for files matching the search pattern. </returns>
public static IList<FileInfo> GetFiles(ParsedPath fileSpec, SearchScope scope)
{
ParsedPath rootPath = fileSpec.MakeFullPath();
if (scope != SearchScope.DirectoryOnly)
{
List<FileInfo> files = new List<FileInfo>();
if (scope == SearchScope.RecurseParentDirectories)
RecursiveGetParentFiles(rootPath, ref files);
else
RecursiveGetSubFiles(rootPath, (scope == SearchScope.RecurseSubDirectoriesBreadthFirst), ref files);
return files.ToArray();
}
else
{
return NonRecursiveGetFiles(rootPath);
}
}