cho phép định vị chính xác của điều khiển máy chủ, khi tài sản pageLayout được thiết lập để GridLayout. Visual Studio và và sau đó không có một tài sản pageLayout trên các tài liệu mẫu web, nhưng có một khả năng tương tự như trong các thiết kế HTML. | CHAPTER 12 BUILDING A COMPLEX CONTROL 591 Wrapping the Web Service Proxy in a Utility Method To make it easier to work with the web service proxy we wrap the creation and invocation process inside a utility class that abstracts all the details of communicating with the Live Search web service as shown in Listing 12-3. This class also hides the work necessary to grab configuration information from the custom configuration section we created earlier in this chapter. Listing 12-3. The Class File using System using using using using using LiveSearchService namespace summary Utility class for abstracting Live Search web service proxy work summary public sealed class SearchUtility private const string ConfigSectionName controlsBook2Lib liveSearchControls summary Static method for searching Live Search that wraps web service proxy code for easy invocation. summary param name query Query to Live Search search web service param param name sourceRequests Collection of search settings param returns returns public static SearchLiveSearchService string query SourceRequest sourceRequests string LiveSearchLicenseKey string LiveSearchWebServiceUrl get liveSearchControl config section from for search settings LiveSearchConfigSectionHandler config LiveSearchConfigSectionHandler ConfigSectionName if config null LiveSearchLicenseKey LiveSearchWebServiceUrl 592 CHAPTER 12 BUILDING A COMPLEX CONTROL if control is instantiated at runtime config section should be present else if null throw new Exception cannot find LiveSearchControl configuration section. EndpointAddress liveSearchAddress new EndpointAddress LiveSearchWebServiceUrl BasicHttpBinding .