Example #1
0
        /// <summary>
        /// Update the <see cref="DomainFileStore"/>
        /// </summary>
        private void UpdateFileStoreRows()
        {
            var updatedStore = ((Iteration)this.Thing).DomainFileStore.FirstOrDefault();

            if (updatedStore == null)
            {
                if (this.domainFileStoreRow != null)
                {
                    this.domainFileStoreRow.Dispose();
                    this.domainFileStoreRow = null;
                    this.ContainedRows.Remove(this.domainFileStoreRow);
                }

                return;
            }

            if (this.domainFileStoreRow == null)
            {
                this.domainFileStoreRow = new DomainFileStoreRowViewModel(updatedStore, this.Session, this);
                this.ContainedRows.Add(this.domainFileStoreRow);
            }
            else if (this.domainFileStoreRow.Thing != updatedStore)
            {
                this.domainFileStoreRow.Dispose();
                this.domainFileStoreRow = new DomainFileStoreRowViewModel(updatedStore, this.Session, this);
                this.ContainedRows.Add(this.domainFileStoreRow);
            }
        }
Example #2
0
        /// <summary>
        /// Executes the upload file command
        /// </summary>
        private void ExecuteUploadFile()
        {
            var result = this.fileDialogService.GetSaveFileDialog(string.Empty, string.Empty, string.Empty, string.Empty, 1);

            if (string.IsNullOrEmpty(result))
            {
                return;
            }

            // TODO on Task T1250: Replace the following 3 lines with an actual call to the server to upload the file
            var uploadedFile = new File();
            var participant  = new Participant {
                Person = new Person()
            };
            var fileRevision = new FileRevision {
                Creator = participant
            };

            uploadedFile.FileRevision.Add(fileRevision);
            var uploadedRow = new DomainFileStoreRowViewModel(((Iteration)this.Thing).DomainFileStore.FirstOrDefault(), this.Session, this.domainFileStoreRow);

            this.ContainedRows.Add(uploadedRow);
        }