Пример #1
0
 public Dictionary()
 {
     _info = new DictionaryInfo();
     _abbrevs = new List<Abbreviation>();
     _images = new List<ImageMedia>();
     _entries = new List<Entry>();
 }
        private void _Write(Stream stream, DictionaryInfo info)
        {
            if (!string.IsNullOrWhiteSpace(info.Title))
                Field.Create(FieldHeaders.Title, info.Title)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.Author))
                Field.Create(FieldHeaders.Author, info.Author)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.CopyrightNotice))
                Field.Create(FieldHeaders.CopyrightNotice, info.CopyrightNotice)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.VersionInfo))
                Field.Create(FieldHeaders.VersionInfo, info.VersionInfo)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.Contents))
                Field.Create(FieldHeaders.Contents, info.Contents)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.ForeignLanguageName))
                Field.Create(FieldHeaders.ForeignLanguageName, info.ForeignLanguageName)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.NativeLanguageName))
                Field.Create(FieldHeaders.NativeLanguageName, info.NativeLanguageName)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.ForeignLanguageCollationRules))
                Field.Create(FieldHeaders.ForeignLanguageCollationRules, info.ForeignLanguageCollationRules)
                     .WriteToStream(stream);
            if (!string.IsNullOrWhiteSpace(info.NativeLanguageCollationRules))
                Field.Create(FieldHeaders.NativeLanguageCollationRules, info.NativeLanguageCollationRules)
                     .WriteToStream(stream);

            _AddBaseItemFields(stream, info);
        }