예제 #1
0
        static EFVariant[] Substract(EFVariant[] variants, string path)
        {
            var variantsList = variants.ToList();

            try
            {
                Dictionary <string, EFSource> sources;
                using (var input = File.OpenRead(path))
                {
                    sources = EFParser.LocateSources(input);
                    foreach (var pair in sources)
                    {
                        foreach (var variant in variants)
                        {
                            if (pair.Key == variant.ToString())
                            {
                                variantsList.Remove(variant);
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }

            return(variantsList.ToArray());
        }
예제 #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="streamOpener"></param>
        public MultiVariantEffect(Func <Stream> streamOpener)
        {
            if (streamOpener == null)
            {
                throw new ArgumentNullException("streamOpener");
            }

            _streamOpener = streamOpener;
            using (var stream = _streamOpener())
            {
                _sources = EFParser.LocateSources(stream);
            }
        }