protected override Task DoLoad() { var provider = IoC.Get <CppProjectProvider>(); var projectInfo = (CppProjectInfo)provider.Load(FilePath); if (string.IsNullOrWhiteSpace(projectInfo?.Path)) { return(Task.FromResult(false)); } foreach (var folder in projectInfo.IncludeDirectories) { FoldersInclude += folder + Environment.NewLine; } FoldersInclude = FoldersInclude.Trim(); foreach (var libraryFile in projectInfo.PrebuiltLibraries) { LibraryFiles += libraryFile + Environment.NewLine; } LibraryFiles = LibraryFiles.Trim(); OutputType = projectInfo.OutputType; return(Task.FromResult(true)); }
protected override async Task DoSave() { var projectExplorer = IoC.Get <IProjectExplorer>(); var projectInfo = (CppProjectInfo)projectExplorer.CurrentProjectInfo; projectInfo.IncludeDirectories.Clear(); projectInfo.IncludeDirectories.AddRange(FoldersInclude.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)); projectInfo.PrebuiltLibraries.Clear(); projectInfo.PrebuiltLibraries.AddRange(LibraryFiles.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)); projectInfo.OutputType = projectInfo.OutputType; var provider = IoC.Get <CppProjectProvider>(); await provider.Save(projectInfo, FilePath); }
async void CheckLibraryFiles() { var client = new RestClient(HOST_URL); //var client = new RestClient("http://sbl-crm-project-pafik13.c9users.io:8080/"); var request = new RestRequest("/LibraryFile?type=for_hospital&populate=false", Method.GET); var response = await client.ExecuteGetTaskAsync <List <LibraryFile> >(request); if (!CTForLibraryFiles.IsCancellationRequested) { switch (response.StatusCode) { case HttpStatusCode.OK: case HttpStatusCode.Created: SDiag.Debug.WriteLine("MaterialFile: {0}", response.Data.Count); LibraryFiles.Clear(); foreach (var item in response.Data) { if (!MainDatabase.IsSavedBefore <LibraryFile>(item.uuid)) { if (!string.IsNullOrEmpty(item.s3Location)) { LibraryFiles.Add(item); } } } RunOnUiThread(() => { int count = MaterialFiles.Count + WorkTypes.Count + LibraryFiles.Count; FindViewById <TextView>(Resource.Id.saUpdateEntitiesCount).Text = string.Format("Необходимо обновить {0} объектов", count); }); break; } SDiag.Debug.WriteLine(response.StatusDescription); } }