예제 #1
0
        public object applyOn(SpotterMultipart spotter)
        {
            spotter.Reset();
            while (spotter.HasNextPart())
            {
                var s    = spotter.GetNextPart();
                var o    = s.Accept(this);
                var part = o as MailMsg;
                if (part != null && !part.IsEmpty)
                {
                    return(part);
                }
                spotter.UnloadPart(s);
            }

            return(new MailMsg());
        }
        public object applyOn(SpotterMultipart spotter)
        {
            var list = new List <MailMsg>();

            spotter.Reset();
            while (spotter.HasNextPart())
            {
                var s        = spotter.GetNextPart();
                var o        = s.Accept(this);
                var partList = o as List <MailMsg>;
                if (partList != null)
                {
                    list.AddRange(partList);
                }
                spotter.UnloadPart(s);
            }

            return(list);
        }