Пример #1
0
        private void BtnSaveVat_Click(object sender, RoutedEventArgs e)
        {
            var saveDto = new SaveDto
            {
                Vat   = vat_,
                Steel = steel_,
                Argon = argon_
            };

            Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog
            {
                FileName   = "Obliczona_Kadź",               // Default file name
                DefaultExt = ".Kadz",                        // Default file extension
                Filter     = "Text documents (.Kadz)|*.Kadz" // Filter files by extension
            };

            // Show save file dialog box
            Nullable <bool> result = dlg.ShowDialog();

            // Process save file dialog box results
            if (result == true)
            {
                // Save document
                string fileName = dlg.FileName;
                File.WriteAllText(fileName, JsonConvert.SerializeObject(saveDto));
            }
        }
Пример #2
0
 public void CreatePage([FromBody] SaveDto data)
 {
     GitHelpers.Commit(Constants.RepositoryFolder, data.Path.Replace("/", "\\"), KB.Resource.NewPage, "test", Configuration.GetValue <string>("repositoryUser", null), Configuration.GetValue <string>("password", null));
     RepositoryStructure.Initialize();
 }