コード例 #1
0
        protected void Load(IComStorage storage)
        {
            if (storage == null)
            {
                throw new ArgumentNullException(nameof(storage));
            }

            Storage = storage;
        }
コード例 #2
0
        private IStorage CreateStorage(string storageName)
        {
            IComStorage storage = null;

            Storage.CreateStorage(storageName,
                                  (uint)STGM.CREATE | (uint)STGM.SHARE_EXCLUSIVE | (uint)STGM.WRITE,
                                  0, 0, out storage);

            return(new ComStorage(storage, m_IsWritable));
        }
コード例 #3
0
        public void Close()
        {
            if (Storage != null)
            {
                if (m_IsWritable)
                {
                    Storage.Commit(0);
                }

                Marshal.ReleaseComObject(Storage);
                Storage = null;
                GC.SuppressFinalize(this);
            }
        }
コード例 #4
0
        internal ThirdPartyStoreHandler(IModelDoc2 model, string name, bool write)
        {
            m_Model = model;
            m_Name  = name;

            var storage = model.Extension.IGet3rdPartyStorageStore(name, write) as IStorage;

            if (storage != null)
            {
                Storage = new ComStorage(storage, write);
            }
            else
            {
                Storage = null;
            }
        }
コード例 #5
0
 public ComStorage(IComStorage storage, bool writable) : this(writable)
 {
     Load(storage);
 }