Пример #1
0
        void IInitializeWithStream.Initialize(System.Runtime.InteropServices.ComTypes.IStream stream, Shell.AccessModes fileMode)
        {
            var preview = this as IPreviewFromStream;

            if (preview == null)
            {
                throw new InvalidOperationException(
                          string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                        LocalizedMessages.PreviewHandlerUnsupportedInterfaceCalled,
                                        "IPreviewFromStream"));
            }
            using (var storageStream = new StorageStream(stream, fileMode != Shell.AccessModes.ReadWrite))
            {
                preview.Load(storageStream);
            }
        }
 void IInitializeWithStream.Initialize(System.Runtime.InteropServices.ComTypes.IStream stream, Shell.AccessModes fileMode)
 {
     IPreviewFromStream preview = this as IPreviewFromStream;
     if (preview == null)
     {
         throw new InvalidOperationException(
             string.Format(System.Globalization.CultureInfo.InvariantCulture,
             LocalizedMessages.PreviewHandlerUnsupportedInterfaceCalled,
             "IPreviewFromStream"));
     }
     using (var storageStream = new StorageStream(stream, fileMode != Shell.AccessModes.ReadWrite))
     {
         preview.Load(storageStream);
     }
 }
Пример #3
0
 void IInitializeWithStream.Initialize(System.Runtime.InteropServices.ComTypes.IStream stream, Shell.AccessModes fileMode)
 {
     _stream = new StorageStream(stream, fileMode != Shell.AccessModes.ReadWrite);
 }
Пример #4
0
 void IInitializeWithStream.Initialize(System.Runtime.InteropServices.ComTypes.IStream stream, AccessModes fileMode) => _stream = new StorageStream(stream, fileMode != AccessModes.ReadWrite);