protected void Load(IComStorage storage) { if (storage == null) { throw new ArgumentNullException(nameof(storage)); } Storage = storage; }
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)); }
public void Close() { if (Storage != null) { if (m_IsWritable) { Storage.Commit(0); } Marshal.ReleaseComObject(Storage); Storage = null; GC.SuppressFinalize(this); } }
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; } }
public ComStorage(IComStorage storage, bool writable) : this(writable) { Load(storage); }