public static ProjectFileModel FromDtoToModel(ProjectFileDto dto)
 {
     var model = new ProjectFileModel();
     CopyIProjectItemModelMembers(model, dto);
     model.Content = dto.Content;
     return model;
 }
 public static ProjectFileDto FromModelToDto(ProjectFileModel model)
 {
     var dto = new ProjectFileDto();
     CopyIProjectItemModelMembers(dto, model);
     dto.Content = model.Content;
     return dto;
 }
        public static void ParseFile(ProjectFileDto fileModel, Action<FileOperationResponse> callback)
        {
            FileOperationRequest request = new FileOperationRequest();
            
            // Set contextual identifiers
            request.UserId = 478;  // hard-coded, for now
            request.ProjectId = fileModel.ProjectId;
            request.FileId = fileModel.Id;

            // Specify operations to perform
            request.SyncContent = new FileSyncContentRequest() { Content = fileModel.Content };
            request.Parse = new FileParseRequest() { };

            Task.Factory.StartNew(() =>
            {
                var requestJson = JsonConvert.SerializeObject(request);

                #region Simulation of call to server
                var responseJson = Server_HandleStatefulFileOperationRequest(requestJson);
                #endregion

                var response = JsonConvert.DeserializeObject<FileOperationResponse>(responseJson);

                callback.Invoke(response);
            });
        }
        public static ProjectFileModel FromDtoToModel(ProjectFileDto dto)
        {
            var model = new ProjectFileModel();

            CopyIProjectItemModelMembers(model, dto);
            model.Content = dto.Content;
            return(model);
        }
        public static ProjectFileDto FromModelToDto(ProjectFileModel model)
        {
            var dto = new ProjectFileDto();

            CopyIProjectItemModelMembers(dto, model);
            dto.Content = model.Content;
            return(dto);
        }