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
            public ChildHandles(THandle impl, AssociatedHandlesCollection <HandleGraph <THandle> > children)
                : base(impl)
            {
                if (children == null)
                {
                    throw new ArgumentNullException(nameof(children));
                }

                children_ = children;
            }
Esempio n. 3
0
 internal static HandleGraph <THandle> Composite(THandle impl, AssociatedHandlesCollection <HandleGraph <THandle> > children)
 => new ChildHandles(impl, children);