Exemplo n.º 1
0
        internal virtual void LoadFixLedger()
        {
            if (s_sourceFileFixLedger == null)
            {
                s_sourceFileFixLedger = SdkUIUtilities.GetStoredObject <Dictionary <string, FixOffsetList> >(s_sourceFileFixLedgerFileName) ?? new Dictionary <string, FixOffsetList>();

                // Remove entries where the last modified timestamps don't match
                // This could indicate that the file was modified or overwritten externally
                List <string> remove = s_sourceFileFixLedger
                                       .Where(e => !File.Exists(e.Key) || File.GetLastWriteTime(e.Key) != e.Value.LastModified)
                                       .Select(e => e.Key)
                                       .ToList();

                if (remove.Count > 0)
                {
                    remove.ForEach(p => s_sourceFileFixLedger.Remove(p));
                    SaveFixLedger();
                }
            }
        }