Esempio n. 1
0
        public static AvailabilityAttribute Merge(IEnumerable <object> attrs)
        {
            AvailabilityAttribute merged = null;

            foreach (var attr in attrs)
            {
                var aattr = attr as AvailabilityAttribute;
                if (aattr == null)
                {
                    continue;
                }

                if (merged == null)
                {
                    merged = new AvailabilityAttribute();
                }

                merged.Introduced  |= aattr.Introduced;
                merged.Obsoleted   |= aattr.Obsoleted;
                merged.Deprecated  |= aattr.Deprecated;
                merged.Unavailable |= aattr.Unavailable;
                if (!String.IsNullOrEmpty(aattr.Message))
                {
                    if (!String.IsNullOrEmpty(merged.Message))
                    {
                        merged.Message += "; ";
                    }
                    merged.Message += aattr.Message;
                }
            }

            return(merged);
        }
Esempio n. 2
0
        public static AvailabilityAttribute Merge(IEnumerable<object> attrs)
        {
            AvailabilityAttribute merged = null;

            foreach (var attr in attrs) {
                var aattr = attr as AvailabilityAttribute;
                if (aattr == null)
                    continue;

                if (merged == null)
                    merged = new AvailabilityAttribute ();

                merged.Introduced |= aattr.Introduced;
                merged.Obsoleted |= aattr.Obsoleted;
                merged.Deprecated |= aattr.Deprecated;
                merged.Unavailable |= aattr.Unavailable;
                if (!String.IsNullOrEmpty (aattr.Message)) {
                    if (!String.IsNullOrEmpty (merged.Message))
                        merged.Message += "; ";
                    merged.Message += aattr.Message;
                }
            }

            return merged;
        }