当前位置: 首页>>代码示例>>C#>>正文


C# IStorage.Commit方法代码示例

本文整理汇总了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);
 }
开发者ID:acinep,项目名称:epplus,代码行数:12,代码来源:CompoundDocument.cs

示例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);
 }
开发者ID:acinep,项目名称:epplus,代码行数:10,代码来源:CompoundDocument.cs

示例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);
        }
开发者ID:huoxudong125,项目名称:EPPlus,代码行数:42,代码来源:EncryptedPackageHandler.cs


注:本文中的IStorage.Commit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。