Exemplo n.º 1
0
        protected object Process(ParameterInfo info, IrcMessageEventArgs args)
        {
            if (info.ParameterType == typeof(IrcMessageEventArgs))
            {
                return(args);
            }
            else if (info.ParameterType == typeof(Encoding))
            {
                return(args.Encoding);
            }
            else if (info.ParameterType == typeof(IIrcMessageSource))
            {
                return(args.Source);
            }
            else if (info.ParameterType == typeof(IIrcMessageTarget))
            {
                return(args.Targets.First());
            }
            else if (info.ParameterType == typeof(IList <IIrcMessageTarget>))
            {
                return(args.Targets);
            }
            else if (info.ParameterType == typeof(IEnumerable <IIrcMessageTarget>))
            {
                return(args.Targets);
            }
            else if (info.ParameterType == typeof(string))
            {
                var target = args.Targets.First();
                switch (info.Name.ToLower())
                {
                case "destination":
                case "dest":
                    return(args.GetDestination());

                case "target":
                    return(target.Name);

                case "nick":
                case "source":
                    return(args.Source.Name);

                case "message":
                case "msg":
                case "text":
                    return(args.Text);
                }
            }
            return(null);
        }
Exemplo n.º 2
0
 internal void HandleMessageReceived(object sender, IrcMessageEventArgs e)
 {
     destination = e.GetDestination();
     HandleMessageReceived(MessageType.Query, sender, e);
     destination = null;
 }