示例#1
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();
        }
示例#2
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();
        }
示例#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();
        }
示例#4
0
 public EditorState(HttpClient _HttpClient, AppState appState, ListState listState)
 {
     this.HttpClient = _HttpClient;
     AppState        = appState;
     ListState       = listState;
 }