Exemple #1
0
        public async Task DeleteFile(string commitMessage)
        {
            var apiUrl = $"api/delete/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}";
            await HttpClient.DeleteAsync(apiUrl);

            ListState.PreviousFolder().GetAwaiter();
            ListState.EditorClose();
            ShowDone();
            NotifyStateChanged();
        }
Exemple #2
0
        public void UpdateFile(string commitMessage, string content)
        {
            var apiUrl = $"api/update/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}";

            HttpClient.PostJsonAsync <string>(apiUrl, content);
            ListState.PreviousFolder().GetAwaiter();
            ListState.EditorClose();
            ShowDone();
            NotifyStateChanged();
        }
Exemple #3
0
        public void CreateFile(string commitMessage, string newContent, string newFileName, string newFileExtension)
        {
            var x = ListState.urlList;

            x.Add(newFileName + newFileExtension);
            ListState.urlListPath = String.Join("/", x);
            var apiUrl = $"api/create/{AppState.owner}/{AppState.repoName}/{commitMessage}/{ListState.urlListPath}";

            HttpClient.PostJsonAsync <string>(apiUrl, newContent);
            ListState.EditorClose();
            ListState.PreviousFolder().GetAwaiter();
            ShowDone();
            NotifyStateChanged();
        }