Esempio n. 1
0
 /// <summary>
 /// Добавляет элемент в список
 /// </summary>
 /// <param name="key">The object to use as the key of the element to add</param>
 /// <param name="value">The object to use as the value of the element to add</param>
 public void Add(long key, CSourceFile value)
 {
     lock (m_SyncRoot)
     {
         m_SourceFilesList.Add(key, value);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Gets the value associated with the specified key.
 /// </summary>
 /// <param name="key">The key whose value to get.</param>
 /// <param name="value"></param>
 /// <returns></returns>
 public bool TryGetValue(long key, out CSourceFile value)
 {
     lock (m_SyncRoot)
     {
         return(m_SourceFilesList.TryGetValue(key, out value));
     }
 }
 /// <summary>
 /// Сохранить файл на диск
 /// </summary>
 /// <param name="source_file"></param>
 public void Save(CSourceFile source_file)
 {
     using (FileStream f_stream = new FileStream(m_Path, FileMode.CreateNew))
     {
         using (StreamWriter s_writer = new StreamWriter(f_stream, m_Encoding))
         {
             foreach (CExtendedCodeUnit unit in source_file.Content.Content)
             {
                 s_writer.WriteLine(unit.Text);
             }
         }
     }
 }