Exemple #1
0
 /// <summary>
 /// Sprawdza czy podane parametry s¹ zgodne z parametrami dla plików zapisanych na liœcie.
 /// Jeœli nie ma zgodnoœci, to rzuca wyj¹tek.
 /// </summary>
 /// <param name="dtr">Typ dokumentu</param>
 /// <param name="dt">Typ s³ownika</param>
 private void CheckCorrectness(DocumentRepresentationType dtr, DictionaryType dt)
 {
     if (documentList.Count > 0)
     {
         Document tmpDocument = documentList[0];
         if (tmpDocument.GetDocumentRepresentationType() != dtr || tmpDocument.DictionaryType != dt)
         {
             throw new Exception("Can't add document. RepresentationType or DictionaryType differs from others in the list.");
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Dodaje dokument do listy.
 /// </summary>
 /// <param name="document">Dokument do dodania.</param>
 public void AddDocument(Document document)
 {
     CheckCorrectness(document.GetDocumentRepresentationType(), document.DictionaryType);
     documentList.Add(document);
 }