GetData() public method

Retrieves the data associated with the specified data format at the specified index.
public GetData ( string format, int index ) : MemoryStream
format string The format of the data to retrieve. See for predefined formats.
index int The index of the data to retrieve.
return System.IO.MemoryStream
Exemplo n.º 1
0
        private void Parse()
        {
            if (!_isValid)
            {
                throw new Exception("DropData does not contain any files");
            }

            if (!_parsed)
            {
                if (!_dataObject.GetDataPresent("FileDrop"))
                {
                    _oleDropData = new OleDropData(_dataObject);

                    if (_dataObject.GetDataPresent("FileGroupDescriptorW"))
                    {
                        _filenames = (string[])_oleDropData.GetData("FileGroupDescriptorW");
                    }
                    else
                    {
                        _filenames = (string[])_oleDropData.GetData("FileGroupDescriptor");
                    }
                }
                else
                {
                    _filenames = (string[])_dataObject.GetData("FileDrop");
                }

                _parsed = true;
            }
        }
Exemplo n.º 2
0
 private void InitialiseStreams()
 {
     if (_oleDropData != null && _streams == null)
     {
         _streams = (MemoryStream[])_oleDropData.GetData("FileContents");
     }
 }
Exemplo n.º 3
0
        private void Parse()
        {
            if (!_isValid)
                throw new Exception("DropData does not contain any files");

            if (!_parsed)
            {
                if (!_dataObject.GetDataPresent("FileDrop"))
                {
                    _oleDropData = new OleDropData(_dataObject);

                    if (_dataObject.GetDataPresent("FileGroupDescriptorW"))
                        _filenames = (string[])_oleDropData.GetData("FileGroupDescriptorW");
                    else
                        _filenames = (string[])_oleDropData.GetData("FileGroupDescriptor");
                }
                else
                {
                    _filenames = (string[])_dataObject.GetData("FileDrop");
                }

                _parsed = true;
            }
        }