"景先生毕设|www.jxszl.com

C# ChatEvent类代码示例

2023-12-29 17:43编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中ChatEvent类的典型用法代码示例。如果您正苦于以下问题:C#ChatEvent类的具体用法?C#ChatEvent怎么用?C#ChatEvent使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:PostEvents publicvoidPostEvents(GuidchannelID,byte[]mainPasswordHash,ClientEvent[]args) { varchannel=(fromchinServices.DataConnection.Channels wherech.ChannelID==channelID&&ch.MainPasswordHash==mainPasswordHash selectch).FirstOrDefault(); if(channel!=null) { vareventCount=Services.ExistingEvents[channelID].Count; if(eventCount>50) { vareventsToDelete=(fromevinServices.DataConnection.ChatEvents whereev.ChannelID==channelID orderbyev.EventIDascending selectev).Take(10); Services.DataConnection.ChatEvents.DeleteAllOnSubmit(eventsToDelete); Services.ExistingEvents[channelID].RemoveRange(0,10); } foreach(ClientEventevinargs) { ChatEventnewEvent=newChatEvent(){ChannelID=channelID,EventData=Serialize(ev.EventData),Type=(int)ev.EventType}; Services.DataConnection.ChatEvents.InsertOnSubmit(newEvent); Services.ExistingEvents[channelID].Add(newEvent); } Services.DataConnection.SubmitChanges(); } }
原文链接:http://www.jxszl.com/biancheng/C/556734.html