BamlLocalization.InputBamlStreamList.InputBamlStreamList C# (CSharp) Метод

InputBamlStreamList() приватный Метод

constructor
private InputBamlStreamList ( LocBamlOptions options ) : System
options LocBamlOptions
Результат System
        internal InputBamlStreamList(LocBamlOptions options)
        {
            _bamlStreams  = new ArrayList();
            switch(options.InputType)
            {
                case FileType.BAML:
                {
                    _bamlStreams.Add(
                        new BamlStream(
                            Path.GetFileName(options.Input),
                            File.OpenRead(options.Input)
                            )
                    );
                    break;
                }
                case FileType.RESOURCES:
                {
                    using (ResourceReader resourceReader = new ResourceReader(options.Input))
                    {
                        // enumerate all bamls in a resources
                        EnumerateBamlInResources(resourceReader, options.Input);
                    }
                    break;
                }
            case FileType.EXE:
                case FileType.DLL:
                {
                    // for a dll, it is the same idea
                    Assembly assembly = Assembly.LoadFrom(options.Input);
                    foreach (string resourceName in assembly.GetManifestResourceNames())
                    {
                        ResourceLocation resourceLocation = assembly.GetManifestResourceInfo(resourceName).ResourceLocation;

                        // if this resource is in another assemlby, we will skip it
                        if ((resourceLocation & ResourceLocation.ContainedInAnotherAssembly) != 0)
                        {
                            continue;   // in resource assembly, we don't have resource that is contained in another assembly
                        }

                        Stream resourceStream = assembly.GetManifestResourceStream(resourceName);
                        using (ResourceReader reader = new ResourceReader(resourceStream))
                        {
                            EnumerateBamlInResources(reader, resourceName);
                        }
                    }
                    break;
                }
                default:
                {

                    Debug.Assert(false, "Not supported type");
                    break;
                }
            }
        }