Example #1
0
 public ObjectValueBinder(IStorageBlob blob, WatchableCloudBlobStream stream,
                          ICloudBlobStreamBinder <TValue> objectBinder)
 {
     _blob         = blob;
     _stream       = stream;
     _objectBinder = objectBinder;
 }
Example #2
0
        static void AddAdapter <T>(ConverterManager cm, ICloudBlobStreamBinder <T> x)
        {
            cm.AddExactConverter <Stream, T>(stream => x.ReadFromStreamAsync(stream, CancellationToken.None).Result);

            cm.AddExactConverter <ApplyConversion <T, Stream>, object>(pair =>
            {
                T value       = pair.Value;
                Stream stream = pair.Existing;
                x.WriteToStreamAsync(value, stream, CancellationToken.None).Wait();
                return(null);
            });
        }
Example #3
0
            public ObjectArgumentBinding(ICloudBlobStreamBinder <TValue> objectBinder,
                                         IContextGetter <IBlobWrittenWatcher> blobWrittenWatcherGetter)
            {
                if (objectBinder == null)
                {
                    throw new ArgumentNullException("objectBinder");
                }

                if (blobWrittenWatcherGetter == null)
                {
                    throw new ArgumentNullException("blobWrittenWatcherGetter");
                }

                _objectBinder             = objectBinder;
                _blobWrittenWatcherGetter = blobWrittenWatcherGetter;
            }
Example #4
0
 public ObjectArgumentBinding(ICloudBlobStreamBinder <TValue> objectBinder)
 {
     _objectBinder = objectBinder;
 }