CarotDav_decompile/CarotDAV/OleStreamCreator.cs

64 lines
1.9 KiB
C#
Raw Normal View History

// Decompiled with JetBrains decompiler
// Type: CarotDAV.OleStreamCreator
// Assembly: CarotDAV, Version=1.13.2.18337, Culture=neutral, PublicKeyToken=null
// MVID: C31F2651-A4A8-4D09-916A-8C6106F5E7C8
// Assembly location: F:\Eigene Dateien\Dropbox\portable Collection\Progs\CarotDAV\CarotDAV.exe
using Rei.Com;
using Rei.Fs;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices.ComTypes;
namespace CarotDAV
{
public class OleStreamCreator : IStreamCreator
{
private string pName;
private ResourceInfo pResourceInfo;
private FsBase pClient;
private ErrorPromptManager pErrorManager;
private List<OleStream> Streams;
public event EventHandler<ExceptionOccurredEventArgs> ExceptionOccurred;
public OleStreamCreator(ResourceInfo ri, string name, FsBase client, ErrorPromptManager errormanager)
{
this.Streams = new List<OleStream>();
this.pResourceInfo = ri;
this.pName = name;
this.pClient = client;
this.pErrorManager = errormanager;
}
public IStream Create()
{
OleStream oleStream = new OleStream(this.pResourceInfo, this.pName, this.pClient, this.pErrorManager);
oleStream.ExceptionOccurred += new EventHandler<ExceptionOccurredEventArgs>(this.OnExceptionOccurred);
this.Streams.Add(oleStream);
return (IStream) oleStream;
}
public void OnExceptionOccurred(object sender, ExceptionOccurredEventArgs e)
{
EventHandler<ExceptionOccurredEventArgs> exceptionOccurredEvent = this.ExceptionOccurred;
if (exceptionOccurredEvent == null)
return;
exceptionOccurredEvent(RuntimeHelpers.GetObjectValue(sender), e);
}
public void Dispose()
{
int num1 = 0;
int num2 = checked (this.Streams.Count - 1);
int index = num1;
while (index <= num2)
{
this.Streams[index].Dispose();
checked { ++index; }
}
}
}
}