コード例 #1
0
 public void AddResource(ResourceData data)
 {
     foreach (var name in data.Names)
     {
         resources.Add(name, data);
     }
 }
コード例 #2
0
        private void ProcessResources()
        {
            resources = new ResourcesData();

            if (verbose) Console.WriteLine("Processing resource files");

            foreach (var resFile in resFiles)
            {
                if (verbose) Console.WriteLine(" Processing resource file {0}", resFile);

                var resource = new ResourceData(Path.GetFileNameWithoutExtension(resFile));
                using (var reader = new ResourceReader(resFile))
                {
                    IDictionaryEnumerator en = reader.GetEnumerator();
                    while (en.MoveNext())
                    {
                        resource.Data.Add(en.Key.ToString(), en.Value.ToString());
                    }
                }

                resources.AddResource(resource);
            }

            if (resources.GetResourceNames().Length == 0)
                throw new ApplicationException("No resources found");
        }