示例#1
0
        public override IResourceFile CreateNewFile(CultureInfo culture)
        {
            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ResourceManager.Templates.EmptyResxFile.xml");
            XmlDocument xml = new XmlDocument();
            xml.Load(stream);

            string filepath = Path.Combine(this.FileGroupPath, this.Prefix + "." + culture.Name + ".resx");
            xml.Save(filepath);

            VSResxFile vsfile = new VSResxFile(this.Container, new FileInfo(filepath));
            this.Add(vsfile);

            return vsfile;
        }
示例#2
0
        public VSResxData(VSResxFile file, XPathNavigator nav)
            : base(file)
        {
            Name = nav.GetAttribute("name", "");

            XPathNodeIterator values = nav.Select("value");
            if (values.MoveNext())
            {
                xmlValue = values.Current.Value;
            }
            values = nav.Select("comment");
            if (values.MoveNext())
            {
                comment = values.Current.Value;
            }
        }
示例#3
0
        public override IResourceFile CreateNewFile(CultureInfo culture)
        {
            Stream      stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ResourceManager.Templates.EmptyResxFile.xml");
            XmlDocument xml    = new XmlDocument();

            xml.Load(stream);

            string filepath = Path.Combine(this.FileGroupPath, this.Prefix + "." + culture.Name + ".resx");

            xml.Save(filepath);

            VSResxFile vsfile = new VSResxFile(this.Container, new FileInfo(filepath));

            this.Add(vsfile);

            return(vsfile);
        }
示例#4
0
        public VSResxData(VSResxFile file, XPathNavigator nav)
            : base(file)
        {
            Name = nav.GetAttribute("name", "");

            XPathNodeIterator values = nav.Select("value");

            if (values.MoveNext())
            {
                xmlValue = values.Current.Value;
            }
            values = nav.Select("comment");
            if (values.MoveNext())
            {
                comment = values.Current.Value;
            }
        }
示例#5
0
        protected virtual void Init(string filepath)
        {
            directory = new DirectoryInfo(Path.Combine(Project.Solution.SolutionDirectory.FullName, filepath));

            IResourceFile resxfile = null;
            FileInfo[] files = directory.GetFiles("*.resx", SearchOption.TopDirectoryOnly);
            Files = new List<IResourceFile>();
            foreach (FileInfo file in files)
            {
                resxfile = new VSResxFile(this, file);

                string fileGroupId = this.ID + "_" + resxfile.Prefix;

                if (!Project.ResxGroups.ContainsKey(fileGroupId))
                    Project.ResxGroups.Add(fileGroupId, new VSResxFileGroup(this, resxfile.Prefix, file.DirectoryName));

                Project.ResxGroups[fileGroupId].Add(resxfile);
                Files.Add(resxfile);
            }

            // Localization file for Windows Installer XML toolkit (WiX)
            files = directory.GetFiles("*.wxl", SearchOption.TopDirectoryOnly);
            foreach (FileInfo file in files)
            {
                resxfile = new WixLocalizationFile(this, file);

                string fileGroupId = this.ID + "_" + resxfile.Prefix;
                if (!Project.ResxGroups.ContainsKey(fileGroupId))
                    Project.ResxGroups.Add(fileGroupId, new VSResxFileGroup(this, resxfile.Prefix, file.DirectoryName));

                Project.ResxGroups[fileGroupId].Add(resxfile);
                Files.Add(resxfile);
            }

            Directories = new List<VSProjectFolder>();
            foreach (DirectoryInfo dir in directory.GetDirectories())
            {
                if (dir.Name == "obj" || dir.Name == "bin")
                    continue;

                VSProjectFolder folder = new VSProjectFolder(Project, this, dir.FullName);

                if (folder.ContainsFiles())
                    Directories.Add(folder);
            }
        }
示例#6
0
 public VSResxData(VSResxFile file, string name)
     : base(file, name)
 {
 }
示例#7
0
        protected virtual void Init(string filepath)
        {
            directory = new DirectoryInfo(Path.Combine(Project.Solution.SolutionDirectory.FullName, filepath));

            IResourceFile resxfile = null;

            FileInfo[] files = directory.GetFiles("*.resx", SearchOption.TopDirectoryOnly);
            Files = new List <IResourceFile>();
            foreach (FileInfo file in files)
            {
                if (Project.SkipFile(file.Name))
                {
                    continue;
                }

                resxfile = new VSResxFile(this, file);

                string fileGroupId = this.ID + "_" + resxfile.Prefix;

                if (!Project.ResxGroups.ContainsKey(fileGroupId))
                {
                    Project.ResxGroups.Add(fileGroupId, new VSResxFileGroup(this, resxfile.Prefix, file.DirectoryName));
                }

                Project.ResxGroups[fileGroupId].Add(resxfile);
                Files.Add(resxfile);
            }

            // Localization file for Windows Installer XML toolkit (WiX)
            files = directory.GetFiles("*.wxl", SearchOption.TopDirectoryOnly);
            foreach (FileInfo file in files)
            {
                if (Project.SkipFile(file.Name))
                {
                    continue;
                }

                resxfile = new WixLocalizationFile(this, file);

                string fileGroupId = this.ID + "_" + resxfile.Prefix;
                if (!Project.ResxGroups.ContainsKey(fileGroupId))
                {
                    Project.ResxGroups.Add(fileGroupId, new VSResxFileGroup(this, resxfile.Prefix, file.DirectoryName));
                }

                Project.ResxGroups[fileGroupId].Add(resxfile);
                Files.Add(resxfile);
            }

            Directories = new List <VSProjectFolder>();
            foreach (DirectoryInfo dir in directory.GetDirectories())
            {
                if (dir.Name == "obj" || dir.Name == "bin")
                {
                    continue;
                }
                if (Project.SkipDirectory(dir.Name))
                {
                    continue;
                }

                var folder = new VSProjectFolder(Project, this, dir.FullName);

                if (folder.ContainsFiles())
                {
                    Directories.Add(folder);
                }
            }
        }
示例#8
0
 public VSResxData(VSResxFile file, string name)
     : base(file, name)
 {
 }