Esempio n. 1
0
        public override IResourceFile CreateNewFile(CultureInfo culture)
        {
            Stream      stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ResourceManager.Core.WiX.WixLocalizationTemplate.xml");
            XmlDocument xml    = new XmlDocument();

            xml.Load(stream);
            xml.DocumentElement.Attributes["Culture"].Value = culture.Name;

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

            xml.Save(filepath);

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

            this.Add(vsfile);

            return(vsfile);
        }
Esempio n. 2
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);
            }
        }
Esempio n. 3
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);
                }
            }
        }
Esempio n. 4
0
 public WixLocalizationData(WixLocalizationFile file, string name)
     : base(file, name)
 {
 }
Esempio n. 5
0
 public WixLocalizationData(WixLocalizationFile file, XPathNavigator nav)
     : base(file)
 {
     Name     = nav.GetAttribute("Id", "");
     xmlValue = nav.Value;
 }
Esempio n. 6
0
 public WixLocalizationData(WixLocalizationFile file, string name)
     : base(file, name)
 {
 }
Esempio n. 7
0
 public WixLocalizationData(WixLocalizationFile file, XPathNavigator nav)
     : base(file)
 {
     Name = nav.GetAttribute("Id", "");
     xmlValue = nav.Value;
 }