Ejemplo n.º 1
0
        private async void OnDelete()
        {
            if (SelectedCodeId <= 0)
            {
                return;
            }
            var cd = await CodeDocumentService.GetCodeDocumentById(SelectedCodeId);

            await CodeDocumentService.DeleteCodeDocument(cd);

            OnRefresh();
        }
Ejemplo n.º 2
0
        private async void GetCodeDocumentById(int id)
        {
            var currentCodeDocument = await CodeDocumentService.GetCodeDocumentById(id);

            if (currentCodeDocument != null)
            {
                updateDocument = currentCodeDocument;
                Title          = currentCodeDocument.Title;
                //Data = currentCodeDocument.Datas;
                Document = new TextDocument(new StringTextSource(currentCodeDocument.Datas));
                ProgrammingLanguageId = currentCodeDocument.ProgrammingLanguageId;
                ProgrammingTypeId     = currentCodeDocument.ProgrammingTypeId;
                KeyWords         = currentCodeDocument.KeyWords;
                UpdateDocumentId = currentCodeDocument.Id;
            }
        }
Ejemplo n.º 3
0
        private async void GetCodeInfo(int id)
        {
            var dc = await CodeDocumentService.GetCodeDocumentById(id);

            CodeTitle = dc.Title;
            //CodeInfo = dc.KeyWords;
            string spl = EnumHelper.GetEnumName <ProgrammingLanguage>(dc.ProgrammingLanguageId);
            string spt = EnumHelper.GetEnumName <ProgrammingType>(dc.ProgrammingTypeId);

            CodeInfo = $"语言: {spl}   框架: {spt}     关键字: {dc.KeyWords}";
            //Data = dc.Datas;
            if (dc.Datas != null)
            {
                Document = new TextDocument(new StringTextSource(dc.Datas));
            }
        }