示例#1
0
        public IItemNode GetFileInfo(IItemNode node)
        {
            switch (node.GetRoot.RootType.Type)
            {
            case CloudType.Dropbox:
                return(Dropbox.GetMetaData(node));

            case CloudType.GoogleDrive:
                Drivev2_File item = GoogleDrive.GetMetadataItem(node);
                node.Info.Size    = item.fileSize ?? -1;
                node.Info.Name    = item.title;
                node.Info.DateMod = item.modifiedDate ?? DateTime.Now;
                return(node);

            case CloudType.LocalDisk:
                return(LocalDisk.GetFileInfo(node));

            case CloudType.Mega:
                return(MegaNz.GetItem(node));

            default:
                throw new UnknowCloudNameException("Error Unknow Cloud Type: " + node.GetRoot.RootType.Type.ToString());
            }
        }
示例#2
0
        public ExplorerNode GetFileInfo(ExplorerNode node)
        {
            switch (node.GetRoot.NodeType.Type)
            {
            case CloudType.Dropbox:
                return(Dropbox.GetMetaData(node));

            case CloudType.GoogleDrive:
                GD_item item = GoogleDrive.GetMetadataItem(node);
                node.Info.Size    = item.fileSize;
                node.Info.Name    = item.title;
                node.Info.DateMod = DateTime.Parse(item.modifiedDate);
                return(node);

            case CloudType.LocalDisk:
                return(LocalDisk.GetFileInfo(node));

            case CloudType.Mega:
                return(MegaNz.GetItem(node));

            default:
                throw new UnknowCloudNameException("Error Unknow Cloud Type: " + node.GetRoot.NodeType.Type.ToString());
            }
        }