Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
动作搜索结果对象
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Quicker.Public.Entities
{
/// <summary>
/// 通用条目
/// </summary>
public class CommonOperationItem
{
/// <summary>
/// 标题文字,用于显示
/// </summary>
public string Title { get; set; }
/// <summary>
/// 描述文字,通常显示为tooltip
/// </summary>
public string Description { get; set; }
/// <summary>
/// 图标,格式请参考文档说明。
/// </summary>
public string Icon { get; set; }
/// <summary>
/// 数据内容
/// </summary>
public string Data { get; set; }
/// <summary>
/// 内部数据类型
/// </summary>
public string DataType { get; set; }
/// <summary>
/// 通常用于保存对Data内容的操作类型。
/// <see cref="CommonOperationTypes">通用操作类型</see>
/// </summary>
public string Operation { get; set; }
/// <summary>
/// 要触发的动作id或名称
/// </summary>
public string Action { get; set; }
/// <summary>
/// 是否是分隔线
/// </summary>
public bool IsSeparator { get; set; }
/// <summary>
/// 扩展数据
/// </summary>
public IDictionary<string, object> ExtraData { get; set; }
/// <summary>
/// 子项,也可做子菜单使用
/// </summary>
public IList<CommonOperationItem> Children { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Quicker.Public.Searching
{
/// <summary>
/// 自定义搜索结果
/// </summary>
public class CustomSearchResult
{
/// <summary>
/// 结果项
/// </summary>
public IList<CustomSearchResultItem> Items { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quicker.Public.Entities;
namespace Quicker.Public.Searching
{
/// <summary>
/// 自定义搜索结果项
/// </summary>
public class CustomSearchResultItem: CommonOperationItem
{
/// <summary>
/// 匹配度评分
/// </summary>
public int Score { get; set; }
/// <summary>
/// 是否不隐藏搜索框
/// </summary>
public bool NoHide { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment