本文整理汇总了C#中IStorage.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# IStorage.Commit方法的具体用法?C# IStorage.Commit怎么用?C# IStorage.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStorage
的用法示例。
在下文中一共展示了IStorage.Commit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateStore
private void CreateStore(string name, StoragePart subStore, IStorage storage)
{
IStorage subStorage;
storage.CreateStorage(name, (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out subStorage);
storage.Commit(0);
foreach (var store in subStore.SubStorage)
{
CreateStore(store.Key, store.Value, subStorage);
}
CreateStreams(subStore, subStorage);
}
示例2: CreateStreams
private void CreateStreams(StoragePart subStore, IStorage subStorage)
{
foreach (var ds in subStore.DataStreams)
{
comTypes.IStream stream;
subStorage.CreateStream(ds.Key, (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out stream);
stream.Write(ds.Value, ds.Value.Length, IntPtr.Zero);
}
subStorage.Commit(0);
}
示例3: CreateDataSpaces
private void CreateDataSpaces(IStorage storage)
{
IStorage dataSpaces;
storage.CreateStorage("\x06" + "DataSpaces", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaces);
storage.Commit(0);
//Version Stream
comTypes.IStream versionStream;
dataSpaces.CreateStream("Version", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out versionStream);
byte[] version = CreateVersionStream();
versionStream.Write(version,version.Length, IntPtr.Zero);
//DataSpaceMap
comTypes.IStream dataSpaceMapStream;
dataSpaces.CreateStream("DataSpaceMap", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaceMapStream);
byte[] dataSpaceMap = CreateDataSpaceMap();
dataSpaceMapStream.Write(dataSpaceMap, dataSpaceMap.Length, IntPtr.Zero);
//DataSpaceInfo
IStorage dataSpaceInfo;
dataSpaces.CreateStorage("DataSpaceInfo", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaceInfo);
comTypes.IStream strongEncryptionDataSpaceStream;
dataSpaceInfo.CreateStream("StrongEncryptionDataSpace", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out strongEncryptionDataSpaceStream);
byte[] strongEncryptionDataSpace = CreateStrongEncryptionDataSpaceStream();
strongEncryptionDataSpaceStream.Write(strongEncryptionDataSpace, strongEncryptionDataSpace.Length, IntPtr.Zero);
dataSpaceInfo.Commit(0);
//TransformInfo
IStorage tranformInfo;
dataSpaces.CreateStorage("TransformInfo", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out tranformInfo);
IStorage strongEncryptionTransform;
tranformInfo.CreateStorage("StrongEncryptionTransform", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out strongEncryptionTransform);
comTypes.IStream primaryStream;
strongEncryptionTransform.CreateStream("\x06Primary", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out primaryStream);
byte[] primary = CreateTransformInfoPrimary();
primaryStream.Write(primary, primary.Length, IntPtr.Zero);
tranformInfo.Commit(0);
dataSpaces.Commit(0);
}