Ejemplo n.º 1
0
        private static AppState CreateAppState(SampleFileStore sampleFileStore)
        {
            var appState = new AppState();

            var getSampleFileByIdResult = sampleFileStore.GetSampleFileById(1);

            if (getSampleFileByIdResult.Succeed)
            {
                appState.HomePage.InputDataContent = getSampleFileByIdResult.Data.Content;
            }

            return(appState);
        }
Ejemplo n.º 2
0
        private void UseSelectedSampleFile()
        {
            if (_model.SelectedSampleFileId == -1)
            {
                Toaster.Add("A sample file must be selected", MatToastType.Warning);
                return;
            }

            var getSampleFileResult = SampleFileStore.GetSampleFileById(_model.SelectedSampleFileId);

            if (!getSampleFileResult.Succeed)
            {
                Toaster.Add(getSampleFileResult.Message, MatToastType.Warning);
                return;
            }

            _editorManager.SetValue(getSampleFileResult.Data.Content);
        }