本文整理汇总了C#中OrderedPartCollection.Add方法的典型用法代码示例。如果您正苦于以下问题:C# OrderedPartCollection.Add方法的具体用法?C# OrderedPartCollection.Add怎么用?C# OrderedPartCollection.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedPartCollection
的用法示例。
在下文中一共展示了OrderedPartCollection.Add方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DocumentStorage_DocumentAdd_And_DocumentRead_WithCompression
public void DocumentStorage_DocumentAdd_And_DocumentRead_WithCompression(string requestedStorage)
{
var documentCodecs = new OrderedPartCollection<AbstractDocumentCodec>();
documentCodecs.Add(new DocumentCompression());
DocumentStorage_DocumentAdd_And_DocumentRead_Internal(requestedStorage, "Foo/Bar", documentCodecs);
}
示例2: TryToCreateTransactionalStorage
public static bool TryToCreateTransactionalStorage(InMemoryRavenConfiguration ravenConfiguration,
bool hasCompression, EncryptionConfiguration encryption, out ITransactionalStorage storage)
{
storage = null;
if (File.Exists(Path.Combine(ravenConfiguration.DataDirectory, Voron.Impl.Constants.DatabaseFilename)))
storage = ravenConfiguration.CreateTransactionalStorage(InMemoryRavenConfiguration.VoronTypeName, () => { }, () => { });
else if (File.Exists(Path.Combine(ravenConfiguration.DataDirectory, "Data")))
storage = ravenConfiguration.CreateTransactionalStorage(InMemoryRavenConfiguration.EsentTypeName, () => { }, () => { });
if (storage == null)
return false;
var orderedPartCollection = new OrderedPartCollection<AbstractDocumentCodec>();
if (encryption != null)
{
var documentEncryption = new DocumentEncryption();
documentEncryption.SetSettings(new EncryptionSettings(encryption.EncryptionKey, encryption.SymmetricAlgorithmType,
encryption.EncryptIndexes, encryption.PreferedEncryptionKeyBitsSize));
orderedPartCollection.Add(documentEncryption);
}
if (hasCompression)
{
orderedPartCollection.Add(new DocumentCompression());
}
storage.Initialize(new SequentialUuidGenerator {EtagBase = 0}, orderedPartCollection);
return true;
}