Esempio n. 1
0
        internal static AssociatedHandlesCollection <HandleGraph <FilterHandle> > Build
            (Encoding encoding, IReadOnlyList <Filter> filters)
        {
            var result = new AssociatedHandlesCollection <HandleGraph <FilterHandle> > (filters.Count);

            try
            {
                foreach (var filter in filters)
                {
                    var filterHandle = filter.Build(encoding);
                    result.Add(filterHandle);
                }

                return(result);
            }
            catch (Exception initEx)
            {
                try
                {
                    result.Dispose();
                }
                catch (Exception cleanupEx)
                {
                    throw new AggregateException(initEx, cleanupEx);
                }

                throw;
            }
        }
Esempio n. 2
0
 protected override void DisposeChildren() => children_.Dispose();