コード例 #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;
            }
        }
コード例 #2
0
ファイル: HandleGraph.cs プロジェクト: erisonliang/Log4JDash
 protected override void DisposeChildren() => children_.Dispose();