├── .gitattributes ├── .gitignore ├── DllExport.bat ├── LICENSE ├── Lib └── Newtonsoft.Json.dll ├── Native.sln ├── README.en.md ├── README.md ├── me.cqp.luohuaming.WordCloud.Code ├── DrawGroupRank.cs ├── DrawWordChart.cs ├── DrawWordCloud.cs ├── Event_GroupMessage.cs ├── Event_PrivateMessage.cs ├── Event_StartUp.cs ├── OrderFunctions │ ├── DrawAnyCloud.cs │ ├── DrawAnyMonthCloud.cs │ ├── DrawAnyYearCloud.cs │ ├── DrawLastMonthCloud.cs │ ├── DrawLastWeekCloud.cs │ ├── DrawLastYearCloud.cs │ ├── DrawMonthCloud.cs │ ├── DrawPersonalAnyMonthCloud.cs │ ├── DrawPersonalAnyYearCloud.cs │ ├── DrawPersonalLastMonthCloud.cs │ ├── DrawPersonalLastWeekCloud.cs │ ├── DrawPersonalLastYearCloud.cs │ ├── DrawPersonalMonthCloud.cs │ ├── DrawPersonalTodayCloud.cs │ ├── DrawPersonalWeekCloud.cs │ ├── DrawPersonalYearCloud.cs │ ├── DrawPersonalYesterdayCloud.cs │ ├── DrawTodayCloud.cs │ ├── DrawTodayRank.cs │ ├── DrawWeekCloud.cs │ ├── DrawYearCloud.cs │ ├── DrawYesterdayCloud.cs │ ├── ExampleFunction.cs │ └── RecordMsg.cs ├── Properties │ └── AssemblyInfo.cs ├── WordCloudSharp.dll ├── app.config ├── me.cqp.luohuaming.WordCloud.Code.csproj └── packages.config ├── me.cqp.luohuaming.WordCloud.CodeTests ├── App.config ├── DrawWordCloudTests.cs ├── Event_GroupMessageTests.cs ├── Properties │ └── AssemblyInfo.cs ├── me.cqp.luohuaming.WordCloud.CodeTests.csproj └── packages.config ├── me.cqp.luohuaming.WordCloud.Core ├── CQMain.cs ├── Domain │ └── AppData.cs ├── Export │ ├── CQEventExport.cs │ ├── CQExport.tt │ ├── CQMenuExport.cs │ └── CQStatusExport.cs ├── FodyWeavers.xml ├── FodyWeavers.xsd ├── MainExport.cs ├── Properties │ └── AssemblyInfo.cs ├── app.config ├── app.json ├── me.cqp.luohuaming.WordCloud.Core.csproj └── packages.config ├── me.cqp.luohuaming.WordCloud.PublicInfos ├── App.config ├── CloudConfig.cs ├── CommonHelper.cs ├── FunctionResult.cs ├── MainSave.cs ├── Model │ └── Record.cs ├── Models.cs ├── Properties │ └── AssemblyInfo.cs ├── SQLHelper.cs ├── me.cqp.luohuaming.WordCloud.PublicInfos.csproj └── packages.config ├── me.cqp.luohuaming.WordCloud.Sdk ├── Cqp │ ├── CQApi.cs │ ├── CQLog.cs │ ├── Core │ │ ├── CQP.cs │ │ └── Kernel32.cs │ ├── Enum │ │ ├── CQAudioFormat.cs │ │ ├── CQDiscussMessageType.cs │ │ ├── CQFace.cs │ │ ├── CQFloatWindowColors.cs │ │ ├── CQFriendAddRequestType.cs │ │ ├── CQFriendAddType.cs │ │ ├── CQFunction.cs │ │ ├── CQGroupAddRequestType.cs │ │ ├── CQGroupBanSpeakType.cs │ │ ├── CQGroupFileUploadType.cs │ │ ├── CQGroupManageChangeType.cs │ │ ├── CQGroupMemberDecreaseType.cs │ │ ├── CQGroupMemberIncreaseType.cs │ │ ├── CQGroupMessageType.cs │ │ ├── CQLogLevel.cs │ │ ├── CQMessageEventType.cs │ │ ├── CQMessageHandler.cs │ │ ├── CQMusicStyle.cs │ │ ├── CQMusicType.cs │ │ ├── CQPrviateMessageType.cs │ │ ├── CQResponseType.cs │ │ ├── QQGroupMemberType.cs │ │ └── QQSex.cs │ ├── EventArgs │ │ ├── CQAppDisableEventArgs.cs │ │ ├── CQAppEnableEventArgs.cs │ │ ├── CQDiscussMessageEventArgs.cs │ │ ├── CQEventArgs.cs │ │ ├── CQEventEventArgs.cs │ │ ├── CQExitEventArgs.cs │ │ ├── CQFriendAddEventArgs.cs │ │ ├── CQFriendAddRequestEventArgs.cs │ │ ├── CQGroupAddRequestEventArgs.cs │ │ ├── CQGroupBanSpeakEventArgs.cs │ │ ├── CQGroupManageChangeEventArgs.cs │ │ ├── CQGroupMemberDecreaseEventArgs.cs │ │ ├── CQGroupMemberIncreaseEventArgs.cs │ │ ├── CQGroupMessageEventArgs.cs │ │ ├── CQGroupUploadEventArgs.cs │ │ ├── CQMenuCallEventArgs.cs │ │ ├── CQMenuEventArgs.cs │ │ ├── CQPrivateMessageEventArgs.cs │ │ ├── CQStartupEventArgs.cs │ │ ├── CQStatusEventArgs.cs │ │ └── CQStatusUpdateEventArgs.cs │ ├── Expand │ │ ├── BinaryReaderExpand.cs │ │ ├── BinaryWriterExpand.cs │ │ └── SystemExpand.cs │ ├── Interface │ │ ├── IAppDisable.cs │ │ ├── IAppEnable.cs │ │ ├── ICQExit.cs │ │ ├── ICQStartup.cs │ │ ├── IDiscussMessage.cs │ │ ├── IFriendAdd.cs │ │ ├── IFriendAddRequest.cs │ │ ├── IGroupAddRequest.cs │ │ ├── IGroupBanSpeak.cs │ │ ├── IGroupManageChange.cs │ │ ├── IGroupMemberDecrease.cs │ │ ├── IGroupMemberIncrease.cs │ │ ├── IGroupMessage.cs │ │ ├── IGroupUpload.cs │ │ ├── IMenuCall.cs │ │ ├── IPrivateMessage.cs │ │ ├── IStatusUpdate.cs │ │ └── IToSendString.cs │ └── Model │ │ ├── AppInfo.cs │ │ ├── BasisModel.cs │ │ ├── BasisStreamModel.cs │ │ ├── CQCode.cs │ │ ├── CQFloatWindow.cs │ │ ├── Discuss.cs │ │ ├── FriendInfo.cs │ │ ├── FriendInfoCollection.cs │ │ ├── Group.cs │ │ ├── GroupFileInfo.cs │ │ ├── GroupInfo.cs │ │ ├── GroupInfoCollection.cs │ │ ├── GroupMemberAnonymousInfo.cs │ │ ├── GroupMemberInfo.cs │ │ ├── GroupMemberInfoCollection.cs │ │ ├── QQ.cs │ │ ├── QQMessage.cs │ │ ├── QQRequest.cs │ │ └── StrangerInfo.cs ├── Properties │ └── AssemblyInfo.cs └── me.cqp.luohuaming.WordCloud.Sdk.csproj ├── me.cqp.luohuaming.WordCloud.Tool ├── Http │ ├── HttpTool.cs │ └── HttpWebClient.cs ├── IniConfig │ ├── Attribute │ │ ├── IniConfigKeyAttribute.cs │ │ ├── IniConfigSectionAttribute.cs │ │ ├── IniKeyAttribute.cs │ │ ├── IniNonSerializeAttribute.cs │ │ ├── IniSectionAttribute.cs │ │ └── IniSerializeAttribute.cs │ ├── Exception │ │ ├── IniConfigException.cs │ │ ├── PropertyNotFoundException.cs │ │ └── SectionNotFoundException.cs │ ├── IniConfig.cs │ ├── IniConvert.cs │ ├── Linq │ │ ├── IContainer.cs │ │ ├── IObject.cs │ │ ├── ISection.cs │ │ ├── IValue.cs │ │ ├── IValueType.cs │ │ ├── IniObject.cs │ │ ├── IniSection.cs │ │ └── IniValue.cs │ ├── README.md │ └── Utilities │ │ ├── ConvertUtils.cs │ │ ├── MathUtils.cs │ │ ├── MiscellaneousUtils.cs │ │ └── ReflectionUtils.cs ├── Properties │ └── AssemblyInfo.cs └── me.cqp.luohuaming.WordCloud.Tool.csproj └── me.cqp.luohuaming.WordCloud.UI ├── App.config ├── App.xaml ├── App.xaml.cs ├── Event_MenuCall.cs ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Properties ├── AssemblyInfo.cs ├── Resources.Designer.cs ├── Resources.resx ├── Settings.Designer.cs └── Settings.settings └── me.cqp.luohuaming.WordCloud.UI.csproj /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text= 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /Lib/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hellobaka/WordCloud/c5f92271bf3c7b04c09b726dd9a669b18848fbe3/Lib/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # BotDevelopmentFramework 2 | 3 | #### Description 4 | CQ机器人开发白框架 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordCloud 2 | 3 | ## 介绍 4 | 词云插件, 使用了Jieba.Net以及[WordCloudSharp词云库](https://github.com/AmmRage/WordCloudSharp) 5 | 6 | ## 使用流程 7 | 以下提及的所有文件均在[1.0.0](https://github.com/Hellobaka/WordCloud/releases/tag/1.0.0) 8 | 1. 下载插件 9 | 2. 解压`jieba.zip`到数据目录下(`me.cqp.luohuaming.WordCloud`) 10 | 文件夹结构: 11 | ``` 12 | │ Config.ini 13 | │ data.db 14 | └─ jieba 15 | char_state_tab.json 16 | cn_synonym.txt 17 | dict.txt 18 | idf.txt 19 | pos_prob_emit.json 20 | pos_prob_start.json 21 | pos_prob_trans.json 22 | prob_emit.json 23 | prob_trans.json 24 | stopwords.txt 25 | ``` 26 | 3. 挂机一段时间,待群内有足够多的消息 27 | 4. `今[日|天]词云` => 今天的词云 28 | 5. `昨[日|天]词云` => 昨天的词云 29 | 6. 更多指令见配置文件 30 | 6. `词云 yyyy-M-d` => 任意日期的词云 31 | 32 | ## 数据库配置 33 | - Mirai-Native框架用户: 34 | > 下载 System.Data.SQLite.dll 与 SQLite.Interop.dll 文件 放入mirai根目录的 jre\bin 中 35 | 36 | - 其他框架用户: 37 | > 下载 System.Data.SQLite.dll 与 SQLite.Interop.dll 文件 放在框架主体exe下即可 38 | 39 | ## 交流群 40 | 671467200 41 | 42 | ## 配置字段 43 | ```ini 44 | ;请不要直接把这段文本直接粘贴到文件内,需要什么字段就复制什么字段,警 惕 空 格 45 | ;路径均支持相对路径 相对于数据目录 46 | ;除了 CycleSwitch 以及 Interval 之外, 所有配置更改后立即生效 47 | [Config] 48 | ImageWidth=500 ;词云图片的宽度 49 | ImageHeight=500 ;词云图片的高度 50 | MaskPath=mask.png ;遮罩图片的路径 必须黑白 51 | WordNum=50 ;最大词数量 52 | Font=75W.ttf ;自定义字体路径 也可以是系统内字体名称 53 | FilterWord=http|www ;过滤词,使用 | 分割 54 | SendTmpMsg=词云合成中…… ;触发功能之后的提示文本,需要at用户请加上 <@> 55 | MatchMode=0 ;指令的触发模式, 但只针对于下面两个可自定义的指令生效, 默认为正则模式. 0 => 正则, 指令必须符合正则的语法. 1 => 模糊匹配, 消息中包含指令将会触发. 2 => 完全匹配 56 | TodayCloudOrder=^今[日|天]词云$ ;这是一个正则的例子, 在你不配置这个字段时, 默认也是这个 57 | YesterdayCloudOrder=^昨[日|天]词云$ 58 | LastWeekCloudOrder=^上个?周词云$ 59 | WeekCloudOrder=^[这|本]个?周词云$ 60 | LastMonthCloudOrder=^上个?月词云$ 61 | MonthCloudOrder=^[这|本]个?月词云$ 62 | YearCloudOrder=^[这|本]个?年词云$ 63 | PersonalWeekOrder=^(我的)?(个人)?本周词云$ 64 | PersonalTodayOrder=^(我的)?(个人)?今[日|天]词云$ 65 | PersonalMonthOrder=^(我的)?(个人)?[这|本]个?月词云$ 66 | PersonalYearOrder=^(我的)?(个人)?[这|本]个?年词云$ 67 | PersonalLastWeekOrder=^(我的)?(个人)?上个?周词云$ 68 | PersonalYesterdayOrder=^(我的)?(个人)?昨[日|天]词云$ 69 | PersonalLastMonthOrder=^(我的)?(个人)?上个?月词云$ 70 | AnyYearCloudOrder=^(20\d{2})年词云$ ;绘制任意年份的词云,此指令只会进行正则模式处理 71 | AnyMonthCloudOrder=^(20\d{2})-(\d{1,2})月词云$ 72 | PersonalAnyYearCloudOrder=^我的(20\d{2})年词云$ 73 | PersonalAnyMonthCloudOrder=^我的(20\d{2})-(\d{1,2})月词云$ 74 | LastYearCloudOrder=^去年词云$ 75 | PersonalLastYearOrder=^我的去年词云$ 76 | YearShowWordCount=10 ;设置个人以及群年度词云的总结词数量 77 | YearShowWordListMode=false ;设置总结词展示以列表或顿号分割的形式展示 78 | 79 | [Cycle] 80 | CycleSwitch=1 ;定时发送开关, 1 => 开启. 0 => 不开启. 不写默认为不开启 81 | CycleText=晚安!今日共收到个词汇,前三的词汇为:\n ;词云图片发送前的前导文本, 不写不会发送, 使用来表示记录了多少个词汇, 使用来表示这里罗列权重最高的前三个词汇 82 | CyclePersonText=今天共有位群友产生条发言,前三的群友是:\n 83 | CycleMode=1 ;定时发送时发送的词云类型. 1 => 今日词云. 0 => 昨日词云, 不写默认为昨日词云 84 | CycleTime=1970-01-01T23:58:00 ;定时生效的时间, 仅小时与分钟生效, 且必须是两位, 比如07:58:00. 其余位置改了也没用, 但是这个格式必须保留. 不写默认12点触发 85 | Interval=20000 ;时间判断周期, 单位ms, 请设定在10000-59000之间, 设定太小了会频繁打开此文件读取触发时间 86 | Delay=60000 ;每个定时发送后等待多长时间发送下一个, 单位ms 87 | 88 | ; 白名单优先级高于黑名单, 也就是说, 在白名单与黑名单均启用的情况下, 最终生效的是白名单 89 | ; 均不开启的时候, 默认也是生效白名单 90 | ; 白名单, 在开启白名单模式下, 只有白名单内的群才会启用功能 91 | [WhiteList] 92 | Groups=89****846|644****97 ;开启功能的群号, 使用 | 分割, 未加入的群将不会记录消息以及触发指令 93 | Switch=0 94 | 95 | ; 黑名单, 在开启黑名单模式下, 会跳过字段内的群号 96 | ; 广播词云时, 会获取群列表, 之后跳过黑名单的群进行广播 97 | [BlackList] 98 | Groups=89****846|644****97 99 | Switch=1 100 | 101 | ; 使用|分割每个QQ号 102 | ; 拦截的QQ号不能触发功能、记录发言 103 | [BlockList] 104 | QQID=114514|1919810 105 | ``` 106 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/Event_GroupMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 7 | using PublicInfos; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Code 10 | { 11 | public class Event_GroupMessage 12 | { 13 | public static FunctionResult GroupMessage(CQGroupMessageEventArgs e) 14 | { 15 | FunctionResult result = new FunctionResult() 16 | { 17 | SendFlag = false 18 | }; 19 | try 20 | { 21 | if (!GetCanCall(e.FromGroup, e.FromQQ)) 22 | return result; 23 | foreach (var item in MainSave.Instances.Where(item => item.Judge(e.Message.Text))) 24 | { 25 | return item.Progress(e); 26 | } 27 | return result; 28 | } 29 | catch (Exception exc) 30 | { 31 | MainSave.CQLog.Info("异常抛出", exc.Message + exc.StackTrace); 32 | return result; 33 | } 34 | } 35 | private static bool GetCanCall(long group, long QQ) 36 | { 37 | if (CloudConfig.BlockList.Any(x => x == QQ)) return false; 38 | if (CloudConfig.WhiteListSwitch) 39 | return CloudConfig.WhiteList.Any(x => x == group); 40 | else if (CloudConfig.BlackListSwitch) 41 | return !CloudConfig.BlackList.Any(x => x == group); 42 | else 43 | return CloudConfig.WhiteList.Any(x => x == group); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/Event_PrivateMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 7 | using PublicInfos; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Code 10 | { 11 | public class Event_PrivateMessage 12 | { 13 | public static FunctionResult PrivateMessage(CQPrivateMessageEventArgs e) 14 | { 15 | FunctionResult result = new FunctionResult() 16 | { 17 | SendFlag = false 18 | }; 19 | try 20 | { 21 | return result; 22 | } 23 | catch (Exception exc) 24 | { 25 | MainSave.CQLog.Info("异常抛出", exc.Message + exc.StackTrace); 26 | return result; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawAnyCloud.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 3 | using PublicInfos; 4 | using System; 5 | 6 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 7 | { 8 | public class DrawAnyCloud : IOrderModel 9 | { 10 | public bool ImplementFlag { get; set; } = true; 11 | 12 | public string GetOrderStr() => "词云 "; 13 | 14 | public bool Judge(string destStr) => destStr.StartsWith(GetOrderStr());//这里判断是否能触发指令 15 | 16 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 17 | { 18 | FunctionResult result = new FunctionResult 19 | { 20 | Result = true, 21 | SendFlag = true, 22 | }; 23 | SendText sendText = new SendText 24 | { 25 | SendID = e.FromGroup, 26 | }; 27 | if (DateTime.TryParseExact(e.Message.Text.Replace(GetOrderStr(), ""), "yyyy-M-d" 28 | , System.Globalization.CultureInfo.InvariantCulture 29 | ,System.Globalization.DateTimeStyles.None 30 | ,out DateTime dateTime)) 31 | { 32 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 33 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 34 | 35 | sendText.MsgToSend.Add(CQApi.CQCode_Image(DrawWordCloud.Draw(e.FromGroup, dateTime).CloudFilePath).ToSendString()); 36 | } 37 | else 38 | { 39 | sendText.MsgToSend.Add("请按照\"词云 2021-8-7\"的格式输入日期"); 40 | } 41 | result.SendObject.Add(sendText); 42 | return result; 43 | } 44 | 45 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 46 | { 47 | return new FunctionResult { Result = false, SendFlag = false }; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawAnyMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawAnyMonthCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.AnyMonthCloudOrder; 15 | 16 | public bool Judge(string destStr) => Regex.IsMatch(destStr, GetOrderStr()); 17 | 18 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 19 | { 20 | FunctionResult result = new FunctionResult 21 | { 22 | Result = true, 23 | SendFlag = true, 24 | }; 25 | SendText sendText = new SendText 26 | { 27 | SendID = e.FromGroup, 28 | }; 29 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 30 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 31 | string year = Regex.Match(e.Message.Text, GetOrderStr()).Groups[1].Value; 32 | int month = int.Parse(Regex.Match(e.Message.Text, GetOrderStr()).Groups[2].Value); 33 | if(month < 1 || month > 12) 34 | { 35 | sendText.MsgToSend.Add("月份输入错误,请输入1-12之间的数字"); 36 | result.SendObject.Add(sendText); 37 | return result; 38 | } 39 | DateTime dt = new DateTime(int.Parse(year), month, 1); 40 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1)); 41 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 42 | int count = CloudConfig.YearShowWordCount; 43 | if (count > 0) 44 | { 45 | statistics += $"\r\n前{count}的词汇为: "; 46 | if (CloudConfig.YearShowWordListMode) 47 | { 48 | statistics += "\r\n"; 49 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 50 | { 51 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 52 | } 53 | } 54 | else 55 | { 56 | statistics += string.Join("、", drawResult.Words.Take(count)); 57 | } 58 | } 59 | sendText.MsgToSend.Add(statistics); 60 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 61 | result.SendObject.Add(sendText); 62 | return result; 63 | } 64 | 65 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 66 | { 67 | return new FunctionResult { Result = false, SendFlag = false }; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawAnyYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawAnyYearCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.AnyYearCloudOrder; 15 | 16 | public bool Judge(string destStr) => Regex.IsMatch(destStr, GetOrderStr()); 17 | 18 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 19 | { 20 | FunctionResult result = new FunctionResult 21 | { 22 | Result = true, 23 | SendFlag = true, 24 | }; 25 | SendText sendText = new SendText 26 | { 27 | SendID = e.FromGroup, 28 | }; 29 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 30 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 31 | string capture = Regex.Match(e.Message.Text, GetOrderStr()).Groups[1].Value; 32 | DateTime dt = new DateTime(int.Parse(capture), 1, 1); 33 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddYears(1)); 34 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 35 | int count = CloudConfig.YearShowWordCount; 36 | if (count > 0) 37 | { 38 | statistics += $"\r\n前{count}的词汇为: "; 39 | if (CloudConfig.YearShowWordListMode) 40 | { 41 | statistics += "\r\n"; 42 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 43 | { 44 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 45 | } 46 | } 47 | else 48 | { 49 | statistics += string.Join("、", drawResult.Words.Take(count)); 50 | } 51 | } 52 | sendText.MsgToSend.Add(statistics); 53 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 54 | result.SendObject.Add(sendText); 55 | return result; 56 | } 57 | 58 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 59 | { 60 | return new FunctionResult { Result = false, SendFlag = false }; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawLastMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawLastMonthCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.LastMonthCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 31 | { 32 | FunctionResult result = new FunctionResult 33 | { 34 | Result = true, 35 | SendFlag = true, 36 | }; 37 | SendText sendText = new SendText 38 | { 39 | SendID = e.FromGroup, 40 | }; 41 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 42 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 43 | DateTime dt = new DateTime(DateTime.Now.AddMonths(-1).Year, DateTime.Now.AddMonths(-1).Month, 1); 44 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1)); 45 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddMonths(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 46 | sendText.MsgToSend.Add(statistics); 47 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 48 | result.SendObject.Add(sendText); 49 | return result; 50 | } 51 | 52 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 53 | { 54 | return new FunctionResult { Result = false, SendFlag = false }; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawLastWeekCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawLastWeekCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.LastWeekCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 31 | { 32 | FunctionResult result = new FunctionResult 33 | { 34 | Result = true, 35 | SendFlag = true, 36 | }; 37 | SendText sendText = new SendText 38 | { 39 | SendID = e.FromGroup, 40 | }; 41 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 42 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 43 | DateTime dt = DateTime.Now; 44 | for (int i = 0; i < 7; i++) 45 | { 46 | if (dt.DayOfWeek == DayOfWeek.Monday) 47 | break; 48 | dt = dt.AddDays(-1).AddDays(-7); 49 | } 50 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddDays(7)); 51 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddDays(7).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 52 | sendText.MsgToSend.Add(statistics); 53 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 54 | result.SendObject.Add(sendText); 55 | return result; 56 | } 57 | 58 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 59 | { 60 | return new FunctionResult { Result = false, SendFlag = false }; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawLastYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawLastYearCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.LastYearCloudOrder; 15 | 16 | public bool Judge(string destStr) 17 | { 18 | switch (CloudConfig.MatchMode) 19 | { 20 | case MatchMode.Regex: 21 | return Regex.IsMatch(destStr, GetOrderStr()); 22 | case MatchMode.Contain: 23 | return destStr.Contains(GetOrderStr()); 24 | case MatchMode.Full: 25 | return destStr.Trim() == GetOrderStr(); 26 | default: 27 | return false; 28 | } 29 | } 30 | 31 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 32 | { 33 | FunctionResult result = new FunctionResult 34 | { 35 | Result = true, 36 | SendFlag = true, 37 | }; 38 | SendText sendText = new SendText 39 | { 40 | SendID = e.FromGroup, 41 | }; 42 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 43 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 44 | DateTime dt = new DateTime(DateTime.Now.Year - 1, 1, 1); 45 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddYears(1)); 46 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 47 | int count = CloudConfig.YearShowWordCount; 48 | if (count > 0) 49 | { 50 | statistics += $"\r\n前{count}的词汇为: "; 51 | if (CloudConfig.YearShowWordListMode) 52 | { 53 | statistics += "\r\n"; 54 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 55 | { 56 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 57 | } 58 | } 59 | else 60 | { 61 | statistics += string.Join("、", drawResult.Words.Take(count)); 62 | } 63 | } 64 | sendText.MsgToSend.Add(statistics); 65 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 66 | result.SendObject.Add(sendText); 67 | return result; 68 | } 69 | 70 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 71 | { 72 | return new FunctionResult { Result = false, SendFlag = false }; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawMonthCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.MonthCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 31 | { 32 | FunctionResult result = new FunctionResult 33 | { 34 | Result = true, 35 | SendFlag = true, 36 | }; 37 | SendText sendText = new SendText 38 | { 39 | SendID = e.FromGroup, 40 | }; 41 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 42 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 43 | DateTime dt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); 44 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1)); 45 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{DateTime.Now.ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 46 | sendText.MsgToSend.Add(statistics); 47 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 48 | result.SendObject.Add(sendText); 49 | return result; 50 | } 51 | 52 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 53 | { 54 | return new FunctionResult { Result = false, SendFlag = false }; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalAnyMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawPersonalAnyMonthCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.PersonalAnyMonthCloudOrder; 15 | 16 | public bool Judge(string destStr) => Regex.IsMatch(destStr, GetOrderStr()); 17 | 18 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 19 | { 20 | FunctionResult result = new FunctionResult 21 | { 22 | Result = true, 23 | SendFlag = true, 24 | }; 25 | SendText sendText = new SendText 26 | { 27 | SendID = e.FromGroup, 28 | }; 29 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 30 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 31 | string year = Regex.Match(e.Message.Text, GetOrderStr()).Groups[1].Value; 32 | int month = int.Parse(Regex.Match(e.Message.Text, GetOrderStr()).Groups[2].Value); 33 | if(month < 1 || month > 12) 34 | { 35 | sendText.MsgToSend.Add("月份输入错误,请输入1-12之间的数字"); 36 | result.SendObject.Add(sendText); 37 | return result; 38 | } 39 | DateTime dt = new DateTime(int.Parse(year), month, 1); 40 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1), e.FromQQ); 41 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 42 | int count = CloudConfig.YearShowWordCount; 43 | if (count > 0) 44 | { 45 | statistics += $"\r\n前{count}的词汇为: "; 46 | if (CloudConfig.YearShowWordListMode) 47 | { 48 | statistics += "\r\n"; 49 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 50 | { 51 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 52 | } 53 | } 54 | else 55 | { 56 | statistics += string.Join("、", drawResult.Words.Take(count)); 57 | } 58 | } 59 | sendText.MsgToSend.Add(statistics); 60 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 61 | result.SendObject.Add(sendText); 62 | return result; 63 | } 64 | 65 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 66 | { 67 | return new FunctionResult { Result = false, SendFlag = false }; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalAnyYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawPersonalAnyYearCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.PersonalAnyYearCloudOrder; 15 | 16 | public bool Judge(string destStr) => Regex.IsMatch(destStr, GetOrderStr()); 17 | 18 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 19 | { 20 | FunctionResult result = new FunctionResult 21 | { 22 | Result = true, 23 | SendFlag = true, 24 | }; 25 | SendText sendText = new SendText 26 | { 27 | SendID = e.FromGroup, 28 | }; 29 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 30 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 31 | string capture = Regex.Match(e.Message.Text, GetOrderStr()).Groups[1].Value; 32 | DateTime dt = new DateTime(int.Parse(capture), 1, 1); 33 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddYears(1), e.FromQQ); 34 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 35 | int count = CloudConfig.YearShowWordCount; 36 | if (count > 0) 37 | { 38 | statistics += $"\r\n前{count}的词汇为: "; 39 | if (CloudConfig.YearShowWordListMode) 40 | { 41 | statistics += "\r\n"; 42 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 43 | { 44 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 45 | } 46 | } 47 | else 48 | { 49 | statistics += string.Join("、", drawResult.Words.Take(count)); 50 | } 51 | } 52 | sendText.MsgToSend.Add(statistics); 53 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 54 | result.SendObject.Add(sendText); 55 | return result; 56 | } 57 | 58 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 59 | { 60 | return new FunctionResult { Result = false, SendFlag = false }; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalLastMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalLastMonthCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalLastMonthOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = DateTime.Now.AddMonths(-1); 48 | dt = new DateTime(dt.Year, dt.Month, 1); 49 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1), e.FromQQ); 50 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddMonths(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 51 | sendText.MsgToSend.Add(statistics); 52 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 53 | result.SendObject.Add(sendText); 54 | return result; 55 | } 56 | 57 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 58 | { 59 | return new FunctionResult { Result = false, SendFlag = false }; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalLastWeekCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalLastWeekCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalLastWeekOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = DateTime.Now; 48 | for (int i = 0; i < 7; i++) 49 | { 50 | if (dt.DayOfWeek == DayOfWeek.Monday) 51 | break; 52 | dt = dt.AddDays(-1).AddDays(-7); 53 | } 54 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddDays(7), e.FromQQ); 55 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddDays(7).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 56 | sendText.MsgToSend.Add(statistics); 57 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 58 | result.SendObject.Add(sendText); 59 | return result; 60 | } 61 | 62 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 63 | { 64 | return new FunctionResult { Result = false, SendFlag = false }; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalLastYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalLastYearCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalLastYearOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = new DateTime(DateTime.Now.Year - 1, 1, 1); 48 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddYears(1), e.FromQQ); 49 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")} - {dt.AddYears(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 50 | int count = CloudConfig.YearShowWordCount; 51 | if (count > 0) 52 | { 53 | statistics += $"\r\n前{count}的词汇为: "; 54 | if (CloudConfig.YearShowWordListMode) 55 | { 56 | statistics += "\r\n"; 57 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 58 | { 59 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 60 | } 61 | } 62 | else 63 | { 64 | statistics += string.Join("、", drawResult.Words.Take(count)); 65 | } 66 | } 67 | sendText.MsgToSend.Add(statistics); 68 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 69 | result.SendObject.Add(sendText); 70 | return result; 71 | } 72 | 73 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 74 | { 75 | return new FunctionResult { Result = false, SendFlag = false }; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalMonthCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalMonthCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalMonthOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); 48 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddMonths(1), e.FromQQ); 49 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddMonths(1).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 50 | sendText.MsgToSend.Add(statistics); 51 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 52 | result.SendObject.Add(sendText); 53 | return result; 54 | } 55 | 56 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 57 | { 58 | return new FunctionResult { Result = false, SendFlag = false }; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalTodayCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalTodayCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalTodayOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | var drawResult = DrawWordCloud.Draw(e.FromGroup, DateTime.Now, e.FromQQ); 48 | sendText.MsgToSend.Add(e.FromQQ.CQCode_At().ToSendString()); 49 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 50 | result.SendObject.Add(sendText); 51 | return result; 52 | } 53 | 54 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 55 | { 56 | return new FunctionResult { Result = false, SendFlag = false }; 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalWeekCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalWeekCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalWeekOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = DateTime.Now; 48 | for (int i = 0; i < 7; i++) 49 | { 50 | if (dt.DayOfWeek == DayOfWeek.Monday) 51 | break; 52 | dt = dt.AddDays(-1); 53 | } 54 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddDays(7), e.FromQQ); 55 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddDays(7).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 56 | sendText.MsgToSend.Add(statistics); 57 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 58 | result.SendObject.Add(sendText); 59 | return result; 60 | } 61 | 62 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 63 | { 64 | return new FunctionResult { Result = false, SendFlag = false }; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalYearCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalYearOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = new DateTime(DateTime.Now.Year, 1, 1); 48 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, DateTime.Now, e.FromQQ); 49 | string statistics = $"{e.FromQQ.CQCode_At()}统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{DateTime.Now.ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 50 | int count = CloudConfig.YearShowWordCount; 51 | if (count > 0) 52 | { 53 | statistics += $"\r\n前{count}的词汇为: "; 54 | if (CloudConfig.YearShowWordListMode) 55 | { 56 | statistics += "\r\n"; 57 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 58 | { 59 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 60 | } 61 | } 62 | else 63 | { 64 | statistics += string.Join("、", drawResult.Words.Take(count)); 65 | } 66 | } 67 | sendText.MsgToSend.Add(statistics); 68 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 69 | result.SendObject.Add(sendText); 70 | return result; 71 | } 72 | 73 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 74 | { 75 | return new FunctionResult { Result = false, SendFlag = false }; 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawPersonalYesterdayCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading.Tasks; 7 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 9 | using PublicInfos; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 12 | { 13 | public class DrawPersonalYesterdayCloud : IOrderModel 14 | { 15 | public bool ImplementFlag { get; set; } = true; 16 | 17 | public string GetOrderStr() => CloudConfig.PersonalYesterdayOrder; 18 | 19 | public bool Judge(string destStr) 20 | { 21 | switch (CloudConfig.MatchMode) 22 | { 23 | case MatchMode.Regex: 24 | return Regex.IsMatch(destStr, GetOrderStr()); 25 | case MatchMode.Contain: 26 | return destStr.Contains(GetOrderStr()); 27 | case MatchMode.Full: 28 | return destStr.Trim() == GetOrderStr(); 29 | default: 30 | return false; 31 | } 32 | } 33 | 34 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 35 | { 36 | FunctionResult result = new FunctionResult 37 | { 38 | Result = true, 39 | SendFlag = true, 40 | }; 41 | SendText sendText = new SendText 42 | { 43 | SendID = e.FromGroup, 44 | }; 45 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | DateTime dt = DateTime.Now.AddDays(-1); 48 | dt = new DateTime(dt.Year, dt.Month, dt.Day); 49 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddDays(1), e.FromQQ); 50 | sendText.MsgToSend.Add(e.FromQQ.CQCode_At().ToSendString()); 51 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 52 | result.SendObject.Add(sendText); 53 | return result; 54 | } 55 | 56 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 57 | { 58 | return new FunctionResult { Result = false, SendFlag = false }; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawTodayCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawTodayCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.TodayCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 31 | { 32 | FunctionResult result = new FunctionResult 33 | { 34 | Result = true, 35 | SendFlag = true, 36 | }; 37 | SendText sendText = new SendText 38 | { 39 | SendID = e.FromGroup, 40 | }; 41 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 42 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 43 | 44 | sendText.MsgToSend.Add(CQApi.CQCode_Image(DrawWordCloud.Draw(e.FromGroup, DateTime.Now).CloudFilePath).ToSendString()); 45 | result.SendObject.Add(sendText); 46 | return result; 47 | } 48 | 49 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 50 | { 51 | return new FunctionResult { Result = false, SendFlag = false }; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawTodayRank.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 3 | using PublicInfos; 4 | using System; 5 | using System.IO; 6 | using System.Text.RegularExpressions; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawTodayRank : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.TodayRank; 15 | 16 | public bool Judge(string destStr) 17 | { 18 | switch (CloudConfig.MatchMode) 19 | { 20 | case MatchMode.Regex: 21 | return Regex.IsMatch(destStr, GetOrderStr()); 22 | case MatchMode.Contain: 23 | return destStr.Contains(GetOrderStr()); 24 | case MatchMode.Full: 25 | return destStr.Trim() == GetOrderStr(); 26 | default: 27 | return false; 28 | } 29 | } 30 | 31 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 32 | { 33 | FunctionResult result = new FunctionResult 34 | { 35 | Result = true, 36 | SendFlag = true, 37 | }; 38 | SendText sendText = new SendText 39 | { 40 | SendID = e.FromGroup, 41 | }; 42 | result.SendObject.Add(sendText); 43 | 44 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 45 | { 46 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 47 | } 48 | 49 | var groupRanks = DrawGroupRank.GetGroupRanks(e.FromGroup, DateTime.Now.AddDays(-1), DateTime.Now); 50 | if(groupRanks == null) 51 | { 52 | sendText.MsgToSend.Add("生成失败"); 53 | return result; 54 | } 55 | var rankResult = DrawGroupRank.GenerateRankList(groupRanks); 56 | var pic = DrawGroupRank.DrawPieChart(rankResult); 57 | string filename = DateTime.Now.ToString("yyyyMMddHHmmss") + ".jpg"; 58 | Directory.CreateDirectory(Path.Combine(MainSave.ImageDirectory, "WordCloud")); 59 | pic.Save(Path.Combine(MainSave.ImageDirectory, "WordCloud", filename)); 60 | pic.Dispose(); 61 | sendText.MsgToSend.Add(CQApi.CQCode_Image($"WordCloud\\{filename}").ToSendString()); 62 | sendText.MsgToSend.Add(DrawGroupRank.GenerateRankString(rankResult)); 63 | return result; 64 | } 65 | 66 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 67 | { 68 | return new FunctionResult { Result = false, SendFlag = false }; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawWeekCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text.RegularExpressions; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawWeekCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.WeekCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | 30 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 31 | { 32 | FunctionResult result = new FunctionResult 33 | { 34 | Result = true, 35 | SendFlag = true, 36 | }; 37 | SendText sendText = new SendText 38 | { 39 | SendID = e.FromGroup, 40 | }; 41 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 42 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 43 | DateTime dt = DateTime.Now; 44 | for (int i = 0; i < 7; i++) 45 | { 46 | if (dt.DayOfWeek == DayOfWeek.Monday) 47 | break; 48 | dt = dt.AddDays(-1); 49 | } 50 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, dt.AddDays(7)); 51 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{dt.AddDays(7).ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 52 | sendText.MsgToSend.Add(statistics); 53 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 54 | result.SendObject.Add(sendText); 55 | return result; 56 | } 57 | 58 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 59 | { 60 | return new FunctionResult { Result = false, SendFlag = false }; 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawYearCloud.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Text.RegularExpressions; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using PublicInfos; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 9 | { 10 | public class DrawYearCloud : IOrderModel 11 | { 12 | public bool ImplementFlag { get; set; } = true; 13 | 14 | public string GetOrderStr() => CloudConfig.YearCloudOrder; 15 | 16 | public bool Judge(string destStr) 17 | { 18 | switch (CloudConfig.MatchMode) 19 | { 20 | case MatchMode.Regex: 21 | return Regex.IsMatch(destStr, GetOrderStr()); 22 | case MatchMode.Contain: 23 | return destStr.Contains(GetOrderStr()); 24 | case MatchMode.Full: 25 | return destStr.Trim() == GetOrderStr(); 26 | default: 27 | return false; 28 | } 29 | } 30 | 31 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 32 | { 33 | FunctionResult result = new FunctionResult 34 | { 35 | Result = true, 36 | SendFlag = true, 37 | }; 38 | SendText sendText = new SendText 39 | { 40 | SendID = e.FromGroup, 41 | }; 42 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 43 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>", CQApi.CQCode_At(e.FromQQ).ToSendString())); 44 | DateTime dt = new DateTime(DateTime.Now.Year, 1, 1); 45 | var drawResult = DrawWordCloud.Draw(e.FromGroup, dt, DateTime.Now); 46 | string statistics = $"统计时段: {dt.ToString("G").Replace(" 0:00:00", "")}-{DateTime.Now.ToString("G").Replace(" 0:00:00", "")},共计: {drawResult.WordNum}个词汇"; 47 | int count = CloudConfig.YearShowWordCount; 48 | if (count > 0) 49 | { 50 | statistics += $"\r\n前{count}的词汇为: "; 51 | if (CloudConfig.YearShowWordListMode) 52 | { 53 | statistics += "\r\n"; 54 | for (int i = 0; i < Math.Min(count, drawResult.Words.Count); i++) 55 | { 56 | statistics += $"{i + 1}. {drawResult.Words[i]}\r\n"; 57 | } 58 | } 59 | else 60 | { 61 | statistics += string.Join("、", drawResult.Words.Take(count)); 62 | } 63 | } 64 | sendText.MsgToSend.Add(statistics); 65 | sendText.MsgToSend.Add(CQApi.CQCode_Image(drawResult.CloudFilePath).ToSendString()); 66 | result.SendObject.Add(sendText); 67 | return result; 68 | } 69 | 70 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 71 | { 72 | return new FunctionResult { Result = false, SendFlag = false }; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/DrawYesterdayCloud.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 3 | using PublicInfos; 4 | using System; 5 | using System.Text.RegularExpressions; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 8 | { 9 | public class DrawYesterdayCloud : IOrderModel 10 | { 11 | public bool ImplementFlag { get; set; } = true; 12 | 13 | public string GetOrderStr() => CloudConfig.YesterdayCloudOrder; 14 | 15 | public bool Judge(string destStr) 16 | { 17 | switch (CloudConfig.MatchMode) 18 | { 19 | case MatchMode.Regex: 20 | return Regex.IsMatch(destStr, GetOrderStr()); 21 | case MatchMode.Contain: 22 | return destStr.Contains(GetOrderStr()); 23 | case MatchMode.Full: 24 | return destStr.Trim() == GetOrderStr(); 25 | default: 26 | return false; 27 | } 28 | } 29 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 30 | { 31 | FunctionResult result = new FunctionResult 32 | { 33 | Result = true, 34 | SendFlag = true, 35 | }; 36 | SendText sendText = new SendText 37 | { 38 | SendID = e.FromGroup, 39 | }; 40 | if (!string.IsNullOrWhiteSpace(CloudConfig.SendTmpMsg)) 41 | e.FromGroup.SendGroupMessage(CloudConfig.SendTmpMsg.Replace("<@>",CQApi.CQCode_At(e.FromQQ).ToSendString())); 42 | sendText.MsgToSend.Add(CQApi.CQCode_Image(DrawWordCloud.Draw(e.FromGroup, DateTime.Now.AddDays(-1)).CloudFilePath).ToSendString()); 43 | result.SendObject.Add(sendText); 44 | return result; 45 | } 46 | 47 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 48 | { 49 | return new FunctionResult { Result = false, SendFlag = false }; 50 | } 51 | } 52 | } 53 | 54 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/ExampleFunction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 7 | using PublicInfos; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 10 | { 11 | public class ExampleFunction : IOrderModel 12 | { 13 | public bool ImplementFlag { get; set; } = false; 14 | 15 | public string GetOrderStr() => "这里输入触发指令"; 16 | 17 | public bool Judge(string destStr) => destStr.StartsWith(GetOrderStr());//这里判断是否能触发指令 18 | 19 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 20 | { 21 | FunctionResult result = new FunctionResult 22 | { 23 | Result = true, 24 | SendFlag = true, 25 | }; 26 | SendText sendText = new SendText 27 | { 28 | SendID = e.FromGroup, 29 | }; 30 | 31 | sendText.MsgToSend.Add("这里输入需要发送的文本"); 32 | result.SendObject.Add(sendText); 33 | return result; 34 | } 35 | 36 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 37 | { 38 | return new FunctionResult { Result = false, SendFlag = false }; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/OrderFunctions/RecordMsg.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using PublicInfos; 3 | using System; 4 | 5 | namespace me.cqp.luohuaming.WordCloud.Code.OrderFunctions 6 | { 7 | class RecordMsg : IOrderModel 8 | { 9 | public bool ImplementFlag { get; set; } = true; 10 | 11 | public string GetOrderStr() => ""; 12 | 13 | public bool Judge(string destStr) => true; 14 | 15 | public FunctionResult Progress(CQGroupMessageEventArgs e)//群聊处理 16 | { 17 | FunctionResult result = new FunctionResult 18 | { 19 | Result = false, 20 | SendFlag = false, 21 | }; 22 | SQLHelper.AddRecord(e.FromGroup, e.FromQQ, e.Message); 23 | return result; 24 | } 25 | 26 | public FunctionResult Progress(CQPrivateMessageEventArgs e)//私聊处理 27 | { 28 | return new FunctionResult { Result = false, SendFlag = false }; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.Code")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("me.cqp.luohuaming.WordCloud.Code")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("7a675aac-50c1-49a8-a663-9caa6674c614")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/WordCloudSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Hellobaka/WordCloud/c5f92271bf3c7b04c09b726dd9a669b18848fbe3/me.cqp.luohuaming.WordCloud.Code/WordCloudSharp.dll -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Code/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.CodeTests/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.CodeTests/DrawWordCloudTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using me.cqp.luohuaming.WordCloud.Code; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using PublicInfos; 9 | using me.cqp.luohuaming.WordCloud.Code.OrderFunctions; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Code.Tests 12 | { 13 | [TestClass()] 14 | public class DrawWordCloudTests 15 | { 16 | [TestMethod()] 17 | public void DrawTest() 18 | { 19 | MainSave.DBPath = @"data.db"; 20 | MainSave.AppDirectory = @"E:\酷Q机器人插件开发\词云\bot-development-framework\me.cqp.luohuaming.WordCloud.CodeTests\bin\x86\Debug\"; 21 | MainSave.ImageDirectory = @"E:\酷Q机器人插件开发\词云\bot-development-framework\me.cqp.luohuaming.WordCloud.CodeTests\bin\x86\Debug\"; 22 | DateTime d = new DateTime(2022, 8, 25); 23 | //CloudConfig.ChartWidth = 800; 24 | //CloudConfig.ChartHeight = 600; 25 | //List items = new List(); 26 | //Random r = new Random(); 27 | //for(int i = 160; i >= 0; i--) 28 | //{ 29 | // items.Add(new WordChartItem 30 | // { 31 | // Count = r.Next(0, 150), 32 | // Time = DateTime.Now.AddDays(i * -1) 33 | // }); 34 | // Console.WriteLine(items.Last().Count); 35 | //} 36 | //DrawWordChart.DrawChart(items); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.CodeTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.CodeTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("me.cqp.luohuaming.WordCloud.CodeTests")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | //将 ComVisible 设置为 false 将使此程序集中的类型 18 | //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("f035c01e-87b9-4b1c-8017-f98f4bb292a8")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.CodeTests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/CQMain.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Unity; 7 | using me.cqp.luohuaming.WordCloud.Code; 8 | using me.cqp.luohuaming.WordCloud.UI; 9 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 10 | 11 | namespace me.cqp.luohuaming.WordCloud.Core 12 | { 13 | /// 14 | /// 酷Q应用主入口类 15 | /// 16 | public class CQMain 17 | { 18 | /// 19 | /// 在应用被加载时将调用此方法进行事件注册, 请在此方法里向 容器中注册需要使用的事件 20 | /// 21 | /// 用于注册的 IOC 容器 22 | public static void Register (IUnityContainer unityContainer) 23 | { 24 | unityContainer.RegisterType("群消息处理"); 25 | unityContainer.RegisterType("私聊消息处理"); 26 | unityContainer.RegisterType("控制台"); 27 | unityContainer.RegisterType("酷Q启动事件"); 28 | 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/Domain/AppData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 7 | using Unity; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Core.Domain 10 | { 11 | public static class AppData 12 | { 13 | /// 14 | /// 获取当前 App 使用的 酷Q Api 接口实例 15 | /// 16 | public static CQApi CQApi { get; private set; } 17 | 18 | /// 19 | /// 获取当前 App 使用的 酷Q Log 接口实例 20 | /// 21 | public static CQLog CQLog { get; private set; } 22 | 23 | /// 24 | /// 获取当前 App 使用的依赖注入容器实例 25 | /// 26 | public static IUnityContainer UnityContainer { get; private set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/Export/CQMenuExport.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * 此文件由T4引擎自动生成, 请勿修改此文件中的代码! 3 | */ 4 | using System; 5 | using System.Reflection; 6 | using System.Runtime.InteropServices; 7 | using me.cqp.luohuaming.WordCloud.Core.Domain; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 9 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 10 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 11 | using Unity; 12 | 13 | namespace me.cqp.luohuaming.WordCloud.App.Export 14 | { 15 | /// 16 | /// 表示酷Q菜单导出的类 17 | /// 18 | public class CQMenuExport 19 | { 20 | #region --构造函数-- 21 | /// 22 | /// 由托管环境初始化的 的新实例 23 | /// 24 | static CQMenuExport () 25 | { 26 | 27 | // 调用方法进行实例化 28 | ResolveBackcall (); 29 | } 30 | #endregion 31 | 32 | #region --私有方法-- 33 | /// 34 | /// 读取容器中的注册项, 进行事件分发 35 | /// 36 | private static void ResolveBackcall () 37 | { 38 | } 39 | #endregion 40 | 41 | #region --导出方法-- 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/Export/CQStatusExport.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * 此文件由T4引擎自动生成, 请勿修改此文件中的代码! 3 | */ 4 | using System; 5 | using System.Reflection; 6 | using System.Runtime.InteropServices; 7 | using me.cqp.luohuaming.WordCloud.Core.Domain; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 9 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 10 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 11 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 12 | using Unity; 13 | 14 | namespace me.cqp.luohuaming.WordCloud.App.Export 15 | { 16 | /// 17 | /// 表示酷Q状态导出的类 18 | /// 19 | public class CQStatusExport 20 | { 21 | #region --构造函数-- 22 | /// 23 | /// 由托管环境初始化的 的新实例 24 | /// 25 | static CQStatusExport () 26 | { 27 | // 调用方法进行实例化 28 | ResolveBackcall (); 29 | } 30 | #endregion 31 | 32 | #region --私有方法-- 33 | /// 34 | /// 读取容器中的注册项, 进行事件分发 35 | /// 36 | private static void ResolveBackcall () 37 | { 38 | } 39 | #endregion 40 | 41 | #region --导出方法-- 42 | #endregion 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/FodyWeavers.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/MainExport.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using System.Threading; 4 | using me.cqp.luohuaming.WordCloud.Code; 5 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 7 | using PublicInfos; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Core 10 | { 11 | public class MainExport : IGroupMessage, IPrivateMessage 12 | { 13 | public void GroupMessage(object sender, CQGroupMessageEventArgs e) 14 | { 15 | FunctionResult result = Event_GroupMessage.GroupMessage(e); 16 | if (result.SendFlag) 17 | { 18 | if (result.SendObject == null || result.SendObject.Count == 0) 19 | { 20 | e.Handler = false; 21 | } 22 | foreach (var item in result.SendObject) 23 | { 24 | foreach (var sendMsg in item.MsgToSend) 25 | { 26 | e.CQApi.SendGroupMessage(item.SendID, sendMsg); 27 | } 28 | } 29 | } 30 | e.Handler = result.Result; 31 | } 32 | 33 | public void PrivateMessage(object sender, CQPrivateMessageEventArgs e) 34 | { 35 | FunctionResult result = Event_PrivateMessage.PrivateMessage(e); 36 | if (result.SendFlag) 37 | { 38 | if (result.SendObject == null || result.SendObject.Count == 0) 39 | { 40 | e.Handler = false; 41 | } 42 | foreach (var item in result.SendObject) 43 | { 44 | foreach (var sendMsg in item.MsgToSend) 45 | { 46 | e.CQApi.SendPrivateMessage(item.SendID, sendMsg); 47 | } 48 | } 49 | } 50 | e.Handler = result.Result; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Microsoft")] 12 | [assembly: AssemblyProduct("me.cqp.luohuaming.WordCloud.Core")] 13 | [assembly: AssemblyCopyright("Copyright © Microsoft 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("c03c5bb7-91d0-4894-aaf9-127090dfad91")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion ("4.2.2.0501")] 36 | [assembly: AssemblyFileVersion ("4.2.2.0501")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Core/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "ret": 1, 3 | "apiver": 9, 4 | "name": "水银词云机", 5 | "version": "1.3.0", 6 | "version_id": 1, 7 | "author": "落花茗", 8 | "description": "小词云插件", 9 | "event": [ 10 | { 11 | "id": 1, 12 | "type": 21, 13 | "name": "私聊消息处理", 14 | "function": "_eventPrivateMsg", 15 | "priority": 30000 16 | }, 17 | { 18 | "id": 2, 19 | "type": 2, 20 | "name": "群消息处理", 21 | "function": "_eventGroupMsg", 22 | "priority": 30000 23 | }, 24 | { 25 | "id": 1001, 26 | "type": 1001, 27 | "name": "酷Q启动事件", 28 | "priority": 30000, 29 | "function": "_eventStartup" 30 | } 31 | ], 32 | "menu": [ 33 | ], 34 | "status": [ 35 | ], 36 | "auth": [ 37 | 101, 38 | 106, 39 | 161, 40 | 130 41 | ] 42 | } -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/CommonHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 9 | using me.cqp.luohuaming.WordCloud.Tool.IniConfig; 10 | 11 | namespace PublicInfos 12 | { 13 | public static class CommonHelper 14 | { 15 | /// 16 | /// 获取时间戳 17 | /// 18 | /// 19 | public static long GetTimeStamp() 20 | { 21 | TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); 22 | return Convert.ToInt64(ts.TotalSeconds); 23 | } 24 | /// 25 | /// 获取CQ码中的图片网址 26 | /// 27 | /// 需要解析的图片CQ码 28 | /// 29 | public static string GetImageURL(string imageCQCode) 30 | { 31 | string path = MainSave.ImageDirectory + CQCode.Parse(imageCQCode)[0].Items["file"] + ".cqimg"; 32 | IniConfig image = new IniConfig(path); 33 | image.Load(); 34 | return image.Object["image"]["url"].ToString(); 35 | } 36 | public static string GetAppImageDirectory() 37 | { 38 | var ImageDirectory = Path.Combine(Environment.CurrentDirectory, "data", "image\\"); 39 | return ImageDirectory; 40 | } 41 | public static List GetSendGroup() 42 | { 43 | if (CloudConfig.WhiteListSwitch) 44 | return CloudConfig.WhiteList; 45 | else if (CloudConfig.BlackListSwitch) 46 | { 47 | var l = MainSave.CQApi.GetGroupList(); 48 | List r = new List(); 49 | foreach (var item in l.Select(x => x.Group.Id)) 50 | { 51 | if (CloudConfig.BlackList.Any(x => x == item)) 52 | continue; 53 | r.Add(item); 54 | } 55 | return r; 56 | } 57 | else 58 | return CloudConfig.WhiteList; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/FunctionResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace PublicInfos 4 | { 5 | /// 6 | /// 函数处理结果 7 | /// 8 | public class FunctionResult 9 | { 10 | /// 11 | /// 用于发送的文本 12 | /// 13 | public List SendObject { get; set; } = new List(); 14 | /// 15 | /// 标志本次函数处理阻塞或者是继续 16 | /// 17 | public bool Result { get; set; } 18 | /// 19 | /// 发送消息标识 20 | /// 21 | public bool SendFlag { get; set; } 22 | } 23 | public class SendText 24 | { 25 | /// 26 | /// 每消息执行一次发送 27 | /// 28 | public List MsgToSend { get; set; } = new List(); 29 | /// 30 | /// 发送对方的群号(或者是QQ号(请忽略,未实现)) 31 | /// 32 | public long SendID { get; set; } 33 | /// 34 | /// 处理情况,作用自己发挥 35 | /// 36 | public bool HandlingFlag { get; set; } = true; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/MainSave.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp; 4 | using me.cqp.luohuaming.WordCloud.Tool.IniConfig; 5 | 6 | namespace PublicInfos 7 | { 8 | public static class MainSave 9 | { 10 | /// 11 | /// 保存各种事件的数组 12 | /// 13 | public static List Instances { get; set; } = new List(); 14 | public static CQLog CQLog { get; set; } 15 | public static CQApi CQApi { get; set; } 16 | public static string AppDirectory { get; set; } 17 | public static string ImageDirectory { get; set; } 18 | 19 | static IniConfig configMain; 20 | public static bool IniChangeFlag { get; set; } = false; 21 | public static IniConfig ConfigMain 22 | { 23 | get 24 | { 25 | if (IniChangeFlag) 26 | return configMain; 27 | configMain = new IniConfig(Path.Combine(AppDirectory, "Config.ini")); 28 | configMain.Encoding = System.Text.Encoding.UTF8; 29 | configMain.Load(); 30 | return configMain; 31 | } 32 | set { configMain = value; } 33 | } 34 | 35 | public static string DBPath { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/Model/Record.cs: -------------------------------------------------------------------------------- 1 | using SqlSugar; 2 | using System; 3 | 4 | namespace PublicInfos.Model 5 | { 6 | [SugarTable("Record")] 7 | public class Record 8 | { 9 | [SugarColumn(IsIdentity =true, IsPrimaryKey =true)] 10 | public int RowID { get; set; } 11 | public long GroupID { get; set; } 12 | public long QQID { get; set; } 13 | public string Message { get; set; } 14 | public DateTime DateTime { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/Models.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 4 | 5 | namespace PublicInfos 6 | { 7 | public interface IOrderModel 8 | { 9 | bool ImplementFlag { get; set; } 10 | string GetOrderStr(); 11 | bool Judge(string destStr); 12 | FunctionResult Progress(CQGroupMessageEventArgs e); 13 | FunctionResult Progress(CQPrivateMessageEventArgs e); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("PublicInfos")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PublicInfos")] 13 | [assembly: AssemblyCopyright("Copyright © 2021")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("9ca41650-71f2-4f0c-9a80-9cdb5a7d593c")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.PublicInfos/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Core/Kernel32.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Core 9 | { 10 | internal class Kernel32 11 | { 12 | [DllImport ("kernel32.dll", EntryPoint = "lstrlenA", CharSet = CharSet.Ansi)] 13 | public extern static int LstrlenA (IntPtr ptr); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQAudioFormat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q接收语音时的转换格式 11 | /// 12 | public enum CQAudioFormat 13 | { 14 | /// 15 | /// mp3音频格式 16 | /// 17 | [Description("mp3")] 18 | MPEG_Layer3, 19 | /// 20 | /// arm音频格式 21 | /// 22 | [Description ("arm")] 23 | AMR_NB, 24 | /// 25 | /// wma音频格式 26 | /// 27 | [Description ("wma")] 28 | Windows_Media_Audio, 29 | /// 30 | /// m4a音频格式 31 | /// 32 | [Description ("m4a")] 33 | MPEG4, 34 | /// 35 | /// spx音频格式 36 | /// 37 | [Description ("spx")] 38 | Speex, 39 | /// 40 | /// ogg音频格式 41 | /// 42 | [Description ("ogg")] 43 | OggVorbis, 44 | /// 45 | /// wav音频格式 46 | /// 47 | [Description ("wav")] 48 | WAVE, 49 | /// 50 | /// flac音频格式 51 | /// 52 | [Description ("flac")] 53 | FLAC 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQDiscussMessageType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q讨论组消息的类型 11 | /// 12 | public enum CQDiscussMessageType 13 | { 14 | /// 15 | /// 讨论组 16 | /// 17 | Discuss = 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQFace.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 7 | { 8 | /// 9 | /// 指示酷Q表情代码 10 | /// 11 | public enum CQFace 12 | { 13 | #pragma warning disable CS1591 // 缺少对公共可见类型或成员的 XML 注释 14 | 惊讶 = 0, 15 | 撇嘴 = 1, 16 | 色 = 2, 17 | 发呆 = 3, 18 | 得意 = 4, 19 | 流泪 = 5, 20 | 害羞 = 6, 21 | 闭嘴 = 7, 22 | 睡 = 8, 23 | 大哭 = 9, 24 | 尴尬 = 10, 25 | 发怒 = 11, 26 | 调皮 = 12, 27 | 呲牙 = 13, 28 | 微笑 = 14, 29 | 难过 = 15, 30 | 酷 = 16, 31 | 抓狂 = 18, 32 | 吐 = 19, 33 | 偷笑 = 20, 34 | 可爱 = 21, 35 | 白眼 = 22, 36 | 傲慢 = 23, 37 | 饥饿 = 24, 38 | 困 = 25, 39 | 惊恐 = 26, 40 | 流汗 = 27, 41 | 憨笑 = 28, 42 | 大兵 = 29, 43 | 奋斗 = 30, 44 | 咒骂 = 31, 45 | 疑问 = 32, 46 | 晕 = 34, 47 | 折磨 = 35, 48 | 衰 = 36, 49 | 骷髅 = 37, 50 | 敲打 = 38, 51 | 再见 = 39, 52 | 发抖 = 41, 53 | 爱情 = 42, 54 | 跳跳 = 43, 55 | 猪头 = 46, 56 | 拥抱 = 49, 57 | 蛋糕 = 53, 58 | 闪电 = 54, 59 | 炸弹 = 55, 60 | 刀 = 56, 61 | 足球 = 57, 62 | 便便 = 59, 63 | 咖啡 = 60, 64 | 饭 = 61, 65 | 玫瑰 = 63, 66 | 凋谢 = 64, 67 | 爱心 = 66, 68 | 心碎 = 67, 69 | 礼物 = 69, 70 | 太阳 = 74, 71 | 月亮 = 75, 72 | 强 = 76, 73 | 弱 = 77, 74 | 握手 = 78, 75 | 胜利 = 79, 76 | 飞吻 = 85, 77 | 怄火 = 86, 78 | 西瓜 = 89, 79 | 冷汗 = 96, 80 | 擦汗 = 97, 81 | 抠鼻 = 98, 82 | 鼓掌 = 99, 83 | 糗大了 = 100, 84 | 坏笑 = 101, 85 | 左哼哼 = 102, 86 | 右哼哼 = 103, 87 | 哈欠 = 104, 88 | 鄙视 = 105, 89 | 委屈 = 106, 90 | 快哭了 = 107, 91 | 阴险 = 108, 92 | 亲亲 = 109, 93 | 吓 = 110, 94 | 可怜 = 111, 95 | 菜刀 = 112, 96 | 啤酒 = 113, 97 | 篮球 = 114, 98 | 乒乓 = 115, 99 | 示爱 = 116, 100 | 瓢虫 = 117, 101 | 抱拳 = 118, 102 | 勾引 = 119, 103 | 拳头 = 120, 104 | 差劲 = 121, 105 | 爱你 = 122, 106 | 不 = 123, 107 | 好 = 124, 108 | 转圈 = 125, 109 | 磕头 = 126, 110 | 回头 = 127, 111 | 跳绳 = 128, 112 | 挥手 = 129, 113 | 激动 = 130, 114 | 街舞 = 131, 115 | 献吻 = 132, 116 | 左太极 = 133, 117 | 右太极 = 134, 118 | 双喜 = 136, 119 | 鞭炮 = 137, 120 | 灯笼 = 138, 121 | 发财 = 139, 122 | K歌 = 140, 123 | 购物 = 141, 124 | 邮件 = 142, 125 | 帅 = 143, 126 | 喝彩 = 144, 127 | 祈祷 = 145, 128 | 爆筋 = 146, 129 | 棒棒糖 = 147, 130 | 喝奶 = 148, 131 | 下面 = 149, 132 | 香蕉 = 150, 133 | 飞机 = 151, 134 | 开车 = 152, 135 | 高铁左车头 = 153, 136 | 车厢 = 154, 137 | 高铁右车头 = 155, 138 | 多云 = 156, 139 | 下雨 = 157, 140 | 钞票 = 158, 141 | 熊猫 = 159, 142 | 灯泡 = 160, 143 | 风车 = 161, 144 | 闹钟 = 162, 145 | 打伞 = 163, 146 | 彩球 = 164, 147 | 钻戒 = 165, 148 | 沙发 = 166, 149 | 纸巾 = 167, 150 | 药 = 168, 151 | 手枪 = 169, 152 | 青蛙 = 170 153 | #pragma warning restore CS1591 // 缺少对公共可见类型或成员的 XML 注释 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQFloatWindowColors.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 9 | { 10 | /// 11 | /// 指示 酷Q悬浮窗颜色 的枚举 12 | /// 13 | public enum CQFloatWindowColors 14 | { 15 | /// 16 | /// 绿色 17 | /// 18 | [Description ("绿色")] 19 | Green = 1, 20 | /// 21 | /// 橙色 22 | /// 23 | [Description ("橙色")] 24 | Orange = 2, 25 | /// 26 | /// 红色 27 | /// 28 | [Description ("红色")] 29 | Red = 3, 30 | /// 31 | /// 深红 32 | /// 33 | [Description ("深红")] 34 | Crimson = 4, 35 | /// 36 | /// 黑色 37 | /// 38 | [Description ("黑色")] 39 | Black = 5, 40 | /// 41 | /// 灰色 42 | /// 43 | [Description ("灰色")] 44 | Gray = 6 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQFriendAddRequestType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 好友添加请求 的事件子类型 11 | /// 12 | public enum CQFriendAddRequestType 13 | { 14 | /// 15 | /// 好友添加请求 16 | /// 17 | FriendAdd = 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQFriendAddType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 好友事件 的事件类型 11 | /// 12 | public enum CQFriendAddType 13 | { 14 | /// 15 | /// 好友已添加 16 | /// 17 | FriendAdd = 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQFunction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 表示酷Q消息中内含 [CQ:...] 中的类型 11 | /// 12 | [DefaultValue (CQFunction.Unknown)] 13 | public enum CQFunction 14 | { 15 | /// 16 | /// 未知类型, 同时也是默认值 17 | /// 18 | [Description ("unknown")] 19 | Unknown, 20 | /// 21 | /// QQ表情 22 | /// 23 | [Description ("face")] 24 | Face, 25 | /// 26 | /// Emoji表情 27 | /// 28 | [Description ("emoji")] 29 | Emoji, 30 | /// 31 | /// 原创表情 32 | /// 33 | [Description ("bface")] 34 | Bface, 35 | /// 36 | /// 小表情 37 | /// 38 | [Description ("sface")] 39 | Sface, 40 | /// 41 | /// 图片 42 | /// 43 | [Description ("image")] 44 | Image, 45 | /// 46 | /// 语音 47 | /// 48 | [Description ("record")] 49 | Record, 50 | /// 51 | /// At默认 52 | /// 53 | [Description ("at")] 54 | At, 55 | /// 56 | /// 猜拳魔法表情 57 | /// 58 | [Description ("rps")] 59 | Rps, 60 | /// 61 | /// 掷骰子魔法表情 62 | /// 63 | [Description ("dice")] 64 | Dice, 65 | /// 66 | /// 戳一戳 67 | /// 68 | [Description ("shake")] 69 | Shake, 70 | /// 71 | /// 音乐 72 | /// 73 | [Description ("music")] 74 | Music, 75 | /// 76 | /// 链接分享 77 | /// 78 | [Description ("share")] 79 | Share, 80 | /// 81 | /// 卡片消息 82 | /// 83 | [Description ("rich")] 84 | Rich, 85 | /// 86 | /// 签到 87 | /// 88 | [Description ("sign")] 89 | Sign, 90 | /// 91 | /// 红包 92 | /// 93 | [Description ("hb")] 94 | Hb, 95 | /// 96 | /// 推荐 97 | /// 98 | [Description ("contact")] 99 | Contact, 100 | /// 101 | /// 厘米秀 102 | /// 103 | [Description ("show")] 104 | Show, 105 | /// 106 | /// 位置分享 107 | /// 108 | [Description ("location")] 109 | Location, 110 | /// 111 | /// 匿名消息 112 | /// 113 | [Description ("anonymous")] 114 | Anonymous 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupAddRequestType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群添加请求 的事件类型 11 | /// 12 | public enum CQGroupAddRequestType 13 | { 14 | /// 15 | /// 申请入群 16 | /// 17 | ApplyAddGroup = 1, 18 | /// 19 | /// 机器人被邀请 20 | /// 21 | RobotBeInviteAddGroup = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupBanSpeakType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群禁言 事件的类型 11 | /// 12 | public enum CQGroupBanSpeakType 13 | { 14 | /// 15 | /// 解除禁言 16 | /// 17 | RemoveBanSpeak = 1, 18 | /// 19 | /// 设置禁言 20 | /// 21 | SetBanSpeak = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupFileUploadType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群文件上传 的事件类型 11 | /// 12 | public enum CQGroupFileUploadType 13 | { 14 | /// 15 | /// 文件上传 16 | /// 17 | FileUpload = 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupManageChangeType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群管理改变 的类型 11 | /// 12 | public enum CQGroupManageChangeType 13 | { 14 | /// 15 | /// 被取消管理 16 | /// 17 | RemoveManage = 1, 18 | /// 19 | /// 被设置管理 20 | /// 21 | SetManage = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupMemberDecreaseType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群成员减少 的类型 11 | /// 12 | public enum CQGroupMemberDecreaseType 13 | { 14 | /// 15 | /// 退出群 16 | /// 17 | ExitGroup = 1, 18 | /// 19 | /// 移除群 20 | /// 21 | RemoveGroup = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupMemberIncreaseType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q 群成员增加 的类型 11 | /// 12 | public enum CQGroupMemberIncreaseType 13 | { 14 | /// 15 | /// 同意入群 16 | /// 17 | Pass = 1, 18 | /// 19 | /// 邀请入群 20 | /// 21 | Invite = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQGroupMessageType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q群聊消息类型 11 | /// 12 | public enum CQGroupMessageType 13 | { 14 | /// 15 | /// 群聊 16 | /// 17 | Group = 1 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQLogLevel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 表示酷Q日志中的类型等级 11 | /// 12 | public enum CQLogLevel 13 | { 14 | /// 15 | /// 调试. 颜色: 灰色 16 | /// 17 | Debug = 0, 18 | /// 19 | /// 信息. 颜色: 黑色 20 | /// 21 | Info = 10, 22 | /// 23 | /// 信息 (成功) 颜色: 紫色 24 | /// 25 | InfoSuccess = 11, 26 | /// 27 | /// 信息 (接收) 颜色: 蓝色 28 | /// 29 | InfoReceive = 12, 30 | /// 31 | /// 信息 (发送) 颜色: 绿色 32 | /// 33 | InfoSend = 13, 34 | /// 35 | /// 警告 颜色: 橙色 36 | /// 37 | Warning = 20, 38 | /// 39 | /// 错误 颜色: 红色 40 | /// 41 | Error = 30, 42 | /// 43 | /// 致命错误 颜色: 深红色 44 | /// 45 | Fatal = 40 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQMessageEventType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q消息类事件的事件类型 11 | /// 12 | public enum CQMessageEventType 13 | { 14 | /// 15 | /// 私聊消息 16 | /// 17 | PrivateMessage = 21, 18 | /// 19 | /// 群消息 20 | /// 21 | GroupMessage = 2, 22 | /// 23 | /// 讨论组消息 24 | /// 25 | DiscussMessage = 4, 26 | /// 27 | /// 群文件上传 28 | /// 29 | GroupFileUpload = 11, 30 | /// 31 | /// 群管理变动 32 | /// 33 | GroupManageChange = 101, 34 | /// 35 | /// 群成员减少 36 | /// 37 | GroupMemberDecrease = 102, 38 | /// 39 | /// 群成员增加 40 | /// 41 | GroupMemberIncrease = 103, 42 | /// 43 | /// 群成员禁言 44 | /// 45 | GroupMemberBanSpeak = 104, 46 | /// 47 | /// 好友添加 48 | /// 49 | FriendAdd = 201, 50 | /// 51 | /// 好友添加请求 52 | /// 53 | FriendAddRequest = 301, 54 | /// 55 | /// 群添加请求 56 | /// 57 | GroupAddRequest = 302, 58 | /// 59 | /// 酷Q启动 60 | /// 61 | CQStartup = 1001, 62 | /// 63 | /// 酷Q退出 64 | /// 65 | CQExit = 1002, 66 | /// 67 | /// 酷Q应用被启用 68 | /// 69 | CQAppEnable = 1003, 70 | /// 71 | /// 酷Q应用被禁用 72 | /// 73 | CQAppDisable = 1004 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQMessageHandler.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q处理消息的方式 11 | /// 12 | public enum CQMessageHandler 13 | { 14 | /// 15 | /// 忽略消息, 允许后续应用继续处理此消息 16 | /// 17 | Ignore = 0, 18 | /// 19 | /// 拦截消息, 以阻止后续应用继续处理此消息 20 | /// 21 | Intercept = 1 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQMusicStyle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示分享音乐时使用的分享卡片样式 11 | /// 12 | public enum CQMusicStyle 13 | { 14 | /// 15 | /// 旧版样式 16 | /// 17 | Old = 0, 18 | /// 19 | /// 大卡片样式 20 | /// 21 | BigCard = 1, 22 | /// 23 | /// 最新样式 24 | /// 25 | New = 2 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQMusicType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 9 | { 10 | /// 11 | /// 指示点歌时使用的音乐来源 12 | /// 13 | [DefaultValue (CQMusicType.Tencent)] 14 | public enum CQMusicType 15 | { 16 | /// 17 | /// QQ 音乐 18 | /// 19 | [Description ("qq")] 20 | Tencent, 21 | /// 22 | /// 网易云音乐 23 | /// 24 | [Description ("163")] 25 | Netease, 26 | /// 27 | /// 虾米音乐 28 | /// 29 | [Description ("xiami")] 30 | XiaMi 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQPrviateMessageType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q私聊消息类型 11 | /// 12 | public enum CQPrviateMessageType 13 | { 14 | /// 15 | /// 好友 16 | /// 17 | Friend = 11, 18 | /// 19 | /// 在线状态 20 | /// 21 | OnlineStatus = 1, 22 | /// 23 | /// 群 24 | /// 25 | Group = 2, 26 | /// 27 | /// 讨论组 28 | /// 29 | Discuss = 3 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/CQResponseType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 指示酷Q请求响应类型 11 | /// 12 | public enum CQResponseType 13 | { 14 | /// 15 | /// 通过 16 | /// 17 | PASS = 1, 18 | /// 19 | /// 不通过 20 | /// 21 | FAIL = 2 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/QQGroupMemberType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 8 | { 9 | /// 10 | /// 表示群成员对于所在群的群成员类型 11 | /// 12 | public enum QQGroupMemberType 13 | { 14 | /// 15 | /// 成员 16 | /// 17 | [Description ("成员")] 18 | Member = 1, 19 | /// 20 | /// 管理 21 | /// 22 | [Description ("管理员")] 23 | Manage = 2, 24 | /// 25 | /// 群主 26 | /// 27 | [Description ("群主")] 28 | Creator = 3 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Enum/QQSex.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum 7 | { 8 | /// 9 | /// 表示QQ性别的枚举 10 | /// 11 | public enum QQSex 12 | { 13 | /// 14 | /// 男性 15 | /// 16 | Man = 0, 17 | /// 18 | /// 女性 19 | /// 20 | Woman = 1, 21 | /// 22 | /// 未知 23 | /// 24 | Unknown = 255 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQAppDisableEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述应用停用事件参数的类 11 | /// 12 | /// Type: 1004 13 | /// 14 | public sealed class CQAppDisableEventArgs : CQEventEventArgs 15 | { 16 | #region --构造函数-- 17 | /// 18 | /// 初始化 类的新实例 19 | /// 20 | /// 酷Q的接口实例 21 | /// 酷Q的日志实例 22 | /// 事件id 23 | /// 类型 24 | /// 名称 25 | /// 函数名 26 | /// 默认优先级 27 | public CQAppDisableEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority) 28 | : base (api, log, id, type, name, function, priority) 29 | { 30 | } 31 | #endregion 32 | 33 | #region --公开方法-- 34 | /// 35 | /// 返回表示当前对象的字符串 36 | /// 37 | /// 表示当前对象的字符串 38 | public override string ToString () 39 | { 40 | StringBuilder builder = new StringBuilder (); 41 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 42 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 43 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 44 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 45 | builder.AppendFormat ("优先级: {0}", this.Priority); 46 | return builder.ToString (); 47 | } 48 | #endregion 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQAppEnableEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述应用启用事件参数的类 11 | /// 12 | /// Type: 1003 13 | /// 14 | public sealed class CQAppEnableEventArgs : CQEventEventArgs 15 | { 16 | #region --构造函数-- 17 | /// 18 | /// 初始化 类的新实例 19 | /// 20 | /// 酷Q的接口实例 21 | /// 酷Q的日志实例 22 | /// 事件id 23 | /// 类型 24 | /// 名称 25 | /// 函数名 26 | /// 默认优先级 27 | public CQAppEnableEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority) 28 | : base (api, log, id, type, name, function, priority) 29 | { 30 | } 31 | #endregion 32 | 33 | #region --公开方法-- 34 | /// 35 | /// 返回表示当前对象的字符串 36 | /// 37 | /// 表示当前对象的字符串 38 | public override string ToString () 39 | { 40 | StringBuilder builder = new StringBuilder (); 41 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 42 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 43 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 44 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 45 | builder.AppendFormat ("优先级: {0}", this.Priority); 46 | return builder.ToString (); 47 | } 48 | #endregion 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQDiscussMessageEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 10 | { 11 | /// 12 | /// 提供用于描述酷Q讨论组事件参数的类 13 | /// 14 | /// Type: 4 15 | /// 16 | public sealed class CQDiscussMessageEventArgs : CQEventEventArgs 17 | { 18 | #region --属性-- 19 | /// 20 | /// 获取当前事件的消息子类型 21 | /// 22 | public CQDiscussMessageType SubType { get; private set; } 23 | 24 | /// 25 | /// 获取当前事件的来源讨论组 26 | /// 27 | public Discuss FromDiscuss { get; private set; } 28 | 29 | /// 30 | /// 获取当前事件的来源QQ 31 | /// 32 | public QQ FromQQ { get; private set; } 33 | 34 | /// 35 | /// 获取当前事件的消息内容 36 | /// 37 | public QQMessage Message { get; private set; } 38 | #endregion 39 | 40 | #region --构造函数-- 41 | /// 42 | /// 初始化 类的新实例 43 | /// 44 | /// 酷Q的接口实例 45 | /// 酷Q的日志实例 46 | /// 事件Id 47 | /// 事件类型 48 | /// 事件名称 49 | /// 函数名称 50 | /// 默认优先级 51 | /// 子类型 52 | /// 消息Id 53 | /// 来源讨论组 54 | /// 来源QQ 55 | /// 消息内容 56 | /// 是否为正则消息 57 | public CQDiscussMessageEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int msgId, long fromDiscuss, long fromQQ, string msg, bool isRegex) 58 | : base (api, log, id, type, name, function, priority) 59 | { 60 | this.SubType = (CQDiscussMessageType)subType; 61 | this.Message = new QQMessage (api, msgId, msg, isRegex); 62 | this.FromDiscuss = new Discuss (api, fromDiscuss); 63 | this.FromQQ = new QQ (api, fromQQ); 64 | } 65 | #endregion 66 | 67 | #region --公开方法-- 68 | /// 69 | /// 返回表示当前对象的字符串 70 | /// 71 | /// 表示当前对象的字符串 72 | public override string ToString () 73 | { 74 | StringBuilder builder = new StringBuilder (); 75 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 76 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 77 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 78 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 79 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 80 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 81 | builder.AppendLine (string.Format ("讨论组号: {0}", this.FromDiscuss != null ? this.FromDiscuss.Id.ToString () : string.Empty)); 82 | builder.AppendLine (string.Format ("账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty)); 83 | builder.Append (this.Message != null ? this.Message.ToString () : "消息: "); 84 | return builder.ToString (); 85 | } 86 | #endregion 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q事件参数的基础类, 该类是抽象的 11 | /// 12 | public abstract class CQEventArgs 13 | { 14 | #region --属性-- 15 | /// 16 | /// 获取当前事件的 实例. 17 | /// 18 | public CQApi CQApi { get; private set; } 19 | 20 | /// 21 | /// 获取当前事件的 实例. 22 | /// 23 | public CQLog CQLog { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的回调函数名称. 是 function 字段 27 | /// 28 | public string Function { get; private set; } 29 | #endregion 30 | 31 | #region --构造函数-- 32 | /// 33 | /// 初始化 类的新实例 34 | /// 35 | /// 酷Q的接口实例 36 | /// 酷Q的日志实例 37 | /// 触发此事件的函数名称 38 | public CQEventArgs (CQApi api, CQLog log, string function) 39 | { 40 | this.CQApi = api; 41 | this.CQLog = log; 42 | this.Function = function; 43 | } 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQEventEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 9 | { 10 | /// 11 | /// 提供用于描述酷Q事件类事件参数的基础类, 该类是抽象的 12 | /// 13 | public abstract class CQEventEventArgs : CQEventArgs 14 | { 15 | #region --属性-- 16 | /// 17 | /// 获取来源事件的事件ID. 是 id 字段 18 | /// 19 | public int Id { get; private set; } 20 | 21 | /// 22 | /// 获取来源事件的事件类型. 是 type 字段 23 | /// 24 | public CQMessageEventType Type { get; private set; } 25 | 26 | /// 27 | /// 获取来源事件的事件名称. 是 name 字段 28 | /// 29 | public string Name { get; private set; } 30 | 31 | /// 32 | /// 获取来源事件的默认优先级. 是 priority 字段, 该值不会随着酷Q的调整而变动 33 | /// 34 | public uint Priority { get; private set; } 35 | 36 | /// 37 | /// 获取或设置一个值, 指示该事件是否已经处理 38 | /// 39 | public bool Handler { get; set; } 40 | #endregion 41 | 42 | #region --构造函数-- 43 | /// 44 | /// 初始化 类的新实例 45 | /// 46 | /// 酷Q的接口实例 47 | /// 酷Q的日志实例 48 | /// 事件id 49 | /// 类型 50 | /// 名称 51 | /// 函数名 52 | /// 默认优先级 53 | public CQEventEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority) 54 | : base (api, log, function) 55 | { 56 | this.Id = id; 57 | this.Type = (CQMessageEventType)type; 58 | this.Name = name; 59 | this.Priority = priority; 60 | this.Handler = false; 61 | } 62 | #endregion 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQExitEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q停止事件参数的类 11 | /// 12 | /// Type: 1002 13 | /// 14 | public sealed class CQExitEventArgs : CQEventEventArgs 15 | { 16 | #region --构造函数-- 17 | /// 18 | /// 初始化 类的新实例 19 | /// 20 | /// 酷Q的接口实例 21 | /// 酷Q的日志实例 22 | /// 事件ID 23 | /// 类型 24 | /// 名称 25 | /// 函数名称 26 | /// 默认优先级 27 | public CQExitEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority) 28 | : base (api, log, id, type, name, function, priority) 29 | { 30 | } 31 | #endregion 32 | 33 | #region --公开方法-- 34 | /// 35 | /// 返回表示当前对象的字符串 36 | /// 37 | /// 表示当前对象的字符串 38 | public override string ToString () 39 | { 40 | StringBuilder builder = new StringBuilder (); 41 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 42 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 43 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 44 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 45 | builder.AppendFormat ("优先级: {0}", this.Priority); 46 | return builder.ToString (); 47 | } 48 | #endregion 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQFriendAddEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 11 | { 12 | /// 13 | /// 提供用于描述酷Q好友事件参数的类 14 | /// 15 | /// Type: 201 16 | /// 17 | public sealed class CQFriendAddEventArgs : CQEventEventArgs 18 | { 19 | #region --属性-- 20 | /// 21 | /// 获取当前事件的子类型 22 | /// 23 | public CQFriendAddType SubType { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的发送时间 27 | /// 28 | public DateTime SendTime { get; private set; } 29 | 30 | /// 31 | /// 获取当前事件的来源QQ 32 | /// 33 | public QQ FromQQ { get; private set; } 34 | #endregion 35 | 36 | #region --构造函数-- 37 | /// 38 | /// 初始化 类的新实例 39 | /// 40 | /// 酷Q的接口实例 41 | /// 酷Q的日志实例 42 | /// 事件Id 43 | /// 事件类型 44 | /// 事件名称 45 | /// 函数名称 46 | /// 默认优先级 47 | /// 子类型 48 | /// 发送时间 49 | /// 来源QQ 50 | public CQFriendAddEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int sendTime, long fromQQ) 51 | : base (api, log, id, type, name, function, priority) 52 | { 53 | this.SubType = (CQFriendAddType)subType; 54 | this.SendTime = sendTime.ToDateTime (); 55 | this.FromQQ = new QQ (api, fromQQ); 56 | } 57 | #endregion 58 | 59 | #region --公开方法-- 60 | /// 61 | /// 返回表示当前对象的字符串 62 | /// 63 | /// 表示当前对象的字符串 64 | public override string ToString () 65 | { 66 | StringBuilder builder = new StringBuilder (); 67 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 68 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 69 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 70 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 71 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 72 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 73 | builder.AppendLine (string.Format ("发送时间: {0}", this.SendTime)); 74 | builder.AppendFormat ("账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty); 75 | return builder.ToString (); 76 | } 77 | #endregion 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQFriendAddRequestEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 11 | { 12 | /// 13 | /// 提供用于描述酷Q好友添加请求事件参数的类 14 | /// 15 | /// Type: 301 16 | /// 17 | public class CQFriendAddRequestEventArgs : CQEventEventArgs 18 | { 19 | #region --属性-- 20 | /// 21 | /// 获取当前事件的子类型 22 | /// 23 | public CQFriendAddRequestType SubType { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的发送时间 27 | /// 28 | public DateTime SendTime { get; private set; } 29 | 30 | /// 31 | /// 获取当前事件的来源QQ 32 | /// 33 | public QQ FromQQ { get; private set; } 34 | 35 | /// 36 | /// 获取当前事件的附加消息 37 | /// 38 | public string AppendMessage { get; private set; } 39 | 40 | /// 41 | /// 获取当前事件用于处理请求所使用的响应标识 42 | /// 43 | public QQRequest Request { get; private set; } 44 | #endregion 45 | 46 | #region --构造函数-- 47 | /// 48 | /// 初始化 类的新实例 49 | /// 50 | /// 酷Q的接口实例 51 | /// 酷Q的日志实例 52 | /// 事件Id 53 | /// 事件类型 54 | /// 事件名称 55 | /// 函数名称 56 | /// 默认优先级 57 | /// 子类型 58 | /// 发送时间 59 | /// 来源QQ 60 | /// 附言 61 | /// 反馈标识 62 | public CQFriendAddRequestEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int sendTime, long fromQQ, string msg, string responseFlag) 63 | : base (api, log, id, type, name, function, priority) 64 | { 65 | this.SubType = (CQFriendAddRequestType)subType; 66 | this.SendTime = sendTime.ToDateTime (); 67 | this.FromQQ = new QQ (api, fromQQ); 68 | this.AppendMessage = msg; 69 | this.Request = new QQRequest (api, responseFlag); 70 | } 71 | #endregion 72 | 73 | #region --公开方法-- 74 | /// 75 | /// 返回表示当前对象的字符串 76 | /// 77 | /// 表示当前对象的字符串 78 | public override string ToString () 79 | { 80 | StringBuilder builder = new StringBuilder (); 81 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 82 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 83 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 84 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 85 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 86 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 87 | builder.AppendLine (string.Format ("发送时间: {0}", this.SendTime)); 88 | builder.AppendLine (string.Format ("账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty)); 89 | builder.AppendFormat ("附加消息: {0}", this.AppendMessage != null ? this.AppendMessage : string.Empty); 90 | return builder.ToString (); 91 | } 92 | #endregion 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQGroupManageChangeEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 11 | { 12 | /// 13 | /// 提供用于描述酷Q群管理变化事件参数的类 14 | /// 15 | /// Type: 101 16 | /// 17 | public sealed class CQGroupManageChangeEventArgs : CQEventEventArgs 18 | { 19 | #region --属性-- 20 | /// 21 | /// 获取当前事件的子类型 22 | /// 23 | public CQGroupManageChangeType SubType { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的发送时间 27 | /// 28 | public DateTime SendTime { get; private set; } 29 | 30 | /// 31 | /// 获取当前事件的来源群 32 | /// 33 | public Group FromGroup { get; private set; } 34 | 35 | /// 36 | /// 被操作的QQ 37 | /// 38 | public QQ BeingOperateQQ { get; private set; } 39 | #endregion 40 | 41 | #region --构造函数-- 42 | /// 43 | /// 初始化 类的新实例 44 | /// 45 | /// 酷Q的接口实例 46 | /// 酷Q的日志实例 47 | /// 事件Id 48 | /// 事件类型 49 | /// 事件名称 50 | /// 函数名称 51 | /// 默认优先级 52 | /// 子类型 53 | /// 发送时间 54 | /// 来源群 55 | /// 被操作QQ 56 | public CQGroupManageChangeEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int sendTime, long fromGroup, long beingOperateQQ) 57 | : base (api, log, id, type, name, function, priority) 58 | { 59 | this.SubType = (CQGroupManageChangeType)subType; 60 | this.SendTime = sendTime.ToDateTime (); 61 | this.FromGroup = new Group (api, fromGroup); 62 | this.BeingOperateQQ = new QQ (api, beingOperateQQ); 63 | } 64 | #endregion 65 | 66 | #region --公开函数-- 67 | /// 68 | /// 返回表示当前对象的字符串 69 | /// 70 | /// 表示当前对象的字符串 71 | public override string ToString () 72 | { 73 | StringBuilder builder = new StringBuilder (); 74 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 75 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 76 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 77 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 78 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 79 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 80 | builder.AppendLine (string.Format ("发送时间: {0}", this.SendTime)); 81 | builder.AppendLine (string.Format ("群号: {0}", this.FromGroup != null ? this.FromGroup.Id.ToString () : string.Empty)); 82 | builder.AppendFormat ("被操作账号: {0}", this.BeingOperateQQ != null ? this.BeingOperateQQ.Id.ToString () : string.Empty); 83 | return builder.ToString (); 84 | } 85 | #endregion 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQGroupMemberDecreaseEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 11 | { 12 | /// 13 | /// 提供用于描述酷Q群成员减少事件参数的类 14 | /// 15 | /// Type: 102 16 | /// 17 | public sealed class CQGroupMemberDecreaseEventArgs : CQEventEventArgs 18 | { 19 | #region --属性-- 20 | /// 21 | /// 获取当前事件的子类型 22 | /// 23 | public CQGroupMemberDecreaseType SubType { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的发送时间 27 | /// 28 | public DateTime SendTime { get; private set; } 29 | 30 | /// 31 | /// 获取当前事件的来源群 32 | /// 33 | public Group FromGroup { get; private set; } 34 | 35 | /// 36 | /// 获取当前事件的来源QQ 37 | /// 38 | public QQ FromQQ { get; private set; } 39 | 40 | /// 41 | /// 获取当前事件被操作的QQ 42 | /// 43 | public QQ BeingOperateQQ { get; private set; } 44 | #endregion 45 | 46 | #region --构造函数-- 47 | /// 48 | /// 初始化 类的新实例 49 | /// 50 | /// 酷Q的接口实例 51 | /// 酷Q的日志实例 52 | /// 事件ID 53 | /// 事件类型 54 | /// 事件名称 55 | /// 函数名称 56 | /// 默认优先级 57 | /// 子类型 58 | /// 发送时间 59 | /// 来源群 60 | /// 来源QQ 61 | /// 被操作QQ 62 | public CQGroupMemberDecreaseEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int sendTime, long fromGroup, long fromQQ, long beingOperateQQ) 63 | : base (api, log, id, type, name, function, priority) 64 | { 65 | this.SubType = (CQGroupMemberDecreaseType)subType; 66 | this.SendTime = sendTime.ToDateTime (); 67 | this.FromGroup = new Group (api, fromGroup); 68 | if (subType == 2) // 仅仅当类型为2时存在 FromQQ 69 | { 70 | this.FromQQ = new QQ (api, fromQQ); 71 | } 72 | this.BeingOperateQQ = new QQ (api, beingOperateQQ); 73 | } 74 | #endregion 75 | 76 | #region --公开函数-- 77 | /// 78 | /// 返回表示当前对象的字符串 79 | /// 80 | /// 表示当前对象的字符串 81 | public override string ToString () 82 | { 83 | StringBuilder builder = new StringBuilder (); 84 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 85 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 86 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 87 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 88 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 89 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 90 | builder.AppendLine (string.Format ("发送时间: {0}", this.SendTime)); 91 | builder.AppendLine (string.Format ("群号: {0}", this.FromGroup != null ? this.FromGroup.Id.ToString () : string.Empty)); 92 | builder.AppendLine (string.Format ("操作者账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty)); 93 | builder.AppendFormat ("被操作账号: {0}", this.BeingOperateQQ != null ? this.BeingOperateQQ.Id.ToString () : string.Empty); 94 | return builder.ToString (); 95 | } 96 | #endregion 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQGroupUploadEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 11 | { 12 | /// 13 | /// 提供用于描述酷Q群文件上传事件参数的类 14 | /// 15 | /// Type: 11 16 | /// 17 | public sealed class CQGroupUploadEventArgs : CQEventEventArgs 18 | { 19 | #region --属性-- 20 | /// 21 | /// 获取当前事件的消息子类型 22 | /// 23 | public CQGroupFileUploadType SubType { get; private set; } 24 | 25 | /// 26 | /// 获取当前事件的发送时间 27 | /// 28 | public DateTime SendTime { get; private set; } 29 | 30 | /// 31 | /// 获取当前事件的来源群 32 | /// 33 | public Group FromGroup { get; private set; } 34 | 35 | /// 36 | /// 获取当前事件的来源QQ 37 | /// 38 | public QQ FromQQ { get; private set; } 39 | 40 | /// 41 | /// 获取当前事件的文件信息 42 | /// 43 | public GroupFileInfo FileInfo { get; private set; } 44 | #endregion 45 | 46 | #region --构造函数-- 47 | /// 48 | /// 初始化 类的新实例 49 | /// 50 | /// 酷Q的接口实例 51 | /// 酷Q的日志实例 52 | /// 事件Id 53 | /// 事件类型 54 | /// 事件名称 55 | /// 函数名称 56 | /// 默认优先级 57 | /// 子类型 58 | /// 发送时间 59 | /// 来源群 60 | /// 来源QQ 61 | /// 文件信息 62 | public CQGroupUploadEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int sendTime, long fromGroup, long fromQQ, string file) 63 | : base (api, log, id, type, name, function, priority) 64 | { 65 | this.SubType = (CQGroupFileUploadType)subType; 66 | this.SendTime = sendTime.ToDateTime (); 67 | this.FromGroup = new Group (api, fromGroup); 68 | this.FromQQ = new QQ (api, fromQQ); 69 | this.FileInfo = new GroupFileInfo (api, file); 70 | } 71 | #endregion 72 | 73 | #region --公开函数-- 74 | /// 75 | /// 返回表示当前对象的字符串 76 | /// 77 | /// 表示当前对象的字符串 78 | public override string ToString () 79 | { 80 | StringBuilder builder = new StringBuilder (); 81 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 82 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 83 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 84 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 85 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 86 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 87 | builder.AppendLine (string.Format ("发送时间: {0}", this.SendTime)); 88 | builder.AppendLine (string.Format ("群号: {0}", this.FromGroup != null ? this.FromGroup.Id.ToString () : string.Empty)); 89 | builder.AppendLine (string.Format ("账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty)); 90 | builder.Append (this.FileInfo != null ? this.FileInfo.ToString () : "文件信息: "); 91 | return builder.ToString (); 92 | } 93 | #endregion 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQMenuCallEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q菜单调用事件参数的类 11 | /// 12 | public class CQMenuCallEventArgs : CQMenuEventArgs 13 | { 14 | #region --构造函数-- 15 | /// 16 | /// 初始化 类的新实例 17 | /// 18 | /// 酷Q的接口实例 19 | /// 酷Q的日志实例 20 | /// 菜单名称 21 | /// 菜单函数 22 | public CQMenuCallEventArgs (CQApi api, CQLog log, string name, string function) 23 | : base (api, log, name, function) 24 | { 25 | } 26 | #endregion 27 | 28 | #region --公开方法-- 29 | /// 30 | /// 返回表示当前对象的字符串 31 | /// 32 | /// 表示当前对象的字符串 33 | public override string ToString () 34 | { 35 | StringBuilder builder = new StringBuilder (); 36 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 37 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 38 | return builder.ToString (); 39 | } 40 | #endregion 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQMenuEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q菜单类事件参数的基础类, 该类是抽象的 11 | /// 12 | public abstract class CQMenuEventArgs : CQEventArgs 13 | { 14 | #region --属性-- 15 | /// 16 | /// 获取来源事件的事件名称. 是 name 字段 17 | /// 18 | public string Name { get; private set; } 19 | #endregion 20 | 21 | #region --构造函数-- 22 | /// 23 | /// 初始化 类的新实例 24 | /// 25 | /// 酷Q的接口实例 26 | /// 酷Q的日志实例 27 | /// 菜单名称 28 | /// 函数名 29 | public CQMenuEventArgs (CQApi api, CQLog log, string name, string function) 30 | : base (api, log, function) 31 | { 32 | this.Name = name; 33 | } 34 | #endregion 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQPrivateMessageEventArgs.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Enum; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 10 | { 11 | /// 12 | /// 提供用于描述酷Q私聊消息事件参数的类 13 | /// 14 | /// Type: 21 15 | /// 16 | public sealed class CQPrivateMessageEventArgs : CQEventEventArgs 17 | { 18 | #region --属性-- 19 | /// 20 | /// 获取当前事件的消息子类型 21 | /// 22 | public CQPrviateMessageType SubType { get; private set; } 23 | 24 | /// 25 | /// 获取当前事件的来源QQ 26 | /// 27 | public QQ FromQQ { get; private set; } 28 | 29 | /// 30 | /// 获取当前事件的消息内容 31 | /// 32 | public QQMessage Message { get; private set; } 33 | #endregion 34 | 35 | #region --构造函数-- 36 | /// 37 | /// 初始化 类的新实例 38 | /// 39 | /// 酷Q的接口实例 40 | /// 酷Q的日志实例 41 | /// 事件id 42 | /// 事件类型 43 | /// 事件名称 44 | /// 事件函数名 45 | /// 事件优先级 46 | /// 消息子类型 47 | /// 消息ID 48 | /// 来源QQ 49 | /// 消息内容 50 | /// 是否为正则消息 51 | public CQPrivateMessageEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority, int subType, int msgId, long fromQQ, string msg, bool isRegex) 52 | : base (api, log, id, type, name, function, priority) 53 | { 54 | this.SubType = (CQPrviateMessageType)subType; 55 | this.FromQQ = new QQ (api, fromQQ); 56 | this.Message = new QQMessage (api, msgId, msg, isRegex); 57 | } 58 | #endregion 59 | 60 | #region --公开函数-- 61 | /// 62 | /// 返回表示当前对象的字符串 63 | /// 64 | /// 表示当前对象的字符串 65 | public override string ToString () 66 | { 67 | StringBuilder builder = new StringBuilder (); 68 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 69 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 70 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 71 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 72 | builder.AppendLine (string.Format ("优先级: {0}", this.Priority)); 73 | builder.AppendLine (string.Format ("子类型: {0}({1})", this.SubType, (int)this.SubType)); 74 | builder.AppendLine (string.Format ("账号: {0}", this.FromQQ != null ? this.FromQQ.Id.ToString () : string.Empty)); 75 | builder.Append (this.Message != null ? this.Message.ToString () : "消息: "); 76 | return builder.ToString (); 77 | } 78 | #endregion 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQStartupEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q启动事件参数的类 11 | /// 12 | /// Type: 1001 13 | /// 14 | public sealed class CQStartupEventArgs : CQEventEventArgs 15 | { 16 | #region --构造函数-- 17 | /// 18 | /// 初始化 类的新实例 19 | /// 20 | /// 酷Q的接口实例 21 | /// 酷Q的日志实例 22 | /// 事件ID 23 | /// 类型 24 | /// 名称 25 | /// 函数名称 26 | /// 默认优先级 27 | public CQStartupEventArgs (CQApi api, CQLog log, int id, int type, string name, string function, uint priority) 28 | : base (api, log, id, type, name, function, priority) 29 | { 30 | } 31 | #endregion 32 | 33 | #region --公开方法-- 34 | /// 35 | /// 返回表示当前对象的字符串 36 | /// 37 | /// 表示当前对象的字符串 38 | public override string ToString () 39 | { 40 | StringBuilder builder = new StringBuilder (); 41 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 42 | builder.AppendLine (string.Format ("类型: {0}({1})", this.Type, (int)this.Type)); 43 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 44 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 45 | builder.AppendFormat ("优先级: {0}", this.Priority); 46 | return builder.ToString (); 47 | } 48 | #endregion 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQStatusEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q悬浮窗状态事件参数的类, 该类是抽象的 11 | /// 12 | public abstract class CQStatusEventArgs : CQEventArgs 13 | { 14 | #region --属性-- 15 | /// 16 | /// 获取来源事件的ID. 是 id 字段 17 | /// 18 | public int Id { get; private set; } 19 | 20 | /// 21 | /// 获取来源事件的名称. 是 name 字段 22 | /// 23 | public string Name { get; private set; } 24 | 25 | /// 26 | /// 获取来源事件的显示标题. 是 title 字段 27 | /// 28 | public string Title { get; private set; } 29 | 30 | /// 31 | /// 获取来源事件的刷新间隔. 是 period 字段, 目前仅支持 1000ms (1秒) 32 | /// 33 | public TimeSpan Period { get; private set; } 34 | #endregion 35 | 36 | #region --构造函数-- 37 | /// 38 | /// 初始化 类的新实例 39 | /// 40 | /// 酷Q的接口实例 41 | /// 酷Q的日志实例 42 | /// 事件Id 43 | /// 名称 44 | /// 标题 45 | /// 函数名 46 | /// 刷新间隔 47 | public CQStatusEventArgs (CQApi api, CQLog log, int id, string name, string title, string function, long period) 48 | : base (api, log, function) 49 | { 50 | this.Id = id; 51 | this.Name = name; 52 | this.Title = title; 53 | this.Period = new TimeSpan (period * TimeSpan.TicksPerMillisecond); 54 | } 55 | #endregion 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/EventArgs/CQStatusUpdateEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs 8 | { 9 | /// 10 | /// 提供用于描述酷Q悬浮窗状态更新事件参数的类 11 | /// 12 | public sealed class CQStatusUpdateEventArgs : CQStatusEventArgs 13 | { 14 | #region --构造函数-- 15 | /// 16 | /// 初始化 类的新实例 17 | /// 18 | /// 酷Q的接口实例 19 | /// 酷Q的日志实例 20 | /// 悬浮窗id 21 | /// 名称 22 | /// 英文名称 23 | /// 函数名称 24 | /// 更新间隔 25 | public CQStatusUpdateEventArgs (CQApi api, CQLog log, int id, string name, string title, string function, long period) 26 | : base (api, log, id, name, title, function, period) 27 | { 28 | } 29 | #endregion 30 | 31 | #region --公开方法-- 32 | /// 33 | /// 返回表示当前对象的字符串 34 | /// 35 | /// 表示当前对象的字符串 36 | public override string ToString () 37 | { 38 | StringBuilder builder = new StringBuilder (); 39 | builder.AppendLine (string.Format ("ID: {0}", this.Id)); 40 | builder.AppendLine (string.Format ("名称: {0}", this.Name)); 41 | builder.AppendLine (string.Format ("标题: {0}", this.Title)); 42 | builder.AppendLine (string.Format ("函数: {0}", this.Function)); 43 | builder.AppendFormat ("刷新间隔: {0}", this.Period); 44 | return builder.ToString (); 45 | } 46 | #endregion 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Expand/BinaryWriterExpand.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.IO; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Expand 8 | { 9 | /// 10 | /// 类的扩展方法集 11 | /// 12 | public static class BinaryWriterExpand 13 | { 14 | #region --公开方法-- 15 | /// 16 | /// 将写入基础流的 数值 17 | /// 18 | /// 基础 对象 19 | /// 要写入的值 20 | /// 出现 I/O 错误。 21 | /// 流已关闭。 22 | /// buffer 为 null。 23 | public static void Write_Ex (this BinaryWriter binary, short value) 24 | { 25 | SetBinary (binary, BitConverter.GetBytes (value), true); 26 | } 27 | 28 | /// 29 | /// 将写入基础流的 数值 30 | /// 31 | /// 基础 对象 32 | /// 要写入的值 33 | /// 出现 I/O 错误。 34 | /// 流已关闭。 35 | /// buffer 为 null。 36 | public static void Write_Ex (this BinaryWriter binary, int value) 37 | { 38 | SetBinary (binary, BitConverter.GetBytes (value), true); 39 | } 40 | 41 | /// 42 | /// 将写入基础流的 数值 43 | /// 44 | /// 基础 对象 45 | /// 要写入的值 46 | /// 出现 I/O 错误。 47 | /// 流已关闭。 48 | /// buffer 为 null。 49 | public static void Write_Ex (this BinaryWriter binary, long value) 50 | { 51 | SetBinary (binary, BitConverter.GetBytes (value), true); 52 | } 53 | 54 | /// 55 | /// 将写入基础流的 数值 56 | /// 57 | /// 基础 对象 58 | /// 要写入的值 59 | /// 出现 I/O 错误。 60 | /// 流已关闭。 61 | /// buffer 为 null。 62 | public static void Write_Ex (this BinaryWriter binary, string value) 63 | { 64 | byte[] buffer = Encoding.Default.GetBytes (value); 65 | Write_Ex (binary, (short)buffer.Length); 66 | SetBinary (binary, buffer, false); 67 | } 68 | 69 | /// 70 | /// 将基础流转换为相同的字节数组 71 | /// 72 | /// 基础 对象 73 | public static byte[] ToArray (this BinaryWriter binary) 74 | { 75 | long position = binary.BaseStream.Position; // 记录原指针位置 76 | 77 | byte[] buffer = new byte[binary.BaseStream.Length]; 78 | binary.BaseStream.Position = 0; // 设置读取位置为 0 79 | binary.BaseStream.Read (buffer, 0, buffer.Length); 80 | 81 | binary.BaseStream.Position = position; // 还原原指针位置 82 | return buffer; 83 | } 84 | #endregion 85 | 86 | #region --私有方法-- 87 | private static void SetBinary (BinaryWriter binary, byte[] buffer, bool isReverse) 88 | { 89 | if (isReverse) 90 | { 91 | buffer = buffer.Reverse ().ToArray (); 92 | } 93 | binary.Write (buffer); 94 | } 95 | #endregion 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IAppDisable.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q应用禁用接口 12 | /// 13 | /// Type: 1004 14 | /// 15 | public interface IAppDisable 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q应用禁用 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void AppDisable (object sender, CQAppDisableEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IAppEnable.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q应用启用接口 12 | /// 13 | /// Type: 1003 14 | /// 15 | public interface IAppEnable 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q应用启用 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void AppEnable (object sender, CQAppEnableEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/ICQExit.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q退出事件接口 12 | /// 13 | /// Type: 1002 14 | /// 15 | public interface ICQExit 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q退出事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void CQExit (object sender, CQExitEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/ICQStartup.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q启动事件接口 12 | /// 13 | /// Type: 1001 14 | /// 15 | public interface ICQStartup 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q启动事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void CQStartup (object sender, CQStartupEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IDiscussMessage.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q讨论组消息接口 12 | /// 13 | /// Type: 4 14 | /// 15 | public interface IDiscussMessage 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q讨论组消息 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void DiscussMessage (object sender, CQDiscussMessageEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IFriendAdd.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q好友添加事件接口 12 | /// 13 | /// Type: 201 14 | /// 15 | public interface IFriendAdd 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q好友添加事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void FriendAdd (object sender, CQFriendAddEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IFriendAddRequest.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q好友添加请求事件接口 12 | /// 13 | /// Type: 301 14 | /// 15 | public interface IFriendAddRequest 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q好友添加请求事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void FriendAddRequest (object sender, CQFriendAddRequestEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupAddRequest.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群添加请求事件接口 12 | /// 13 | /// Type: 302 14 | /// 15 | public interface IGroupAddRequest 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群添加请求事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupAddRequest (object sender, CQGroupAddRequestEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupBanSpeak.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群禁言事件接口 12 | /// 13 | /// Type: 104 14 | /// 15 | public interface IGroupBanSpeak 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群禁言事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupBanSpeak (object sender, CQGroupBanSpeakEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupManageChange.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群管理变动事件接口 12 | /// 13 | /// Type: 101 14 | /// 15 | public interface IGroupManageChange 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群管理变动事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupManageChange (object sender, CQGroupManageChangeEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupMemberDecrease.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群成员减少事件接口 12 | /// 13 | /// Type: 102 14 | /// 15 | public interface IGroupMemberDecrease 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群成员减少事件接口 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupMemberDecrease (object sender, CQGroupMemberDecreaseEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupMemberIncrease.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群成员增加事件接口 12 | /// 13 | /// Type: 103 14 | /// 15 | public interface IGroupMemberIncrease 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群成员增加事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupMemberIncrease (object sender, CQGroupMemberIncreaseEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群聊消息接口 12 | /// 13 | /// Type: 2 14 | /// 15 | public interface IGroupMessage 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群聊消息 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupMessage (object sender, CQGroupMessageEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IGroupUpload.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q群上传事件接口 12 | /// 13 | /// Type: 11 14 | /// 15 | public interface IGroupUpload 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q群上传事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void GroupUpload (object sender, CQGroupUploadEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IMenuCall.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q调用菜单事件接口 12 | /// 13 | public interface IMenuCall 14 | { 15 | /// 16 | /// 当在派生类中重写时, 处理 酷Q调用菜单事件 回调 17 | /// 18 | /// 事件来源对象 19 | /// 附加的事件参数 20 | void MenuCall (object sender, CQMenuCallEventArgs e); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IPrivateMessage.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 9 | { 10 | /// 11 | /// 酷Q私聊消息事件接口 12 | /// 13 | /// Type: 21 14 | /// 15 | public interface IPrivateMessage 16 | { 17 | /// 18 | /// 当在派生类中重写时, 处理 酷Q私聊消息事件 回调 19 | /// 20 | /// 事件来源对象 21 | /// 附加的事件参数 22 | void PrivateMessage (object sender, CQPrivateMessageEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IStatusUpdate.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 2 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 10 | { 11 | /// 12 | /// 酷Q更新状态事件接口 13 | /// 14 | public interface IStatusUpdate 15 | { 16 | /// 17 | /// 当在派生类中重写时, 处理 酷Q更新状态事件 回调 18 | /// 19 | /// 事件来源对象 20 | /// 附加的事件参数 21 | /// 返回用于展示的 对象 22 | CQFloatWindow StatusUpdate (object sender, CQStatusUpdateEventArgs e); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Interface/IToSendString.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface 8 | { 9 | /// 10 | /// 转换发送字符串的接口 11 | /// 12 | public interface IToSendString 13 | { 14 | /// 15 | /// 当在派生类中重写时, 处理返回用于发送的字符串 16 | /// 17 | /// 用于发送的字符串 18 | string ToSendString (); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Model/AppInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model 8 | { 9 | /// 10 | /// 表示当前插件的一些基本信息的类 11 | /// 12 | public class AppInfo 13 | { 14 | #region --属性-- 15 | /// 16 | /// 获取当前应用的 AppID 17 | /// 18 | public string Id { get; private set; } 19 | 20 | /// 21 | /// 获取当前应用的返回码 22 | /// 23 | public int ResultCode { get; private set; } 24 | 25 | /// 26 | /// 获取当前应用的 Api 版本 27 | /// 28 | public int ApiVersion { get; private set; } 29 | 30 | /// 31 | /// 获取当前应用的名称 32 | /// 33 | public string Name { get; private set; } 34 | 35 | /// 36 | /// 获取当前应用的版本号 37 | /// 38 | public Version Version { get; private set; } 39 | 40 | /// 41 | /// 获取当前应用的顺序版本 42 | /// 43 | public int VersionId { get; private set; } 44 | 45 | /// 46 | /// 获取当前应用的作者名 47 | /// 48 | public string Author { get; private set; } 49 | 50 | /// 51 | /// 获取当前应用的说明文本 52 | /// 53 | public string Description { get; private set; } 54 | 55 | /// 56 | /// 获取当前应用的验证码 57 | /// 58 | public int AuthCode { get; private set; } 59 | #endregion 60 | 61 | #region --构造函数-- 62 | /// 63 | /// 初始化 类的新实例 64 | /// 65 | /// 当前应用appid 66 | /// 返回码 67 | /// api版本 68 | /// 应用名称 69 | /// 版本号 70 | /// 版本id 71 | /// 应用作者 72 | /// 应用说明 73 | /// 应用授权码 74 | public AppInfo (string id, int resCode, int apiVer, string name, string version, int versionId, string author, string description, int authCode) 75 | { 76 | this.Id = id; 77 | this.ResultCode = resCode; 78 | this.ApiVersion = apiVer; 79 | this.Name = name; 80 | this.Version = new Version (version); 81 | this.VersionId = versionId; 82 | this.Author = author; 83 | this.Description = description; 84 | this.AuthCode = authCode; 85 | } 86 | #endregion 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Model/BasisModel.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model 9 | { 10 | /// 11 | /// 描述酷Q数据模型的基础类, 该类是抽象的 12 | /// 13 | public abstract class BasisModel : IToSendString 14 | { 15 | #region --属性-- 16 | /// 17 | /// 获取当前模型持有用于扩展自身的 对象 18 | /// 19 | public CQApi CQApi { get; private set; } 20 | #endregion 21 | 22 | #region --构造函数-- 23 | /// 24 | /// 使用指定的 初始化当前类的新实例 25 | /// 26 | /// 模型使用的 27 | /// 参数: api 为 null 28 | public BasisModel (CQApi api) 29 | { 30 | if (api == null) 31 | { 32 | // throw new ArgumentNullException ("api"); 33 | } 34 | 35 | this.CQApi = api; 36 | } 37 | #endregion 38 | 39 | #region --公开方法-- 40 | /// 41 | /// 当在派生类中重写时, 处理返回用于发送的字符串 42 | /// 43 | /// 用于发送的字符串 44 | public abstract string ToSendString (); 45 | #endregion 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Cqp/Model/BasisStreamModel.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Sdk.Cqp.Model 10 | { 11 | /// 12 | /// 描述酷Q需要解析数据流模型的基础类, 该类是抽象的 13 | /// 14 | public abstract class BasisStreamModel : BasisModel, IToSendString 15 | { 16 | #region --构造函数-- 17 | /// 18 | /// 使用指定的密文初始化 类的新实例 19 | /// 20 | /// 模型使用的 21 | /// 模型使用的解密密文字符串 22 | /// 参数: api 或 cipherText 为 null 23 | /// cipherText 的长度(忽略空格)不是 0 或 4 的倍数。 或 cipherText 的格式无效。 cipherText 包含非 base 64 字符、两个以上的填充字符或者在填充字符中包含非空格字符 24 | public BasisStreamModel (CQApi api, string cipherText) 25 | : this (api, Convert.FromBase64String (cipherText)) 26 | { 27 | 28 | } 29 | /// 30 | /// 使用指定的密文初始化 类的新实例 31 | /// 32 | /// 模型使用的 33 | /// 模型使用的解密密文字节数组 34 | /// 参数: api 或 cipherBytes 为 null 35 | public BasisStreamModel (CQApi api, byte[] cipherBytes) 36 | : base (api) 37 | { 38 | using (BinaryReader reader = new BinaryReader (new MemoryStream (cipherBytes))) 39 | { 40 | this.Initialize (reader); 41 | } 42 | } 43 | #endregion 44 | 45 | #region --私有方法-- 46 | /// 47 | /// 当在派生类中重写时, 进行当前模型初始化 48 | /// 49 | /// 解析模型的数据源 50 | protected abstract void Initialize (BinaryReader reader); 51 | #endregion 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Sdk/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.Sdk")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Jie2GG")] 12 | [assembly: AssemblyProduct ("(Native)原生应用开发框架接口集")] 13 | [assembly: AssemblyCopyright ("Copyright © Microsoft 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("d7a958b3-79d9-49f8-8bb4-9619bab6ecba")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion ("2.8.6.0429")] 36 | [assembly: AssemblyFileVersion ("2.8.6.0429")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/Http/HttpTool.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Web; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.Http 8 | { 9 | /// 10 | /// Http 工具类 11 | /// 12 | public static class HttpTool 13 | { 14 | /// 15 | /// 使用默认编码对 URL 进行编码 16 | /// 17 | /// 要编码的地址 18 | /// 编码后的地址 19 | public static string UrlEncode (string url) 20 | { 21 | return HttpUtility.UrlEncode (url); 22 | } 23 | 24 | /// 25 | /// 使用指定的编码 对 URL 进行编码 26 | /// 27 | /// 要编码的地址 28 | /// 编码类型 29 | /// 编码后的地址 30 | public static string UrlEncode (string url, Encoding encoding) 31 | { 32 | return HttpUtility.UrlEncode (url, encoding); 33 | } 34 | 35 | /// 36 | /// 使用默认编码对 URL 进行解码 37 | /// 38 | /// 要解码的地址 39 | /// 编码后的地址 40 | public static string UrlDecode (string url) 41 | { 42 | return HttpUtility.UrlDecode (url); 43 | } 44 | 45 | /// 46 | /// 使用指定的编码 对 URL 进行解码 47 | /// 48 | /// 要解码的地址 49 | /// 编码类型 50 | /// 编码后的地址 51 | public static string UrlDecode (string url, Encoding encoding) 52 | { 53 | return HttpUtility.UrlDecode (url, encoding); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniConfigKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示 IniConfig 在序列化时将表示为键的特性 11 | /// 12 | [Obsolete("该类型跟随 IniConvert 类型过期")] 13 | [AttributeUsage (AttributeTargets.Property, AllowMultiple = false)] 14 | public sealed class IniConfigKeyAttribute : System.Attribute 15 | { 16 | /// 17 | /// 表示 IniConfig 文件中存储的键名称 18 | /// 19 | public string KeyName { get; set; } 20 | 21 | /// 22 | /// 初始化 类的新实例 23 | /// 24 | public IniConfigKeyAttribute () 25 | : this (null) 26 | { } 27 | 28 | /// 29 | /// 初始化 类的新实例 30 | /// 31 | /// 用于表示键值对 "键" 的名称 32 | public IniConfigKeyAttribute (string keyName) 33 | { 34 | this.KeyName = keyName; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniConfigSectionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示 IniConfig 在序列化时将表示为节的特性 11 | /// 12 | [Obsolete ("该类型跟随 IniConvert 类型过期")] 13 | [AttributeUsage (AttributeTargets.Class | AttributeTargets.Struct)] 14 | public sealed class IniConfigSectionAttribute : System.Attribute 15 | { 16 | /// 17 | /// 表示 IniConfig 中存储的节名称 18 | /// 19 | public string SectionName { get; set; } 20 | 21 | /// 22 | /// 初始化 类的新实例 23 | /// 24 | public IniConfigSectionAttribute () 25 | : this (null) 26 | { } 27 | 28 | /// 29 | /// 初始化 类的新实例 30 | /// 31 | /// 用于表示节点的节名称 32 | public IniConfigSectionAttribute (string sectionName) 33 | { 34 | this.SectionName = sectionName; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniKeyAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示配置项 (Ini) 文件键名称的特性 11 | /// 12 | [AttributeUsage (AttributeTargets.Property)] 13 | public sealed class IniKeyAttribute : System.Attribute 14 | { 15 | #region --字段-- 16 | private string _keyName; 17 | #endregion 18 | 19 | #region --属性-- 20 | /// 21 | /// 获取或设置配置项 (Ini) 键名称 22 | /// 23 | public string KeyName 24 | { 25 | get { return this._keyName; } 26 | set 27 | { 28 | if (string.IsNullOrEmpty (value)) 29 | { 30 | throw new ArgumentException ("传入的字符串不允许用来设置键名称, 原因: 键名称不能为空", "value"); 31 | } 32 | this._keyName = value; 33 | } 34 | } 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniNonSerializeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示对象不参与 IniConfig 的序列化的特性 11 | /// 12 | [Obsolete ("该类型跟随 IniConvert 类型过期")] 13 | [AttributeUsage (AttributeTargets.Property)] 14 | public sealed class IniNonSerializeAttribute : System.Attribute 15 | { 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniSectionAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示配置项 (Ini) 文件节名称的特性 11 | /// 12 | [AttributeUsage (AttributeTargets.Class)] 13 | public sealed class IniSectionAttribute : System.Attribute 14 | { 15 | #region --字段-- 16 | private string _sectionName; 17 | #endregion 18 | 19 | #region --属性-- 20 | /// 21 | /// 获取或设置配置项 (Ini) 节名称 22 | /// 23 | public string SectionName 24 | { 25 | get { return this._sectionName; } 26 | set 27 | { 28 | if (string.IsNullOrEmpty (value)) 29 | { 30 | throw new ArgumentException ("传入的字符串不允许用来设置节名称, 原因: 节名称不能为空", "value"); 31 | } 32 | this._sectionName = value; 33 | } 34 | } 35 | #endregion 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Attribute/IniSerializeAttribute.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Attribute 8 | { 9 | /// 10 | /// 表示对象参数 IniConfig 对象序列化的特性 11 | /// 12 | [Obsolete ("该类型跟随 IniConvert 类型过期")] 13 | [AttributeUsage (AttributeTargets.Property)] 14 | public class IniSerializeAttribute : System.Attribute 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Exception/IniConfigException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.Serialization; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Exception 9 | { 10 | /// 11 | /// 表示 IniConfig 运行期间发生的错误 12 | /// 13 | [Obsolete ("该类型跟随 IniConvert 类型过期")] 14 | public class IniConfigException : System.Exception 15 | { 16 | /// 17 | /// 初始化 类的新实例 18 | /// 19 | public IniConfigException () 20 | { 21 | } 22 | 23 | /// 24 | /// 用指定的错误消息初始化 类的新实例 25 | /// 26 | /// 描述错误的消息 27 | public IniConfigException (string message) : base (message) 28 | { 29 | } 30 | 31 | /// 32 | /// 使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 类的新实例 33 | /// 34 | /// 解释异常原因的错误消息 35 | /// 导致当前异常的异常;如果未指定内部异常,则是一个 null 引用(在 Visual Basic 中为 Nothing) 36 | public IniConfigException (string message, System.Exception innerException) : base (message, innerException) 37 | { 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Exception/PropertyNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using me.cqp.luohuaming.WordCloud.Tool.IniConfig; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Exception 9 | { 10 | /// 11 | /// 表示属性找不到的异常 12 | /// 13 | [Obsolete ("该类型跟随 IniConfigException 类型过期")] 14 | public sealed class PropertyNotFoundException : IniConfigException 15 | { 16 | /// 17 | /// 初始化 类的新实例 18 | /// 19 | public PropertyNotFoundException () 20 | { 21 | } 22 | 23 | /// 24 | /// 用指定的错误消息初始化 类的新实例 25 | /// 26 | /// 描述错误的消息 27 | public PropertyNotFoundException (string message) 28 | : base (message) 29 | { 30 | } 31 | 32 | /// 33 | /// 使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 类的新实例 34 | /// 35 | /// 解释异常原因的错误消息 36 | /// 导致当前异常的异常;如果未指定内部异常,则是一个 null 引用(在 Visual Basic 中为 Nothing) 37 | public PropertyNotFoundException (string message, System.Exception innerException) 38 | : base (message, innerException) 39 | { 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Exception/SectionNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Exception 8 | { 9 | /// 10 | /// 表示 "节" 找不到的异常 11 | /// 12 | [Obsolete ("该类型跟随 IniConfigException 类型过期")] 13 | public class SectionNotFoundException : IniConfigException 14 | { 15 | /// 16 | /// 初始化 类的新实例 17 | /// 18 | public SectionNotFoundException () 19 | { 20 | } 21 | 22 | /// 23 | /// 用指定的错误消息初始化 类的新实例 24 | /// 25 | /// 描述错误的消息 26 | public SectionNotFoundException (string message) : base (message) 27 | { 28 | } 29 | 30 | /// 31 | /// 使用指定的错误消息和对作为此异常原因的内部异常的引用来初始化 类的新实例 32 | /// 33 | /// 解释异常原因的错误消息 34 | /// 导致当前异常的异常;如果未指定内部异常,则是一个 null 引用(在 Visual Basic 中为 Nothing) 35 | public SectionNotFoundException (string message, System.Exception innerException) : base (message, innerException) 36 | { 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Linq/IValueType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Linq 9 | { 10 | [DefaultValue (IValueType.String)] 11 | public enum IValueType 12 | { 13 | /// 14 | /// 一个空引用 15 | /// 16 | Empty, 17 | /// 18 | /// 表示布尔值的简单类型 19 | /// 20 | Boolean, 21 | /// 22 | /// 表示整数值的类型 23 | /// 24 | Integer, 25 | /// 26 | /// 表示浮点数值的类型 27 | /// 28 | Float, 29 | /// 30 | /// 表示日期和时间值的类型 31 | /// 32 | DateTime, 33 | /// 34 | /// 表示时间间的类型 35 | /// 36 | TimeSpan, 37 | /// 38 | /// 表示字节数组的类型 39 | /// 40 | Bytes, 41 | /// 42 | /// 表示 Unicode 字符字符串的密封的类类型 43 | /// 44 | String, 45 | /// 46 | /// 表示全局唯一标识(GUID)的类型 47 | /// 48 | Guid, 49 | /// 50 | /// 表示统一资源标识符 (URI) 的类型 51 | /// 52 | Uri 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/README.md: -------------------------------------------------------------------------------- 1 | ## IniConfig 自述 2 | 3 | IniConfig 是基于 C# 开发, 针对于 Windows 平台下 Ini 配置文件的一款工具类, 4 | 该工具能快速的将 Ini 配置文件的 "节点", "键", "值", "注释" 分开, 在轻松实现对 5 | Ini 配置文件的增删改查的同时, 可直接移植到其它平台使用. 6 | 7 | ## IniConfig 示例 8 | 9 | > 1. 创建一个新的 Ini 配置项 10 | 11 | ```C# 12 | // 适用于 VS2012 ~ VS2017 的通用方式 13 | 14 | IniSection iSection = new IniSection ("节点"); // 创建一个新的 "节点" 对象, 并且名称叫做 "节点", 相当于 [节点] 15 | iSection.Add ("键1", "值1"); // 在一个节点中添加一个键值对, 相当于 键1=值1 16 | iSection.Add ("key2", true); // Add 方法, 支持所有的基础数据类型进行自动转换 17 | iSection.Add ("key3", 0x01); 18 | iSection.Add ("key4", 10.456); 19 | iSection.Add ("Key5", DateTime.Now); // 甚至支持时间的直接添加, 具体请看重载列表 20 | 21 | IniObject iObject = new IniObject (); 22 | iObject.Add (iSection); // 将一个 "节点" 添加到文件中 23 | iObject.Save ("1.ini"); // 将该文件保存, 参数1: 填写具体保存的路径, 可以是相对路径, 也可以是绝对路径 24 | 25 | // 适用于 VS2017 的新方式 26 | 27 | IniObject iObject = new IniObject () 28 | { 29 | new IniSection ("节点1") 30 | { 31 | { "键1", "值1"}, 32 | { "Key2", 123456}, 33 | { "Key3", true} 34 | }, 35 | new IniSection ("节点2") 36 | { 37 | { "key1", DateTime.Now} 38 | } 39 | }; 40 | iObject.Save ("1.ini"); 41 | ``` 42 | 43 | >2. 从文件中读取 Ini 配置项 44 | 45 | ```C# 46 | // 适用于 VS2012 ~ VS2017 的通用方式 47 | 48 | IniObject iObject = IniObject.Load ("1.ini", Encoding.Default); // 从指定的文件中读取 Ini 配置项, 参数1: 文件路径, 参数2: 编码格式 [默认: ANSI] 49 | iObject = IniObject.Parse ("[节点]\n键1=值1"); // 当然也可以通过字符串进行解析 50 | ``` 51 | 52 | >3. 查询 Ini 配置文件 53 | 54 | ```C# 55 | // 适用于 VS2012 ~ VS2017 的通用方式 56 | 57 | // 对节点进行查询, 通过 "索引" 或 "名称" 的方式快速获取 58 | IniSection section1 = iObject[0]; // 通过 索引 59 | IniSection section2 = iObject["节点"]; // 通过 名称 60 | 61 | // 对节点中内容进行查询, 通过 "名称" 的方式快速获取 62 | IniValue value1 = section1["键1"]; // 通过 名称 63 | 64 | // 拿取 Value 的值 65 | value1.ToString (); // 提供众多方式, 对基础数据类型的转换提供支持 66 | value1.ToInt32 (); 67 | value1.ToDouble (); 68 | value1.ToByte (); 69 | Convert.ToDateTime (value1); // 当然也可以使用 Convert 70 | 71 | // 快速拿取 Value 72 | IniValue value2 = iObject["节点"]["键1"]; 73 | ``` 74 | 75 | >4. 修改 Ini 配置文件 76 | 77 | ```C# 78 | //适用于 VS2012 ~ VS2017 的通用方式 79 | 80 | IniObject iObject = IniObject.Load ("1.ini"); 81 | iObject["节点1"]["键1"] = new IniValue ("更新值"); // 因为无法重载 = 运算符, 所以没办法只能 new 对象 82 | iObject["节点1"]["键1"] = new IniValue (10); 83 | iObject["节点1"]["键1"].Value = "更新值"; // 适用于字符串的时候 84 | iObject.Save (); 85 | ``` 86 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Utilities/ConvertUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Globalization; 4 | using System.Linq; 5 | using System.Numerics; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Utilities 10 | { 11 | internal static class ConvertUtils 12 | { 13 | internal static TimeSpan StringToTimeSpan (string input) 14 | { 15 | return TimeSpan.Parse (input, CultureInfo.InvariantCulture); 16 | } 17 | 18 | internal static BigInteger ToBigInteger (object value) 19 | { 20 | if (value is BigInteger) 21 | { 22 | return (BigInteger)value; 23 | } 24 | 25 | string value2 = value as string; 26 | if (value2 != null) 27 | { 28 | return BigInteger.Parse (value2, CultureInfo.InvariantCulture); 29 | } 30 | if (value is float) 31 | { 32 | float value3 = (float)value; 33 | return new BigInteger (value3); 34 | } 35 | if (value is double) 36 | { 37 | double value4 = (double)value; 38 | return new BigInteger (value4); 39 | } 40 | if (value is decimal) 41 | { 42 | decimal value5 = (decimal)value; 43 | return new BigInteger (value5); 44 | } 45 | if (value is int) 46 | { 47 | int value6 = (int)value; 48 | return new BigInteger (value6); 49 | } 50 | if (value is long) 51 | { 52 | long value7 = (long)value; 53 | return new BigInteger (value7); 54 | } 55 | if (value is uint) 56 | { 57 | uint value8 = (uint)value; 58 | return new BigInteger (value8); 59 | } 60 | if (value is ulong) 61 | { 62 | ulong value9 = (ulong)value; 63 | return new BigInteger (value9); 64 | } 65 | byte[] value10; 66 | if ((value10 = (value as byte[])) != null) 67 | { 68 | return new BigInteger (value10); 69 | } 70 | 71 | throw new InvalidCastException (string.Format ("无法将 {0} 转换为 BigInteger.", value.GetType ().Name)); 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Utilities/MathUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Utilities 8 | { 9 | internal class MathUtils 10 | { 11 | internal static bool ApproxEquals(double a, double b) 12 | { 13 | if (a == b) 14 | { 15 | return true; 16 | } 17 | double num = (Math.Abs (a) + Math.Abs (b) + 10.0) * 2.2204460492503131E-16; 18 | double num2 = a - b; 19 | return -num < num2 && num > num2; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Utilities/MiscellaneousUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Utilities 8 | { 9 | internal class MiscellaneousUtils 10 | { 11 | internal static int ByteArrayCompare (byte[] b1, byte[] b2) 12 | { 13 | int num = b1.Length.CompareTo (b2.Length); 14 | if (num != 0) 15 | { 16 | return num; 17 | } 18 | for (int i = 0; i < b1.Length; i++) 19 | { 20 | int temp = b1[i].CompareTo (b2[i]); 21 | if (temp != 0) 22 | { 23 | return temp; 24 | } 25 | } 26 | return 0; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/IniConfig/Utilities/ReflectionUtils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.Tool.IniConfig.Utilities 8 | { 9 | internal class ReflectionUtils 10 | { 11 | internal static bool IsNullableType (Type t) 12 | { 13 | if (t == null) 14 | { 15 | throw new ArgumentNullException ("t"); 16 | } 17 | 18 | return t.IsGenericType && t.GetGenericTypeDefinition () == typeof (Nullable<>); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.Tool/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.Tool")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany ("Jie2GG")] 12 | [assembly: AssemblyProduct ("(Native)原生应用开发框架工具集")] 13 | [assembly: AssemblyCopyright ("Copyright © Microsoft 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("0ca93eb9-4e25-46c6-94d2-0f97137a1606")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion ("3.3.2.0501")] 36 | [assembly: AssemblyFileVersion ("3.3.2.0501")] 37 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace me.cqp.luohuaming.WordCloud.UI 10 | { 11 | /// 12 | /// App.xaml 的交互逻辑 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/Event_MenuCall.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.EventArgs; 4 | using me.cqp.luohuaming.WordCloud.Sdk.Cqp.Interface; 5 | using PublicInfos; 6 | 7 | namespace me.cqp.luohuaming.WordCloud.UI 8 | { 9 | public class Event_MenuCall : IMenuCall 10 | { 11 | private MainWindow window = null; 12 | public void MenuCall(object sender, CQMenuCallEventArgs e) 13 | { 14 | try 15 | { 16 | if (window == null) 17 | { 18 | Thread thread = new Thread(() => 19 | { 20 | window = new MainWindow(); 21 | window.Closing += Window_Closing; 22 | window.ShowDialog(); 23 | }); 24 | thread.SetApartmentState(ApartmentState.STA); 25 | thread.Start(); 26 | } 27 | else 28 | { 29 | window.Activate(); 30 | } 31 | } 32 | catch (Exception exc) 33 | { 34 | MainSave.CQLog.Info("Error", exc.Message, exc.StackTrace); 35 | } 36 | } 37 | 38 | /// 39 | ///窗体关闭时触发 40 | /// 41 | private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) 42 | { 43 | window = null; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/MainWindow.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/MainWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows; 7 | using System.Windows.Controls; 8 | using System.Windows.Data; 9 | using System.Windows.Documents; 10 | using System.Windows.Input; 11 | using System.Windows.Media; 12 | using System.Windows.Media.Imaging; 13 | using System.Windows.Navigation; 14 | using System.Windows.Shapes; 15 | 16 | namespace me.cqp.luohuaming.WordCloud.UI 17 | { 18 | /// 19 | /// MainWindow.xaml 的交互逻辑 20 | /// 21 | public partial class MainWindow : Window 22 | { 23 | public MainWindow() 24 | { 25 | InitializeComponent(); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // 有关程序集的一般信息由以下 8 | // 控制。更改这些特性值可修改 9 | // 与程序集关联的信息。 10 | [assembly: AssemblyTitle("me.cqp.luohuaming.WordCloud.UI")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("")] 14 | [assembly: AssemblyProduct("me.cqp.luohuaming.WordCloud.UI")] 15 | [assembly: AssemblyCopyright("Copyright © 2021")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // 将 ComVisible 设置为 false 会使此程序集中的类型 20 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 21 | //请将此类型的 ComVisible 特性设置为 true。 22 | [assembly: ComVisible(false)] 23 | 24 | //若要开始生成可本地化的应用程序,请设置 25 | //.csproj 文件中的 CultureYouAreCodingWith 26 | //例如,如果您在源文件中使用的是美国英语, 27 | //使用的是美国英语,请将 设置为 en-US。 然后取消 28 | //对以下 NeutralResourceLanguage 特性的注释。 更新 29 | //以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //主题特定资源词典所处位置 36 | //(未在页面中找到资源时使用, 37 | //或应用程序资源字典中找到时使用) 38 | ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 39 | //(未在页面中找到资源时使用, 40 | //、应用程序或任何主题专用资源字典中找到时使用) 41 | )] 42 | 43 | 44 | // 程序集的版本信息由下列四个值组成: 45 | // 46 | // 主版本 47 | // 次版本 48 | // 生成号 49 | // 修订号 50 | // 51 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 52 | //通过使用 "*",如下所示: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace me.cqp.luohuaming.WordCloud.UI.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// 一个强类型的资源类,用于查找本地化的字符串等。 17 | /// 18 | // 此类是由 StronglyTypedResourceBuilder 19 | // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 20 | // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen 21 | // (以 /str 作为命令选项),或重新生成 VS 项目。 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// 返回此类使用的缓存的 ResourceManager 实例。 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("me.cqp.luohuaming.WordCloud.UI.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// 重写当前线程的 CurrentUICulture 属性,对 51 | /// 使用此强类型资源类的所有资源查找执行重写。 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // 此代码由工具生成。 4 | // 运行时版本:4.0.30319.42000 5 | // 6 | // 对此文件的更改可能会导致不正确的行为,并且如果 7 | // 重新生成代码,这些更改将会丢失。 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace me.cqp.luohuaming.WordCloud.UI.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /me.cqp.luohuaming.WordCloud.UI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------