예제 #1
0
        private void LoadSuggestionReferenceFile()
        {
            var reader = new ResourceFileReader();

            string referenceFileName = GetFileFromUser("Select the file containing reference strings for suggestions");

            if (referenceFileName == null)
            {
                return;
            }
            string translatedFileName = GetFileFromUser("Select the file containing translated strings for suggestions");

            if (translatedFileName == null)
            {
                return;
            }

            ResourceFile referenceFile  = reader.ReadXmlFile(referenceFileName);
            ResourceFile translatedFile = reader.ReadXmlFile(translatedFileName);

            foreach (Resource referenceResource in referenceFile.Resources)
            {
                Resource translatedResource = translatedFile.FindResourceByName(referenceResource.Name);
                _resourceSuggester.AddResource(
                    new TranslatedResource(referenceResource.Name, referenceResource.Text, translatedResource.Text));
            }
        }
예제 #2
0
        private void ReadFile(string fileName, int columnNumber)
        {
            var          reader       = new ResourceFileReader();
            ResourceFile resourceFile = reader.ReadXmlFile(fileName);

            _table.BeginLoadData();
            string valueColumn = string.Format("Value{0}", columnNumber);

            dataGridView1.Columns[valueColumn].HeaderText = resourceFile.LanguageName;
            ReadLocaleResourceElementsRecursive(resourceFile, valueColumn);
            _table.EndLoadData();
        }