Exemple #1
0
        public void AddCultureFile(ResourceFileBase file)
        {
            if (!cultures.ContainsKey(file.Culture))
                cultures.Add(file.Culture, new VSCulture(file.Culture));

            cultures[file.Culture].Files.Add(file);
        }
Exemple #2
0
        internal void SaveProjectFile()
        {
            if (projectXml != null)
            {
                try
                {
                    var  file       = new FileInfo(GetProjectFilePath());
                    bool isReadOnly = file.IsReadOnly;

                    if (isReadOnly)
                    {
                        ResourceFileBase.SetReadOnlyAttribute(file, false);
                    }

                    projectXml.Save(file.FullName);

                    if (isReadOnly)
                    {
                        ResourceFileBase.SetReadOnlyAttribute(file, true);
                    }

                    projectXml       = null;
                    namespaceManager = null;
                }
                catch (Exception e)
                {
                    log4net.ILog log = log4net.LogManager.GetLogger(typeof(VSProject));
                    log.Error("Project file could not be saved.", e);
                }
            }
        }
Exemple #3
0
        public void AddCultureFile(ResourceFileBase file)
        {
            if (!cultures.ContainsKey(file.Culture))
            {
                cultures.Add(file.Culture, new VSCulture(file.Culture));
            }

            cultures[file.Culture].Files.Add(file);
        }
Exemple #4
0
        internal void ChangeCulture(ResourceFileBase resourceFile, CultureInfo newCulture)
        {
            if (!cultures.ContainsKey(newCulture))
            {
                cultures.Add(newCulture, new VSCulture(newCulture));
            }

            if (cultures[resourceFile.Culture].Files.Contains(resourceFile))
            {
                cultures[resourceFile.Culture].Files.Remove(resourceFile);
            }

            cultures[newCulture].Files.Add(resourceFile);
        }
Exemple #5
0
        internal void ChangeCulture(ResourceFileBase resourceFile, CultureInfo newCulture)
        {
            if (!cultures.ContainsKey(newCulture))
                cultures.Add(newCulture, new VSCulture(newCulture));

            if (cultures[resourceFile.Culture].Files.Contains(resourceFile))
                cultures[resourceFile.Culture].Files.Remove(resourceFile);

            cultures[newCulture].Files.Add(resourceFile);
        }