public void Clean(AuditTrailViewModel sender)
        {
            try
            {
                TStrings Lines = new TStrings();

                Lines.LoadFromFile(outputFile);

                while (Lines.Count > sender.MaxLines)
                {
                    Lines.Delete(0);
                }
                ;

                Lines.SaveToFile(outputFile, System.Text.Encoding.ASCII);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);

                if (Debugger.IsAttached)
                {
                    Debugger.Break();
                }
                ;
            };
        }
示例#2
0
        private void LoadFiles()
        {
            Lines.Clear();

            // File1.LoadFromFile( FileName1, System.Text.Encoding.Unicode );
            File1.LoadFromFile(FileName1);
            for (int i = 0; i < File1.Count; i++)
            {
                File1.SetObject(i, (int)i + 1);
            }
            ;

            // File2.LoadFromFile( FileName2, System.Text.Encoding.Unicode );
            File2.LoadFromFile(FileName2);
            for (int i = 0; i < File2.Count; i++)
            {
                File2.SetObject(i, (int)i + 1);
            }
            ;

            columnHeaderFile1.Text = FileName1;
            columnHeaderFile2.Text = FileName2;

            File1Modified = false;
            File2Modified = false;
        }