[源码下载]

重新想象 Windows 8 Store Apps (38) - 契约: Search Contract

作者:webabcd

介绍
重新想象 Windows 8 Store Apps 之 契约

  • Search Contract - 右侧边栏称之为 Charm, 其中的“搜索”称之为 Search Contract
  • 使用 Search Contract 的搜索建议,数据源在本地,以及从输入法编辑器中获取相关信息
  • 使用 Search Contract 的搜索建议,数据源在服务端,以及为搜索建议增加图标、描述等
  • 使用 Search Contract 的基于本地文件的搜索建议,数据来源于文件的 metadata

示例
1、演示 Search Contract 的基本应用
Contracts/SearchContract/Demo.xaml

  1. <Page
  2. x:Class="XamlDemo.Contracts.SearchContract.Demo"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo.Contracts.SearchContract"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11. <StackPanel Margin="120 0 0 0">
  12.  
  13. <TextBlock Name="lblMsg" FontSize="14.667" Text="直接通过键盘输入即可激活 SearchPane" />
  14.  
  15. <Button Name="btnShowSearch" Content="打开 SearchPane" Click="btnShowSearch_Click_1" Margin="0 10 0 0" />
  16.  
  17. </StackPanel>
  18. </Grid>
  19. </Page>

Contracts/SearchContract/Demo.xaml.cs

  1. /*
  2. * 本例演示 Search Contract 的基本应用
  3. *
  4. * Search Contract - 右侧边栏称之为 Charm,其中的“搜索”称之为 Search Contract
  5. *
  6. * 1、在 Package.appxmanifest 中新增一个“搜索”声明
  7. * 2、在 App.xaml.cs 中 override void OnSearchActivated(SearchActivatedEventArgs args),如果 app 是由搜索激活的,则可以在此获取相关的搜索信息
  8. *
  9. * SearchActivatedEventArgs - 当 app 由搜索激活时的事件参数
  10. * QueryText - 搜索文本
  11. * PreviousExecutionState - 此 app 被搜索激活前的执行状态(ApplicationExecutionState 枚举:NotRunning, Running, Suspended, Terminated, ClosedByUser)
  12. * SplashScreen - 启动画面对象
  13. *
  14. * SearchPane - 搜索面板
  15. * GetForCurrentView() - 获取当前的 SearchPane
  16. * Show() - 显示搜索面板,需要的话可以指定初始查询字符串
  17. * PlaceholderText - 当搜索框没有输入焦点且用户未输入任何字符时,搜索框中的提示文本
  18. * SearchHistoryEnabled - 是否启用搜索建议的历史记录功能,默认值是 true
  19. * SearchHistoryContext - 如果启用了搜索建议的历史记录功能,则此值用于指定历史纪录的上下文,即历史记录会在此上下文中保存和获取,也就是说一个 app 的搜索建议历史记录可以有多套
  20. * ShowOnKeyboardInput - 如果发现键盘输入,是否激活搜索面板,默认值是 false
  21. * Visible - 搜索面板是否是打开状态,只读
  22. * QueryChanged - 搜索面板的搜索框中的文本发生变化时所触发的事件
  23. * QuerySubmitted - 提交搜索面板的搜索框中的文本时所触发的事件
  24. * VisibilityChanged - 打开或关闭搜索面板时所触发的事件
  25. */
  26.  
  27. using System;
  28. using Windows.ApplicationModel.Activation;
  29. using Windows.ApplicationModel.Search;
  30. using Windows.UI.Xaml;
  31. using Windows.UI.Xaml.Controls;
  32. using Windows.UI.Xaml.Navigation;
  33.  
  34. namespace XamlDemo.Contracts.SearchContract
  35. {
  36. public sealed partial class Demo : Page
  37. {
  38. private SearchPane _searchPane;
  39.  
  40. public Demo()
  41. {
  42. this.InitializeComponent();
  43. }
  44.  
  45. protected override void OnNavigatedTo(NavigationEventArgs e)
  46. {
  47. // 获取当前的 SearchPane,并注册相关事件
  48. _searchPane = SearchPane.GetForCurrentView();
  49. _searchPane.QueryChanged += _searchPane_QueryChanged;
  50. _searchPane.QuerySubmitted += _searchPane_QuerySubmitted;
  51.  
  52. // 当搜索框没有输入焦点且用户未输入任何字符时,搜索框中的提示文本
  53. _searchPane.PlaceholderText = "请输入";
  54.  
  55. // 是否启用搜索建议的历史记录
  56. _searchPane.SearchHistoryEnabled = true;
  57. // 指定搜索建议的历史记录的上下文
  58. _searchPane.SearchHistoryContext = "abc";
  59.  
  60. // 如果有键盘输入,则直接激活 SearchPane
  61. _searchPane.ShowOnKeyboardInput = true;
  62.  
  63. // 通过搜索激活应用程序时(参见 App.xaml.cs 中的 OnSearchActivated() 方法)
  64. SearchActivatedEventArgs searchActivated = (SearchActivatedEventArgs)e.Parameter;
  65. if (searchActivated != null)
  66. ShowSearchPane(searchActivated.QueryText);
  67. }
  68.  
  69. protected override void OnNavigatedFrom(NavigationEventArgs e)
  70. {
  71. // 取消相关事件的监听
  72. _searchPane.QueryChanged -= _searchPane_QueryChanged;
  73. _searchPane.QuerySubmitted -= _searchPane_QuerySubmitted;
  74.  
  75. _searchPane.ShowOnKeyboardInput = false;
  76. }
  77.  
  78. private void btnShowSearch_Click_1(object sender, RoutedEventArgs e)
  79. {
  80. ShowSearchPane();
  81. }
  82.  
  83. // 显示 Search 面板
  84. private void ShowSearchPane(string queryText="")
  85. {
  86. _searchPane.Show(queryText);
  87. lblMsg.Text = queryText;
  88. }
  89.  
  90. void _searchPane_QueryChanged(SearchPane sender, SearchPaneQueryChangedEventArgs args)
  91. {
  92. lblMsg.Text = args.QueryText;
  93. }
  94.  
  95. void _searchPane_QuerySubmitted(SearchPane sender, SearchPaneQuerySubmittedEventArgs args)
  96. {
  97. lblMsg.Text = args.QueryText;
  98. }
  99. }
  100. }

App.xaml.cs

  1. // 通过搜索激活应用程序时所调用的方法
  2. protected override void OnSearchActivated(SearchActivatedEventArgs args)
  3. {
  4. if (args.PreviousExecutionState == ApplicationExecutionState.Running)
  5. return;
  6.  
  7. var rootFrame = new Frame();
  8. rootFrame.Navigate(typeof(MainPage), args);
  9. Window.Current.Content = rootFrame;
  10.  
  11. Window.Current.Activate();
  12. }

2、本例演示如何使用 Search Contract 的搜索建议,数据源在本地。同时演示如何从输入法编辑器中获取相关信息
Contracts/SearchContract/LocalSuggestion.xaml

  1. <Page
  2. x:Class="XamlDemo.Contracts.SearchContract.LocalSuggestion"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo.Contracts.SearchContract"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11. <StackPanel Margin="120 0 0 0">
  12.  
  13. <TextBlock Name="lblMsg" FontSize="14.667" Text="本例演示如何使用 Search Contract 的搜索建议,数据源在本地。同时演示如何从输入法编辑器中获取相关信息" />
  14.  
  15. </StackPanel>
  16. </Grid>
  17. </Page>

Contracts/SearchContract/LocalSuggestion.xaml.cs

  1. /*
  2. * 本例演示如何使用 Search Contract 的搜索建议,数据源在本地。同时演示如何从输入法编辑器中获取相关信息
  3. *
  4. * SearchPane - 搜索面板
  5. * SuggestionsRequested - 用户的查询文本发生改变,app 需要提供新的建议时所触发的事件(事件参数 SearchPaneSuggestionsRequestedEventArgs)
  6. * QuerySubmitted - 提交搜索面板的搜索框中的文本时所触发的事件
  7. *
  8. * SearchPaneSuggestionsRequestedEventArgs - 当需要提供新的建议时所触发的事件
  9. * QueryText - 搜索文本
  10. * Request - 关于建议信息的对象,返回 SearchPaneSuggestionsRequest 类型的数据
  11. * SearchPaneQueryLinguisticDetails - 关于输入法编辑器信息(IME)的对象,返回 SearchPaneQueryLinguisticDetails 类型的数据
  12. *
  13. * SearchPaneSuggestionsRequest - 关于建议信息的对象
  14. * SearchSuggestionCollection - 搜索面板的搜索建议集合
  15. * Size - 搜索建议的数量,最多只支持 5 个元素,就算超过 5 个系统也只会显示前 5 个
  16. * AppendQuerySuggestion() & AppendQuerySuggestions() - 将指定的建议信息添加到搜索面板的建议集合中
  17. *
  18. * SearchPaneQueryLinguisticDetails - 关于输入法编辑器(IME - Input Method Editor)信息的对象
  19. * QueryTextAlternatives - 当前查询文本 IME 中的全部可能的文本列表
  20. * QueryTextCompositionLength - 当前在 IME 中输入的查询文本的长度
  21. * QueryTextCompositionStart - 当前在 IME 中输入的查询文本在整个查询字符串中的起始位置
  22. */
  23.  
  24. using System;
  25. using Windows.ApplicationModel.Search;
  26. using Windows.UI.Xaml;
  27. using Windows.UI.Xaml.Controls;
  28. using Windows.UI.Xaml.Navigation;
  29.  
  30. namespace XamlDemo.Contracts.SearchContract
  31. {
  32. public sealed partial class LocalSuggestion : Page
  33. {
  34. private SearchPane _searchPane;
  35.  
  36. private static readonly string[] suggestionList =
  37. {
  38. "beijing", "北京", "beiji", "北极", "shanghai", "上海", "tianjin", "天津", "chongqing", "重庆"
  39. };
  40.  
  41. public LocalSuggestion()
  42. {
  43. this.InitializeComponent();
  44. }
  45.  
  46. protected override void OnNavigatedTo(NavigationEventArgs e)
  47. {
  48. // 获取当前的 SearchPane,并注册相关事件
  49. _searchPane = SearchPane.GetForCurrentView();
  50. _searchPane.SuggestionsRequested += _searchPane_SuggestionsRequested;
  51. _searchPane.QuerySubmitted += _searchPane_QuerySubmitted;
  52. }
  53.  
  54. protected override void OnNavigatedFrom(NavigationEventArgs e)
  55. {
  56. // 取消相关事件的监听
  57. _searchPane.SuggestionsRequested -= _searchPane_SuggestionsRequested;
  58. _searchPane.QuerySubmitted -= _searchPane_QuerySubmitted;
  59. }
  60.  
  61. void _searchPane_SuggestionsRequested(SearchPane sender, SearchPaneSuggestionsRequestedEventArgs args)
  62. {
  63. if (!string.IsNullOrEmpty(args.QueryText))
  64. {
  65. // 根据用户当前的输入法编辑器中的内容,在建议列表中显示相关建议
  66. foreach (string alternative in args.LinguisticDetails.QueryTextAlternatives)
  67. {
  68. foreach (string suggestion in suggestionList)
  69. {
  70. if (suggestion.StartsWith(alternative, StringComparison.CurrentCultureIgnoreCase))
  71. {
  72. args.Request.SearchSuggestionCollection.AppendQuerySuggestion(suggestion);
  73.  
  74. // 建议列表最多只支持 5 个元素,超过 5 个也只会显示前 5 个
  75. if (args.Request.SearchSuggestionCollection.Size >= )
  76. break;
  77. }
  78. }
  79. }
  80.  
  81. // 根据用户的当前输入,在建议列表中显示相关建议(不考虑输入法编辑器中的内容)
  82. foreach (string suggestion in suggestionList)
  83. {
  84. if (suggestion.StartsWith(args.QueryText, StringComparison.CurrentCultureIgnoreCase))
  85. {
  86. args.Request.SearchSuggestionCollection.AppendQuerySuggestion(suggestion);
  87.  
  88. // 建议列表最多只支持 5 个元素,超过 5 个也只会显示前 5 个
  89. if (args.Request.SearchSuggestionCollection.Size >= )
  90. break;
  91. }
  92. }
  93. }
  94. }
  95.  
  96. void _searchPane_QuerySubmitted(SearchPane sender, SearchPaneQuerySubmittedEventArgs args)
  97. {
  98. lblMsg.Text = args.QueryText;
  99. }
  100. }
  101. }

3、本例演示如何使用 Search Contract 的搜索建议,数据源在服务端。同时演示如何为搜索建议增加图标、描述等
Contracts/SearchContract/RemoteSuggestion.xaml

  1. <Page
  2. x:Class="XamlDemo.Contracts.SearchContract.RemoteSuggestion"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo.Contracts.SearchContract"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11. <StackPanel Margin="120 0 0 0">
  12.  
  13. <TextBlock Name="lblMsg" FontSize="14.667" Text="本例演示如何使用 Search Contract 的搜索建议,数据源在服务端。同时演示如何为搜索建议增加图标、描述等" />
  14.  
  15. </StackPanel>
  16. </Grid>
  17. </Page>

Contracts/SearchContract/RemoteSuggestion.xaml.cs

  1. /*
  2. * 本例演示如何使用 Search Contract 的搜索建议,数据源在服务端。同时演示如何为搜索建议增加图标、描述等
  3. *
  4. * SearchPane - 搜索面板
  5. * SuggestionsRequested - 用户的查询文本发生改变,app 需要提供新的建议时所触发的事件(事件参数 SearchPaneSuggestionsRequestedEventArgs)
  6. * ResultSuggestionChosen - 提交搜索建议对象时所触发的事件(除了查询文本,还有图标和描述信息的)
  7. * 这里所谓的搜索建议对象就是通过 AppendResultSuggestion(string text, string detailText, string tag, IRandomAccessStreamReference image, string imageAlternateText) 构造的搜索建议
  8. * QuerySubmitted - 提交搜索字符串时所触发的事件(只有文本信息的)
  9. *
  10. * SearchPaneSuggestionsRequestedEventArgs - 当需要提供新的建议时所触发的事件
  11. * QueryText - 搜索文本
  12. * Request - 关于建议信息的对象,返回 SearchPaneSuggestionsRequest 类型的数据
  13. * SearchPaneQueryLinguisticDetails - 关于输入法编辑器信息(IME)的对象,返回 SearchPaneQueryLinguisticDetails 类型的数据
  14. *
  15. * SearchPaneSuggestionsRequest - 关于建议信息的对象
  16. * SearchSuggestionCollection - 搜索面板的搜索建议集合
  17. * Size - 搜索建议的数量,最多只支持 5 个元素,就算超过 5 个系统也只会显示前 5 个
  18. * AppendQuerySuggestion() & AppendQuerySuggestions() - 将指定的建议信息添加到搜索面板的建议集合中
  19. * AppendSearchSeparator() - 添加一个分割,可以指定分隔符左侧的文本
  20. * AppendResultSuggestion(string text, string detailText, string tag, IRandomAccessStreamReference image, string imageAlternateText) - 增加一个搜索建议对象
  21. * text - 建议结果的文本
  22. * detailText - 描述
  23. * tag - 附加数据,可以在 ResultSuggestionChosen 事件的事件参数中获取此值
  24. * image - 图标
  25. * imageAlternateText - 图像的替换文字
  26. * GetDeferral() - 获取异步操作对象,同时开始异步操作,之后通过 Complete() 通知完成异步操作
  27. */
  28.  
  29. using System;
  30. using System.Net.Http;
  31. using System.Threading.Tasks;
  32. using Windows.ApplicationModel.Search;
  33. using Windows.Data.Json;
  34. using Windows.Storage.Streams;
  35. using Windows.UI.Xaml.Controls;
  36. using Windows.UI.Xaml.Navigation;
  37.  
  38. namespace XamlDemo.Contracts.SearchContract
  39. {
  40. public sealed partial class RemoteSuggestion : Page
  41. {
  42. private SearchPane _searchPane;
  43.  
  44. // 用于获取远程建议的 HttpClient
  45. private HttpClient _httpClient;
  46. // 当前的 HttpClient 请求任务
  47. private Task<string> _currentHttpTask;
  48.  
  49. public RemoteSuggestion()
  50. {
  51. this.InitializeComponent();
  52. }
  53.  
  54. protected override void OnNavigatedTo(NavigationEventArgs e)
  55. {
  56. // 获取当前的 SearchPane,并注册相关事件
  57. _searchPane = SearchPane.GetForCurrentView();
  58. _searchPane.SuggestionsRequested += _searchPane_SuggestionsRequested;
  59.  
  60. // 如果用户提交的搜索数据是通过 AppendResultSuggestion(string text, string detailText, string tag, IRandomAccessStreamReference image, string imageAlternateText) 而来的,则触发此事件
  61. _searchPane.ResultSuggestionChosen += _searchPane_ResultSuggestionChosen;
  62.  
  63. // 如果用户提交的搜索数据是字符串,则触发此事件
  64. _searchPane.QuerySubmitted += _searchPane_QuerySubmitted;
  65.  
  66. _httpClient = new HttpClient();
  67. }
  68.  
  69. protected override void OnNavigatedFrom(NavigationEventArgs e)
  70. {
  71. // 取消相关事件的监听
  72. _searchPane.SuggestionsRequested -= _searchPane_SuggestionsRequested;
  73. _searchPane.ResultSuggestionChosen -= _searchPane_ResultSuggestionChosen;
  74. _searchPane.QuerySubmitted -= _searchPane_QuerySubmitted;
  75.  
  76. if (_httpClient != null)
  77. {
  78. _httpClient.Dispose();
  79. _httpClient = null;
  80. }
  81. }
  82.  
  83. async void _searchPane_SuggestionsRequested(SearchPane sender, SearchPaneSuggestionsRequestedEventArgs args)
  84. {
  85. // 异步操作
  86. var deferral = args.Request.GetDeferral();
  87.  
  88. try
  89. {
  90. // 根据用户的输入,从远程获取建议列表
  91. Task task = GetTaobaoSuggestionsAsync("http://suggest.taobao.com/sug?extras=1&code=utf-8&q=" + args.QueryText, args.Request.SearchSuggestionCollection);
  92. await task;
  93.  
  94. lblMsg.Text = "TaskStatus: " + task.Status.ToString();
  95. }
  96. finally
  97. {
  98. // 完成异步操作
  99. deferral.Complete();
  100. }
  101. }
  102.  
  103. void _searchPane_ResultSuggestionChosen(SearchPane sender, SearchPaneResultSuggestionChosenEventArgs args)
  104. {
  105. lblMsg.Text = "ResultSuggestionChosen: " + args.Tag;
  106. }
  107.  
  108. void _searchPane_QuerySubmitted(SearchPane sender, SearchPaneQuerySubmittedEventArgs args)
  109. {
  110. lblMsg.Text = "QuerySubmitted: " + args.QueryText;
  111. }
  112.  
  113. private async Task GetTaobaoSuggestionsAsync(string str, SearchSuggestionCollection suggestions)
  114. {
  115. // 取消之前的 HttpClient 请求任务
  116. if (_currentHttpTask != null)
  117. _currentHttpTask.AsAsyncOperation<string>().Cancel();
  118.  
  119. // 新建一个 HttpClient 请求任务,以从远程获取建议列表数据
  120. _currentHttpTask = _httpClient.GetStringAsync(str);
  121. string response = await _currentHttpTask;
  122.  
  123. // 将获取到的数据放到建议列表中
  124. JsonObject jb = JsonObject.Parse(response);
  125. var ary = jb["result"].GetArray();
  126. foreach (JsonValue jv in ary)
  127. {
  128. // 图文方式显示建议数据
  129. RandomAccessStreamReference imageStreamRef = RandomAccessStreamReference.CreateFromUri(new Uri("ms-appx:///Assets/Logo.png", UriKind.Absolute));
  130. suggestions.AppendResultSuggestion(jv.GetArray()[].GetString(), "detailText", jv.GetArray()[].GetString(), imageStreamRef, "imageAlternateText");
  131. suggestions.AppendSearchSeparator("separator");
  132.  
  133. // 建议列表最多只支持 5 个元素,超过 5 个也只会显示前 5 个
  134. if (suggestions.Size >= )
  135. break;
  136. }
  137. }
  138. }
  139. }

4、本例演示如何使用 Search Contract 的基于本地文件的搜索建议,数据来源于文件的 metadata
Contracts/SearchContract/LocalFileSuggestion.xaml

  1. <Page
  2. x:Class="XamlDemo.Contracts.SearchContract.LocalFileSuggestion"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:local="using:XamlDemo.Contracts.SearchContract"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. mc:Ignorable="d">
  9.  
  10. <Grid Background="Transparent">
  11. <StackPanel Margin="120 0 0 0">
  12.  
  13. <TextBlock Name="lblMsg" FontSize="14.667" Text="本例演示如何使用 Search Contract 的基于本地文件的搜索建议,数据来源于文件的 metadata" />
  14.  
  15. </StackPanel>
  16. </Grid>
  17. </Page>

Contracts/Sear0chContract/LocalFileSuggestion.xaml.cs

  1. /*
  2. * 本例演示如何使用 Search Contract 的基于本地文件的搜索建议,数据来源于文件的 metadata
  3. *
  4. * SearchPane - 搜索面板
  5. * SetLocalContentSuggestionSettings() - 指定一个 LocalContentSuggestionSettings 对象,以实现基于本地文件的搜索建议
  6. *
  7. * LocalContentSuggestionSettings - 基于本地文件的搜索建议的相关配置
  8. * Enabled - 是否启用
  9. * Locations - 搜索路径
  10. * AqsFilter - AQS 字符串,参见 http://msdn.microsoft.com/zh-cn/library/windows/apps/aa965711.aspx
  11. * PropertiesToMatch - 用于提供搜索建议的文件属性列表,默认会使用所有可用的文件属性
  12. *
  13. *
  14. * 注:AQS 全称 Advanced Query Syntax
  15. */
  16.  
  17. using Windows.ApplicationModel.Search;
  18. using Windows.Storage;
  19. using Windows.UI.Xaml.Controls;
  20. using Windows.UI.Xaml.Navigation;
  21.  
  22. namespace XamlDemo.Contracts.SearchContract
  23. {
  24. public sealed partial class LocalFileSuggestion : Page
  25. {
  26. public LocalFileSuggestion()
  27. {
  28. this.InitializeComponent();
  29. }
  30.  
  31. protected override void OnNavigatedTo(NavigationEventArgs e)
  32. {
  33. // 实例化 LocalContentSuggestionSettings
  34. var settings = new LocalContentSuggestionSettings();
  35. settings.Enabled = true;
  36.  
  37. // 指定需要搜索的文件夹为 KnownFolders.MusicLibrary(需要在 Package.appxmanifest 的“功能”中选中“音乐库”)
  38. settings.Locations.Add(KnownFolders.MusicLibrary);
  39.  
  40. // 在当前的 SearchPane 中启用指定的 LocalContentSuggestionSettings
  41. SearchPane.GetForCurrentView().SetLocalContentSuggestionSettings(settings);
  42. }
  43. }
  44. }

OK
[源码下载]

重新想象 Windows 8 Store Apps (38) - 契约: Search Contract的更多相关文章

  1. 重新想象 Windows 8 Store Apps (37) - 契约: Settings Contract

    [源码下载] 重新想象 Windows 8 Store Apps (37) - 契约: Settings Contract 作者:webabcd 介绍重新想象 Windows 8 Store Apps ...

  2. 重新想象 Windows 8 Store Apps (39) - 契约: Share Contract

    [源码下载] 重新想象 Windows 8 Store Apps (39) - 契约: Share Contract 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之  ...

  3. 重新想象 Windows 8 Store Apps 系列文章索引

    [源码下载][重新想象 Windows 8.1 Store Apps 系列文章] 重新想象 Windows 8 Store Apps 系列文章索引 作者:webabcd 1.重新想象 Windows ...

  4. 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo

    [源码下载] 重新想象 Windows 8 Store Apps (34) - 通知: Toast Demo, Tile Demo, Badge Demo 作者:webabcd 介绍重新想象 Wind ...

  5. 重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解

    [源码下载] 重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 通知 Toa ...

  6. 重新想象 Windows 8 Store Apps (36) - 通知: Tile 详解

    [源码下载] 重新想象 Windows 8 Store Apps (36) - 通知: Tile 详解 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 通知 Tile ...

  7. 重新想象 Windows 8 Store Apps (40) - 剪切板: 复制/粘贴文本, html, 图片, 文件

    [源码下载] 重新想象 Windows 8 Store Apps (40) - 剪切板: 复制/粘贴文本, html, 图片, 文件 作者:webabcd 介绍重新想象 Windows 8 Store ...

  8. 重新想象 Windows 8 Store Apps (41) - 打印

    [源码下载] 重新想象 Windows 8 Store Apps (41) - 打印 作者:webabcd 介绍重新想象 Windows 8 Store Apps 之 打印 示例1.需要打印的文档Pr ...

  9. 重新想象 Windows 8 Store Apps (42) - 多线程之线程池: 延迟执行, 周期执行, 在线程池中找一个线程去执行指定的方法

    [源码下载] 重新想象 Windows 8 Store Apps (42) - 多线程之线程池: 延迟执行, 周期执行, 在线程池中找一个线程去执行指定的方法 作者:webabcd 介绍重新想象 Wi ...

随机推荐

  1. .net微信公众号开发——模板消息

    作者:王先荣    本文介绍微信公众号中的模板消息,包括以下内容:(1)TemplateMessage类简介:(2)设置所属行业:(3)获得模板id:(4)发送模板消息:(5)接收推送模板消息发送结果 ...

  2. 消息中间件的技术选型心得-RabbitMQ、ActiveMQ和ZeroMQ

    消息中间件的技术选型心得-RabbitMQ.ActiveMQ和ZeroMQ 作者:chszs,转载需注明.博客主页:http://blog.csdn.net/chszs RabbitMQ.Active ...

  3. 云计算的三层SPI模型

    (转自:http://hi.baidu.com/fengjun8216/item/b15bbef4dcf74049922af27b) 一般而言,云计算架构可以用三层SPI模型来表述. 一.基础设施即服 ...

  4. OpenSSL Command-Line HOWTO

    OpenSSL Command-Line HOWTO The openssl application that ships with the OpenSSL libraries can perform ...

  5. C++中实现回调机制的几种方式[转]

      (1)Callback方式Callback的本质是设置一个函数指针进去,然后在需要需要触发某个事件时调用该方法, 比如Windows的窗口消息处理函数就是这种类型. 比如下面的示例代码,我们在Do ...

  6. kail2在虚拟机上的安装

    首先先要安装虚拟机,打开安装包,下一步               选择典型 选择要安装到的目录,点下一步 4 输入密钥,下一步(密钥网上有很多我这边就例举一个,没用的话就自己找.我这个密钥是VM11 ...

  7. Apache2.4中开通HTTP基本认证

    Apache2.4中开通HTTP基本认证,需要在Apache的配置文件中增加如下代码 WSGIPassAuthorization On 否则则无法认证

  8. .net和java和谐相处之安卓客户端+.net asp.net mvc webapi 2

    作为没有花很多时间转java,把java当C#用的我,在做服务器端程序的时候,自然不想考虑java web,java需要学的框架太多了,看了一下Java Servlet,始终没有编码的冲动.经过几天的 ...

  9. WebKit中的Chrome 和 ChromeClient

    原文地址:http://blog.csdn.net/dlmu2001/article/details/6208241 摘要: 浏览器的GUI接口分成两种,一种是控件的绘制,另一种则是同应用息息相关的窗 ...

  10. AssetBundle系列——场景资源之打包(一)

    本篇讲解的是3D游戏的场景资源打包方式,首先简单的分析一下场景中所包含的资源的类型. 场景资源一般包含:地表模型(或者是Unity Terrain),非实例化物体(摄像机.空气墙.光源.各种逻辑物体之 ...