示例#1
0
        public static Message Hello(string body, Guid userGuid, Guid serviceGuid, string commandText = null)
        {
            Guid serviceGuidContext = Guid.Empty;

            if (ServiceItemRepository.GetServiceItems().Any(s => s.GUID == serviceGuid))
            {
                serviceGuidContext = serviceGuid;
            }

            return(new Message
            {
                UserGuid = userGuid,
                ServiceGuid = serviceGuidContext,
                Date = DateTime.UtcNow,
                GUID = Guid.NewGuid(),
                Body = body,
                Command = 0,
                Commands = new List <CommandItem>(),
                CommandText = commandText,
                IsFile = false,
                IsSending = false,
                IsMy = false,
            });
        }
示例#2
0
 public static ServiceItem GetServiceItem(Message source)
 {
     return(ServiceItemRepository
            .GetServiceItems()
            .FirstOrDefault(s => s.GUID == (source.ServiceGuid ?? Guid.Empty)));
 }