Exemplo n.º 1
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            opts.MaxShortDescriptionTextLength = Convert.ToInt32(txtShortDescMaxSize.Text);
            opts.BasicFieldsSameAsAdvanced     = chkBasicAdvancedEqual.IsChecked.HasValue && chkBasicAdvancedEqual.IsChecked.Value;
            opts.DefaultTermsPathP1            = txtTermsPath.Text;
            opts.DefaultTermsPathP2            = txtTermsPath_Copy.Text;

            AppService.SaveProgramOptions(opts);
            AppService.LogLine("Saved options");
            AppService.RefreshMainWindowOptions();
            this.Close();
        }
Exemplo n.º 2
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            //TODO: add basic and advanced combination on option flag
            c.BasicCPU       = txtBasicCPU.Text;
            c.BasicRAM       = txtBasicRAM.Text;
            c.BasicHDD       = txtBasicHDD.Text;
            c.BasicOS        = txtBasicOS.Text;
            c.CPUType        = txtCPUType.Text;
            c.RAMCapacity    = txtRAMCapacity.Text;
            c.RAMType        = txtRAMType.Text;
            c.HDDSize        = txtHDDSize.Text;
            c.CPUSpeed       = txtCPUSpeed.Text;
            c.CPUCores       = txtCPUCores.Text;
            c.CPUThreads     = txtCPUThreads.Text;
            c.HDDQuantity    = txtHDDQuantity.Text;
            c.HDDSpeed       = txtHDDSpeed.Text;
            c.GFX            = txtGFX.Text;
            c.ScreenSize     = txtScreenSize.Text;
            c.ScreenRes      = txtScreenRes.Text;
            c.ScreenType     = txtScreenType.Text;
            c.Battery        = txtBattery.Text;
            c.OSVersion      = txtOSVersion.Text;
            c.Webcam         = txtWebcam.Text;
            c.OtherDrives    = txtOtherDrives.Text;
            c.Nics           = txtNics.Text;
            c.ItemTitle      = txtItemTitle.Text;
            c.ItemLongDescP1 = txtItemLongDescP1.Text;
            c.ItemLongDescP2 = txtItemLongDescP2.Text;
            c.HDDInterface   = txtHDDInterface.Text;

            if (string.IsNullOrWhiteSpace(path))
            {
                path = AppService.ShowSaveDialog(opts, "txt", "computer");
            }

            if (!string.IsNullOrWhiteSpace(path))
            {
                FileIoService.SaveObjectToFile(c, path);
                AppService.RefreshItem(c, path);
                AppService.RefreshMainWindowOptions();
                AppService.LogLine($"Saved item to \"{path}\"");
                this.Close();
            }
        }
Exemplo n.º 3
0
        private void BtnSave_Click(object sender, RoutedEventArgs e)
        {
            part.ItemTitle      = txtItemTitle.Text;
            part.ItemLongDescP1 = txtItemLongDescP1.Text;
            part.ItemLongDescP2 = txtItemLongDescP2.Text;

            if (string.IsNullOrWhiteSpace(path))
            {
                path = AppService.ShowSaveDialog(opts, "txt", "part");
            }
            else
            {
                FileIoService.SaveObjectToFile(part, path);
                AppService.RefreshItem(part, path);
                AppService.RefreshMainWindowOptions();
                AppService.LogLine($"Saved item to \"{path}\"");
                this.Close();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// copy a user specified html file to the template path
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnAddTemplate_Click(object sender, RoutedEventArgs e)
        {
            var path = AppService.ShowOpenFileDialog(opts, "Html-Files(*.html)|*.html");

            if (!string.IsNullOrWhiteSpace(path))
            {
                if (path.Split('.').Last().ToUpper().Equals("HTML"))
                {
                    File.Copy(path, GlobalConstants.TemplatesPath + "\\" + path.Split('\\').Last(), true);
                    AppService.LogLine($"Added template file \"{path}\" to Templates");
                    AppService.RefreshMainWindowOptions();
                }
                else
                {
                    AppService.LogLine($"Did not add template file \"{path}\". File must be HTML type");
                }
            }
            else
            {
                MessageBox.Show("Must specify a file");
            }
        }
Exemplo n.º 5
0
 private void BtnCancel_Click(object sender, RoutedEventArgs e)
 {
     AppService.RefreshMainWindowOptions();
     this.Close();
 }