Пример #1
0
        void open_file()
        {
            OVMW.openfile = true;
            Static.FileInfo.SourceFileName = Path.GetFileName(Static.FileInfo.OpenFullFileName);

            MSG1.ParseMSG1(Static.FileInfo.OpenFullFileName, false);

            set_title();
        }
Пример #2
0
        public void Thread_Work()
        {
            timer.Start();
            for (int i = 0; i < FileList.Count; i++)
            {
                if (Abort_total)
                {
                    progressbar_total = 1001;
                    return;
                }

                FileList_count2 = i + 1;

                LMS.Clear();
                MSG1Position.Clear();

                FileInfo FI = new FileInfo(FileList[i]);
                if (FI.Extension != ".MSG1" & FI.Extension != ".txt")
                {
                    byte[] buffer = new byte[4];
                    using (FileStream FileStream = new FileStream(FileList[i], FileMode.Open, FileAccess.Read))
                    {
                        FileStream.Position = 8;
                        FileStream.Read(buffer, 0, 4);
                    }

                    string FileType = System.Text.Encoding.Default.GetString(buffer);

                    if (FileType == "PMD1")
                    {
                        LMS.Add(MSG1.GetMSG1fromPMD1(FileList[i]));
                    }
                    else if (FileType == "FLW0")
                    {
                        LMS.Add(MSG1.GetMSG1fromFLW0(FileList[i]));
                    }
                    else if (FileType == "MSG1")
                    {
                        LMS.Add(MSG1.GetMSG1fromFile(FileList[i], 0));
                    }
                    else
                    {
                        Thread thread_getLMS = new Thread(new ParameterizedThreadStart(Thread_getLMS));
                        thread_getLMS.IsBackground = true;
                        thread_getLMS.Start(FileList[i]);
                        thread_getLMS.Join();

                        foreach (var Position in MSG1Position)
                        {
                            LMS.Add(MSG1.GetMSG1fromFile(FileList[i], Position));
                        }
                    }
                }

                if (Abort_total)
                {
                    progressbar_total = 1001;
                    return;
                }
                MSG1.ParseMSG1(FileList[i], LMS, SaveMSG1);
            }
            progressbar_total = 1001;
            timer.Stop();
        }