예제 #1
0
        public static Stream GetEmbeddedPackage(EmbeddedPackage package)
        {
            using (Stream stream = package.Assembly.GetManifestResourceStream(package.ManifestResourceName)) {
                ResourceSet set = new ResourceSet(stream);
                foreach (DictionaryEntry e in set)
                {
                    String k = e.Key as String;
                    if (k == null)
                    {
                        continue;
                    }

                    if (k.EndsWith("_anop", StringComparison.Ordinal))
                    {
                        k = k.Substring(0, k.Length - 5);

                        if (k == package.Name)
                        {
                            return(e.Value as Stream);
                        }
                    }
                }
            }

            throw new AnolisException("Unable to load embedded package.");
        }
예제 #2
0
 public static Stream GetEmbeddedPackage(EmbeddedPackage package)
 {
     return(package.Assembly.GetManifestResourceStream(package.ManifestResourceName));
 }