public Stream GetFileStream() { if (tempStreamReader != null) return tempStreamReader; else if (providerItem != null) { if (tempParentStorage == null) ShellHelper.GetIStorage(providerItem.ParentItem, out tempParentStoragePtr, out tempParentStorage); tempStreamReader = new ShellStreamReader(providerItem, tempParentStorage, fileAccess); return tempStreamReader; } else throw new Exception("Not possible to open a filestream."); }
public ShellAPI.STATSTG GetFileInfo() { if (tempStreamReader != null) return tempStreamReader.StreamInfo; else if (providerItem != null) { if (tempParentStorage == null) ShellHelper.GetIStorage(providerItem.ParentItem, out tempParentStoragePtr, out tempParentStorage); tempStreamReader = new ShellStreamReader(providerItem, tempParentStorage, fileAccess); return tempStreamReader.StreamInfo; } else throw new Exception("Not possible to retrieve the STATSTG."); }
public Stream GetFileStream() { if (tempStreamReader != null) { return(tempStreamReader); } else if (providerItem != null) { if (tempParentStorage == null) { ShellHelper.GetIStorage(providerItem.ParentItem, out tempParentStoragePtr, out tempParentStorage); } tempStreamReader = new ShellStreamReader(providerItem, tempParentStorage, fileAccess); return(tempStreamReader); } else { throw new Exception("Not possible to open a filestream."); } }
public ShellAPI.STATSTG GetFileInfo() { if (tempStreamReader != null) { return(tempStreamReader.StreamInfo); } else if (providerItem != null) { if (tempParentStorage == null) { ShellHelper.GetIStorage(providerItem.ParentItem, out tempParentStoragePtr, out tempParentStorage); } tempStreamReader = new ShellStreamReader(providerItem, tempParentStorage, fileAccess); return(tempStreamReader.StreamInfo); } else { throw new Exception("Not possible to retrieve the STATSTG."); } }
internal void ReleaseStream() { if (tempStreamReader != null) { tempStreamReader.CloseStream(); tempStreamReader = null; } if (tempParentStorage != null) { Marshal.ReleaseComObject(tempParentStorage); Marshal.Release(tempParentStoragePtr); tempParentStorage = null; } }