コード例 #1
0
        public static UploadSession Start(Guid sessionId, OwnerId ownerId, List <FileUploadDescription> fileDescriptions, bool uploadAsPublic)
        {
            UploadSession session = new UploadSession(sessionId, ownerId, fileDescriptions, uploadAsPublic);

            session.State     = SessionState.Started;
            session.StartDate = DateTimeOffset.UtcNow;

            return(session);
        }
コード例 #2
0
 public FileUploaded(string fileId, OwnerId ownerId, string fileName, string contentType, bool isPublic)
     : base(schemaVersion: 1)
 {
     this.FileId      = fileId;
     this.OwnerId     = ownerId;
     this.FileName    = FileName;
     this.ContentType = contentType;
     this.IsPublic    = isPublic;
 }
コード例 #3
0
 public UploadSessionStarted(string sessionId, OwnerId ownerId, IEnumerable <FileUploadDescription> fileDescriptions, bool uploadAsPublic)
     : base(schemaVersion: 1)
 {
     // TODO: Complete member initialization
     this.SessionId        = sessionId;
     this.OwnerId          = ownerId;
     this.FileDescriptions = fileDescriptions;
     this.UploadAsPublic   = uploadAsPublic;
 }
コード例 #4
0
 private FileInformationIndex(Guid fileId, OwnerId ownerId, string fileName,
                              ContentType contentType, int contentLength, ResourceUri uri, bool isPublic)
 {
     this.Id            = fileId;
     this.OwnerId       = ownerId;
     this.FileName      = fileName;
     this.ContentType   = contentType;
     this.ContentLength = contentLength;
     this.Uri           = uri;
     this.IsPublic      = isPublic;
 }
コード例 #5
0
        private UploadSession(Guid sessionId, OwnerId ownerId, List <FileUploadDescription> fileDescriptions, bool uploadAsPublic)
        {
            this.Id        = sessionId;
            this.OwnerId   = ownerId;
            this.State     = SessionState.NotStarted;
            this.StartDate = null;
            this.EndDate   = null;
            this.SetFileDescriptions(fileDescriptions);
            this.UploadAsPublic = uploadAsPublic;

            this.AddChange(new UploadSessionStarted(sessionId.ToString(), ownerId, fileDescriptions, uploadAsPublic));
        }
コード例 #6
0
ファイル: File.cs プロジェクト: robertorodes/Rodes.FileKeeper
        private File(Guid fileId, OwnerId ownerId, string fileName,
                     ContentType contentType, Stream content, bool isPublic)
        {
            this.Id            = fileId;
            this.OwnerId       = ownerId;
            this.FileName      = fileName;
            this.ContentType   = contentType;
            this.Content       = content;
            this.IsPublic      = isPublic;
            this.ContainerName = null;
            this.OriginUri     = null;
            this.AccessUri     = null;

            this.AddChange(new FileUploaded(this.Id.ToString(), this.OwnerId, this.FileName,
                                            this.ContentType.ToString(), this.IsPublic));
        }
コード例 #7
0
 public static FileInformationIndex Create(Guid fileId, OwnerId ownerId, string fileName,
                                           ContentType contentType, int contentLength, ResourceUri uri, bool isPublic)
 {
     return(new FileInformationIndex(fileId, ownerId, fileName, contentType,
                                     contentLength, uri, isPublic));
 }
コード例 #8
0
ファイル: File.cs プロジェクト: robertorodes/Rodes.FileKeeper
 public static File Upload(Guid fileId, OwnerId ownerId, string fileName,
                           ContentType contentType, Stream content, bool isPublic)
 {
     return(new File(fileId, ownerId, fileName, contentType, content, isPublic));
 }