public static bool BuildTree(this IMediaStorage media, ref MediaInfo info, string path) { bool endSearch = false; info.CurrentPath = path; media.MediaTree.Add(info); return endSearch; }
public void CopyToPC(MediaInfo mediaToCopy) { MimeStructure attachment = mediaToCopy.attachment as MimeStructure; Image image; if (System.Diagnostics.Debugger.IsAttached) image = Image.FromStream( new System.IO.MemoryStream(imap.PeekDataByUID(attachment))); else image = Image.FromStream( new System.IO.MemoryStream(imap.GetDataByUID(attachment))); image.Save(mediaToCopy.FullName); }
public void Delete(MediaInfo mediaToDelete) { string ret = DeleteFile(mediaToDelete.CurrentPath + "/" + mediaToDelete.Name); }
public void CopyToPC(MediaInfo infoToCopy) { PullFile(infoToCopy.CurrentPath + "/" + infoToCopy.Name, infoToCopy.DestinationPath); }
private MediaInfo UnixFileInfoToMediaInfo(string fileinfo) { MediaInfo mediainfo = null; Regex x = new Regex(" +"); string[] splitInfo = x.Split(fileinfo); int ix = 0; // '-' means file // only process if this is a file of directory char type = splitInfo[ix++].FirstOrDefault(); if (type == 'd' || type == '-') { mediainfo = new MediaInfo(); if (type == 'd') mediainfo.SetAsDirectory(); // user (skip) ix++; // dir? (skip) ix++; // Files have a size here, so skip if this is a file. if (!mediainfo.IsDirectory()) ix++; mediainfo.CreationTime = DateTime.Parse(splitInfo[ix++] + " " + splitInfo[ix++]); mediainfo.Name = splitInfo[ix]; } return mediainfo; }
private bool IsMediaDir(ref MediaInfo info, string path) { bool endSearch = false; if (info.Name == TransferMedia.MediaDir) { MainMediaPath = path + (path.EndsWith("/") ? null : "/") + info.Name; endSearch = true; } return endSearch; }
private MediaInfo MessageInfoToMediaInfo(MessageInfo messageinfo, MimeStructure attachment) { MediaInfo mediainfo = new MediaInfo(); mediainfo.CreationTime = messageinfo.Envelope.Date.GetValueOrDefault(DateTime.Now); mediainfo.Name = attachment.SafeFileName; return mediainfo; }
public void Delete(MediaInfo mediaToDelete) { // not going to delete media from mail so just leaving this method empty }
private MediaInfo FileSystemInfoToMediaInfo(FileSystemInfo file) { MediaInfo mediainfo = new MediaInfo(); if ((file.Attributes & FileAttributes.Directory) == FileAttributes.Directory) mediainfo.SetAsDirectory(); mediainfo.CreationTime = file.CreationTime; mediainfo.Name = file.Name; return mediainfo; }
public void Delete(MediaInfo mediaToDelete) { File.Delete( Path.Combine(mediaToDelete.CurrentPath, mediaToDelete.Name)); }
public void CopyToPC(MediaInfo mediaToCopy) { File.Copy( Path.Combine(mediaToCopy.CurrentPath, mediaToCopy.Name), mediaToCopy.FullName); }