Refining searches


This feature is no longer available. It was removed for the 10.3 release of the ArcObjects .NET SDK.
Summary
Knowing how to refine searches with the ArcGIS Snippet Finder helps you locate the necessary code examples quicker to become more productive in developing your ArcObjects software-based applications.

In this topic

  • Using Boolean operators
    • Example 1—FocusMap AND AddHyperlink keywords
    • Example 2—FocusMap AND NOT AddHyperlink keywords
    • Example 3—FocusMap OR AddHyperlink keywords
    • Example 4—(FocusMap AND AddHyperlink) OR IActiveView keywords
  • Locating ArcGIS snippets
  • Setting options
    • Preferences dialog box
    • Search preferences
  • Search results

Using Boolean operators

The ArcGIS Snippet Finder uses Boolean operators AND, OR, and NOT in keyword searches to narrow search results. Parentheses can be used to organize the logic of complex Boolean keyword searches. The following are example keyword searches:

Example 1—FocusMap AND AddHyperlink keywords

The following example in the screen shot finds all occurrences of FocusMap AND AddHyperlink search keywords in the ArcGIS Snippet Finder:

Example 2—FocusMap AND NOT AddHyperlink keywords

The following example in the screen shot finds all occurrences of FocusMap AND NOT AddHyperlink search keywords in the ArcGIS Snippet Finder:

Example 3—FocusMap OR AddHyperlink keywords

The following example in the screen shot finds all occurrences of FocusMap OR AddHyperlink search keywords in the ArcGIS Snippet Finder:

Example 4—(FocusMap AND AddHyperlink) OR IActiveView keywords

The following example in the screen shot finds all occurrences of (FocusMap AND AddHyperlink) OR IActiveView search keywords in the ArcGIS Snippet Finder:

Locating ArcGIS snippets

With the ArcObjects .NET software development kit (SDK), you receive many ArcGIS snippets. The default set of ArcGIS snippets is named ArcObjects. Additional groups of ArcGIS snippets can be searched by clicking the drop-down list. Only those snippets that are in the drop-down list and their subdirectories will be searched when the Search button is clicked. See the following screen shot:
When performing a keyword search on ArcGIS snippets, only those snippets associated with a particular SDK (or user-specified directory) that is specified in the drop-down list are searched.
Additionally, you can create and save ArcGIS snippets on your local drive to let the Snippet Finder search for them. For more information on adding your user-specified ArcGIS snippet directory, see Adding user-specified directories. For more information about creating ArcGIS snippets, see ArcGIS Snippet Editor and Overview of the ArcGIS Snippet Editor Manager.

Setting options

To further enhance your search criteria, click Tools and click Options on the ArcGIS Snippet Finder to access the Preferences dialog box. See the following screen shot:

Preferences dialog box

On the Preferences dialog box, click the Search node to specify which parts of the snippet's Extensible Markup Language (XML) files to perform keyword searches on. See the following screen shot:

Search preferences

The following explains the search preferences:
  • Code—This option on the Preferences dialog box (selected by default) enables keyword searches for the code. This option includes the following choices:
    • All Code—This option (selected by default) searches all the code, which includes member variables, input and return parameters, and the method body. See the following screen shot:

    • Only Input and Return Parameters—This option (not selected by default) searches only the method signatures of the input and return parameters. Member or global variables, and the code in the method body are excluded from the search. You can refine this option by searching the input parameters, return parameters, or both. See the following screen shot:

Experienced ArcObjects software developers might find this option beneficial when using multiple ArcGIS snippets together. For example, if you need to use the IActiveView interface in your code, you can search for ArcGIS snippets that only return the IActiveView interface.
  • XML Documentation—This option (selected by default) enables keyword searches for programmer comments in the XML documentation of the ArcGIS snippets. XML comments use the .NET standard three forward slashes (///) for C# and three single quotation marks (''') for Visual Basic .NET comments. This option is recognized by the Object Browser and IntelliSense of Visual Studio. See the following screen shot:

  • Additional Comments—This section (all options are selected by default) enables keyword searches for additional programmer comments and the software requirements to use the snippet. See the following screen shot:

  • Case Sensitive—This option (not selected by default) requires that keyword searches match the case exactly as it is typed. For example, with the Case Sensitive check box selected, using the keywords of focusmap AND FocusMap returns different results. See the following screen shot:

Search results

The returned results from a keyword search will be greatly impacted based upon what choices are specified on the Preferences dialog box for the search options. Based upon this, the following should be noted:
  • Only the selected search preferences on the Preferences dialog box Search node are considered for keyword searches.
  • Search preferences that are not selected have results with unavailable areas (dimmed, light gray text) of Snippet text when you select an ArcGIS snippet to view its code.
  • Highlighted keywords only show in the Snippet text area when applicable search criteria is selected.
The following screen shot shows the ArcGIS Snippet Finder with a restricted search in the Snippet text area:
Search options do not reflect information inserted into Visual Studio's code editor. The information that shows in the Snippet text area is for evaluation to determine if this is an ArcGIS snippet you want inserted in your code. To determine what parts of the ArcGIS snippet you want to insert into the code editor, see Code insertion options.
All customizations that are used by the ArcGIS Snippet Finder through the Tools menu Options selection are stored on disk in an XML file named ArcGISSnippetPreferences9.xml. This XML file controls the behavior of the ArcGIS Snippet Finder. The following is the location on disk for this XML file:
  • %APPDATA%\ESRI\ArcGISSnippets\Settings\ArcGISSnippetPreferences9.xml
If the ArcGISSnippetPreferences9.xml is deleted, it will be re-created with default settings the next time the ArcGIS Snippet Finder is used.


See Also:

ArcGIS Snippet Finder
Code insertion options
Adding user-specified directories
ArcGIS Snippet Editor




Additional Requirements
  • Use display settings of 96 dots per inch (dpi) when using the ArcGIS Snippet Finder and ArcGIS Snippet Editor.

Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine