Exemple #1
0
        public static IEnumerable <string> LinesFromFile(string filePath)
        {
            string rawText = GenFile.TextFromResourceFile(filePath);

            foreach (string line in GenText.LinesFromString(rawText))
            {
                yield return(line);
            }
        }
Exemple #2
0
        public static IEnumerable <string> LinesFromFile(string filePath)
        {
            string text = TextFromResourceFile(filePath);

            foreach (string item in GenText.LinesFromString(text))
            {
                yield return(item);
            }
        }
        private void LoadFromFile_Strings(FileInfo file, DirectoryInfo stringsTopDir)
        {
            string text;

            try
            {
                text = GenFile.TextFromRawFile(file.FullName);
            }
            catch (Exception ex)
            {
                this.loadErrors.Add(string.Concat(new object[]
                {
                    "Exception loading from strings file ",
                    file,
                    ": ",
                    ex
                }));
                return;
            }
            string text2 = file.FullName;

            if (stringsTopDir != null)
            {
                text2 = text2.Substring(stringsTopDir.FullName.Length + 1);
            }
            text2 = text2.Substring(0, text2.Length - Path.GetExtension(text2).Length);
            text2 = text2.Replace('\\', '/');
            List <string> list = new List <string>();

            foreach (string current in GenText.LinesFromString(text))
            {
                list.Add(current);
            }
            List <string> list2;

            if (this.stringFiles.TryGetValue(text2, out list2))
            {
                foreach (string current2 in list)
                {
                    list2.Add(current2);
                }
            }
            else
            {
                this.stringFiles.Add(text2, list);
            }
        }
        public static IEnumerable <string> LinesFromFile(string filePath)
        {
            string rawText = GenFile.TextFromResourceFile(filePath);

            using (IEnumerator <string> enumerator = GenText.LinesFromString(rawText).GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    string line = enumerator.Current;
                    yield return(line);

                    /*Error: Unable to find new state assignment for yield return*/;
                }
            }
            yield break;
IL_00ca:
            /*Error near IL_00cb: Unexpected return in MoveNext()*/;
        }
        private void LoadFromFile_Strings(FileInfo file, DirectoryInfo stringsTopDir)
        {
            string text;

            try
            {
                text = GenFile.TextFromRawFile(file.FullName);
            }
            catch (Exception ex)
            {
                Log.Warning("Exception loading from strings file " + file + ": " + ex);
                return;
            }
            string text2 = file.FullName;

            if (stringsTopDir != null)
            {
                text2 = text2.Substring(stringsTopDir.FullName.Length + 1);
            }
            text2 = text2.Substring(0, text2.Length - Path.GetExtension(text2).Length);
            text2 = text2.Replace('\\', '/');
            List <string> list = new List <string>();

            foreach (string item in GenText.LinesFromString(text))
            {
                list.Add(item);
            }
            List <string> list2 = default(List <string>);

            if (this.stringFiles.TryGetValue(text2, out list2))
            {
                foreach (string item2 in list)
                {
                    list2.Add(item2);
                }
            }
            else
            {
                this.stringFiles.Add(text2, list);
            }
        }
        private void LoadFromFile_Strings(VirtualFile file, VirtualDirectory stringsTopDir)
        {
            string text;

            try
            {
                text = file.ReadAllText();
            }
            catch (Exception ex)
            {
                loadErrors.Add(string.Concat("Exception loading from strings file ", file, ": ", ex));
                return;
            }
            string text2 = file.FullPath;

            if (stringsTopDir != null)
            {
                text2 = text2.Substring(stringsTopDir.FullPath.Length + 1);
            }
            text2 = text2.Substring(0, text2.Length - Path.GetExtension(text2).Length);
            text2 = text2.Replace('\\', '/');
            List <string> list = new List <string>();

            foreach (string item in GenText.LinesFromString(text))
            {
                list.Add(item);
            }
            if (stringFiles.TryGetValue(text2, out var value))
            {
                foreach (string item2 in list)
                {
                    value.Add(item2);
                }
            }
            else
            {
                stringFiles.Add(text2, list);
            }
        }