Esempio n. 1
0
 public static IByteDevice Wrap(IByteInDevice inDevice, IByteOutDevice outDevice)
 {
     return(inDevice.NotNull() || outDevice.NotNull() ? new ByteDeviceCombiner(inDevice, outDevice)
     {
         Wrapped = true
     } : null);
 }
Esempio n. 2
0
        public virtual async Tasks.Task <bool> Close()
        {
            bool result;

            if (result = this.inDevice.NotNull() && !this.Wrapped)
            {
                result = await this.inDevice.Close();

                this.inDevice = null;
            }
            if (this.outDevice.NotNull() && !this.Wrapped)
            {
                result = await this.outDevice.Close();

                this.outDevice = null;
            }
            return(result);
        }
Esempio n. 3
0
		public static ByteStream Wrap(IByteOutDevice device)
		{
			return ByteStream.Wrap(ByteDeviceCombiner.Open(device));
		}
Esempio n. 4
0
		public virtual bool Close()
		{
			bool result;
			if (result = this.inDevice.NotNull() && !this.Wrapped)
			{
				this.inDevice.Close();
				this.inDevice = null;
			}
			if (this.outDevice.NotNull() && !this.Wrapped)
			{
				result |= this.outDevice.NotNull();
				this.outDevice.Close();
				this.outDevice = null;
			}
			return result;
		}
Esempio n. 5
0
		protected ByteDeviceCombiner(IByteInDevice inDevice, IByteOutDevice outDevice)
		{
			this.inDevice = inDevice;
			this.outDevice = outDevice;
		}
Esempio n. 6
0
		public static IByteDevice Wrap(IByteInDevice inDevice, IByteOutDevice outDevice)
		{
			return inDevice.NotNull() || outDevice.NotNull() ? new ByteDeviceCombiner(inDevice, outDevice) { Wrapped = true } : null;
		}
Esempio n. 7
0
		public static IByteDevice Wrap(IByteOutDevice outDevice)
		{
			return ByteDeviceCombiner.Wrap(null, outDevice);
		}
Esempio n. 8
0
		public static IByteDevice Open(IByteInDevice inDevice, IByteOutDevice outDevice)
		{
			return inDevice.NotNull() || outDevice.NotNull() ? new ByteDeviceCombiner(inDevice, outDevice) : null;
		}
Esempio n. 9
0
		public static IByteDevice Open(IByteOutDevice outDevice)
		{
			return ByteDeviceCombiner.Open(null, outDevice);
		}
Esempio n. 10
0
 protected ByteDeviceCombiner(IByteInDevice inDevice, IByteOutDevice outDevice)
 {
     this.inDevice  = inDevice;
     this.outDevice = outDevice;
 }
Esempio n. 11
0
 public static IByteDevice Wrap(IByteOutDevice outDevice)
 {
     return(ByteDeviceCombiner.Wrap(null, outDevice));
 }
Esempio n. 12
0
 public static IByteDevice Open(IByteInDevice inDevice, IByteOutDevice outDevice)
 {
     return(inDevice.NotNull() || outDevice.NotNull() ? new ByteDeviceCombiner(inDevice, outDevice) : null);
 }
Esempio n. 13
0
 public static IByteDevice Open(IByteOutDevice outDevice)
 {
     return(ByteDeviceCombiner.Open(null, outDevice));
 }
Esempio n. 14
0
		ChunkedBlockOutDevice(IByteOutDevice backend) :
			this((IOutDevice)backend)
		{
			this.backendWrite = backend.Write;
		}
Esempio n. 15
0
		public static ChunkedBlockOutDevice Wrap(IByteOutDevice backend)
		{
			return backend.NotNull() ? new ChunkedBlockOutDevice(backend) { Wrapped = true } : null;
		}
Esempio n. 16
0
		public static ChunkedBlockOutDevice Open(IByteOutDevice backend)
		{
			return backend.NotNull() ? new ChunkedBlockOutDevice(backend) : null;
		}