<< Click to Display Table of Contents >> TNGFileDescriptorFormat |
|
TNGFileDescriptor record allows to specify the following file properties:
•Name - the name of file, like 'MyText.txt'
•Clsid - is the special GUID like identifier for special file system objects, like "Recycle Bin". Please read MSDN documentation.
•Attributes - file attributes, like for any other file.
•CreationTime, LastAccessTime, LastWriteTime - file times.
•Size - the size of corresponding data stream, in bytes.
•Flags - this property indicates, which other properties has been specified. A flag is set up automatically, when the corresponding property value is assigned. Actually, only Name property is required to be specified, all other properties are optional.
The class declares two methods: Data and Ref. Data method can be used to drag virtual files at the source side, while Ref method can be used to receive files data data at the target side. NG Drag&Drop declares special type alias CF.FILEDESCRIPTOR to make user's code more readable:
SetLegnth(d, 1);
d[0].Name := 'c:\MyText1.txt';
d[0].Size := 10;
NGDropSource.Add(CF.FILEDESCRIPTOR.Data(d))
.Add(CF.FILECONTENTS.Data(...))
.Execute;
NGDropTarget.Register(MyTargetPanel, procedure(C: TNGTargetContext)
var
d: TNGFileArray;
cnt: TNGFileContents;
begin
if C.Accept(CF.FILEDESCRIPTOR.Ref(@d)) and
C.Accept(CF.FILECONTENTS.Ref(@cnt)) then
ShowFiles(d);
end);