Ejemplo n.º 1
0
 public ClearImageCommand(ImageWidgetViewModel imageVM, Stream oldStream, bool isAutosizeOldValue)
 {
     _imageVM = imageVM;
     if (oldStream != null)
     {
         _oldStream = new MemoryStream((int)oldStream.Length);
         //(oldStream as MemoryStream).CopyTo(_oldStream,(int)oldStream.Length);
         oldStream.Seek(0, SeekOrigin.Begin);
         oldStream.CopyTo(_oldStream);
         _oldStream.Seek(0, SeekOrigin.Begin);
     }
     _isAutosizeOldValue = isAutosizeOldValue;
 }
Ejemplo n.º 2
0
        public ImportImageCommand(ImageWidgetViewModel imageVM, Stream oldStream, Stream newStream, bool isAutosizeOldValue, bool isAutosizeNewValue)
        {
            _imageVM   = imageVM;
            _newStream = newStream;
            //if (oldStream != null)
            //{
            //    _oldStream = new MemoryStream((int)oldStream.Length);
            //    oldStream.Seek(0, SeekOrigin.Begin);
            //    oldStream.CopyTo(_oldStream);
            //    _oldStream.Seek(0, SeekOrigin.Begin);
            //}
            //else
            //{
            //    _oldStream = null;
            //}
            _oldStream = oldStream;

            _isAutosizeOldValue = isAutosizeOldValue;
            _isAutosizeNewValue = isAutosizeNewValue;
        }