• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SearchScope类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SearchScope的典型用法代码示例。如果您正苦于以下问题:C# SearchScope类的具体用法?C# SearchScope怎么用?C# SearchScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SearchScope类属于命名空间,在下文中一共展示了SearchScope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
    }
开发者ID:RyuusukeMatsumoto,项目名称:Unity_ObjectFinder,代码行数:33,代码来源:ObjectFinder.cs


示例2: Directories

		public IEnumerable<IDirectory> Directories(string filter, SearchScope scope)
		{
			Contract.Requires(filter != null);
			Contract.Ensures(Contract.Result<IEnumerable<IDirectory>>() != null);

			throw new NotImplementedException();
		}
开发者ID:hammett,项目名称:Castle.Transactions,代码行数:7,代码来源:IDirectoryContract.cs


示例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;
     }
 }
开发者ID:haoasqui,项目名称:ONLYOFFICE-Server,代码行数:28,代码来源:ADHelper.cs


示例4: SearchRequest

 public SearchRequest()
 {
     this.directoryAttributes = new StringCollection();
     this.directoryScope = SearchScope.Subtree;
     this.directoryTimeLimit = new TimeSpan(0L);
     this.directoryAttributes = new StringCollection();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SearchRequest.cs


示例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);
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:33,代码来源:SearchService.cs


示例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));
			}
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:RefactoringCommands.cs


示例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;
		}
开发者ID:aelveborn,项目名称:njupiter,代码行数:8,代码来源:SearcherFactory.cs


示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ADSearcher.cs


示例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;
        }
开发者ID:SharpeRAD,项目名称:Cake.AWS.S3,代码行数:16,代码来源:SyncSettingsExtensions.cs


示例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;
        }
开发者ID:jlyonsmith,项目名称:ToolBelt,代码行数:17,代码来源:DirectoryUtility.cs


示例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;
        }
开发者ID:jlyonsmith,项目名称:ToolBelt,代码行数:17,代码来源:DirectoryUtility.cs


示例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;
 }
开发者ID:DNIDNL,项目名称:hadouken,代码行数:14,代码来源:FakeDirectory.cs


示例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;
        }
开发者ID:chcosta,项目名称:corefx,代码行数:15,代码来源:ADSearcher.cs


示例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);
        }
开发者ID:saasu,项目名称:api-sdk-dotnet,代码行数:18,代码来源:SearchProxy.cs


示例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);
            }
        }
开发者ID:jlyonsmith,项目名称:ToolBelt,代码行数:27,代码来源:DirectoryInfoUtility.cs


示例16: FNSearch

        public List<string> FNSearch(string sql)
        {
            List<string> result = new List<string>();

            SearchSQL searchSql = new SearchSQL(sql);
            SearchScope searchScope = new SearchScope(this._ceConn.objectStore);
            IRepositoryRowSet rowSet = searchScope.FetchRows(searchSql, null, null, null);

            if (rowSet.IsEmpty())
                return null;

            System.Collections.IEnumerator enumerator = rowSet.GetEnumerator();
            while (enumerator.MoveNext())
            {
                IRepositoryRow row = (IRepositoryRow)enumerator.Current;
                Id id = row.Properties.GetProperty("Id").GetIdValue();
                result.Add(id.ToString());
            }

            return result;
        }
开发者ID:xchgdzq233,项目名称:testing,代码行数:21,代码来源:FileNetUtil.cs


示例17: Configure

 public static void Configure(NameValueCollection sections)
 {
     LdapFilter = sections["LdapFilter"];
     FolderCreatePath= sections["FolderCreatePath"];
     SearchBase = sections["SearchBase"];
     switch (sections["SearchScope"])
     {
         case "Base":
             SearchScope = SearchScope.Base;
             break;
         case "OneLevel":
             SearchScope = SearchScope.OneLevel;
             break;
         case "Subtree":
             SearchScope = SearchScope.Subtree;
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
     DirectoryEntry= new DirectoryEntry(SearchBase);
     DomainSid= WindowsIdentity.GetCurrent().User.AccountDomainSid;
 }
开发者ID:Kusado,项目名称:WindowsProjects,代码行数:22,代码来源:AppSettings.cs


示例18: GetDirectories

        /// <summary>
        /// Returns a list of directories given a file search pattern.  Will also search sub-directories and 
        /// parent directories.
        /// </summary>
        /// <param name="dirSpec">Search specification with with optional directory and wildcards</param>
        /// <param name="scope">The scope of the search. <see cref="SearchScope"/></param>
        /// <returns>An array of <c>DirectoryInfo</c> objects for files matching the search pattern. </returns>
        public static IList<DirectoryInfo> GetDirectories(ParsedPath dirSpec, SearchScope scope)
        {
            if (!dirSpec.HasFilename)
                throw new ArgumentException("Path does not have a filename");

            ParsedPath rootPath = dirSpec.MakeFullPath();

            if (scope != SearchScope.DirectoryOnly)
            {
                List<DirectoryInfo> dirs = new List<DirectoryInfo>();

                if (scope == SearchScope.RecurseParentDirectories)
                    RecursiveGetParentDirectories(rootPath, ref dirs);
                else
                    RecursiveGetSubDirectories(rootPath, (scope == SearchScope.RecurseSubDirectoriesBreadthFirst), ref dirs);

                return dirs.ToArray();
            }
            else
            {
                return NonRecursiveGetDirectories(rootPath);
            }
        }
开发者ID:jlyonsmith,项目名称:ToolBelt,代码行数:30,代码来源:DirectoryInfoUtility.cs


示例19: findAllShortcuts

            /// <summary>
            ///     Find all shortcuts in the shortcut lists matching the given class and method.
            /// </summary>
            /// <param name="shortcutClass">The class of the shortcut</param>
            /// <param name="shortcutMethod">The method of the shortcut</param>
            /// <param name="where">A flag to tell where the shortcut should be searched</param>
            /// <returns>A list of matching shortcut data</returns>
            /// <seealso cref="findShortcut"/>
            public List<ShortcutData> findAllShortcuts(string shortcutClass, string shortcutMethod, SearchScope where = SearchScope.All)
            {
                if (mCurrentShortcutsList == mDefaultShortcutsList)
                    return findAllShortcuts(shortcutClass, shortcutMethod, mCurrentShortcutsList);

                switch (where) {
                case SearchScope.AllCurrentFirst:
                    return findAllShortcuts(shortcutClass, shortcutMethod, mCurrentShortcutsList.Concat(mDefaultShortcutsList).ToList());
                case SearchScope.AllDefaultFirst:
                    return findAllShortcuts(shortcutClass, shortcutMethod, mDefaultShortcutsList.Concat(mCurrentShortcutsList).ToList());
                case SearchScope.Current:
                    return findAllShortcuts(shortcutClass, shortcutMethod, mCurrentShortcutsList);
                case SearchScope.Default:
                    return findAllShortcuts(shortcutClass, shortcutMethod, mDefaultShortcutsList);
                default:
                    throw new ArgumentException("Bad value for search scope: " + where);
                }
            }
开发者ID:pasccom,项目名称:GlobalHotKeys,代码行数:26,代码来源:Handler.cs


示例20: findShortcut

            /// <summary>
            ///     Find a shortcut in the shortcut lists by modifiers and key.
            /// </summary>
            /// <param name="shortcutModifiers">The modifier of the shortcut</param>
            /// <param name="shortcutKey">The key of the shortcut</param>
            /// <param name="where">A flag to tell where the shortcut should be searched</param>
            /// <returns>The matching shortcut data or <c>null</c> if it is not found</returns>
            /// <seealso cref="findAllShortcuts"/>
            public ShortcutData findShortcut(ShortcutData.Modifiers shortcutModifiers, ShortcutData.Keys shortcutKey, SearchScope where = SearchScope.All)
            {
                if (mCurrentShortcutsList == mDefaultShortcutsList)
                    return findShortcut(shortcutModifiers, shortcutKey, mCurrentShortcutsList);

                switch (where) {
                case SearchScope.AllCurrentFirst:
                    return findShortcut(shortcutModifiers, shortcutKey, mCurrentShortcutsList.Concat(mDefaultShortcutsList).ToList());
                case SearchScope.AllDefaultFirst:
                    return findShortcut(shortcutModifiers, shortcutKey, mDefaultShortcutsList.Concat(mCurrentShortcutsList).ToList());
                case SearchScope.Current:
                    return findShortcut(shortcutModifiers, shortcutKey, mCurrentShortcutsList);
                case SearchScope.Default:
                    return findShortcut(shortcutModifiers, shortcutKey, mDefaultShortcutsList);
                default:
                    throw new ArgumentException("Bad value for search scope: " + where);
                }
            }
开发者ID:pasccom,项目名称:GlobalHotKeys,代码行数:26,代码来源:Handler.cs



注:本文中的SearchScope类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SearchType类代码示例发布时间:2022-05-24
下一篇:
C# SearchResult类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap