Exemplo n.º 1
0
        public override IEnumerable <KeyValuePair <string, string> > GetRichDescription()
        {
            if (_yielded.Any() || Sent.Any() || Returned.Any())
            {
                yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Misc, "["));

                if (_yielded.Any())
                {
                    foreach (var kv in _yielded.GetRichDescriptions(unionPrefix: "[", unionSuffix: "]"))
                    {
                        yield return(kv);
                    }
                }
                else
                {
                    yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Misc, "[]"));
                }

                if (Sent.Any())
                {
                    yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Comma, ", "));

                    foreach (var kv in Sent.GetRichDescriptions(unionPrefix: "[", unionSuffix: "]"))
                    {
                        yield return(kv);
                    }
                }
                else if (Returned.Any())
                {
                    yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Comma, ", "));

                    yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Misc, "[]"));
                }

                if (Returned.Any())
                {
                    yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Comma, ", "));

                    foreach (var kv in Sent.GetRichDescriptions(unionPrefix: "[", unionSuffix: "]"))
                    {
                        yield return(kv);
                    }
                }
                yield return(new KeyValuePair <string, string>(WellKnownRichDescriptionKinds.Misc, "]"));
            }
        }