Exemplo n.º 1
0
        /// <summary>
        /// This method saves the Settings to xml
        /// </summary>
        public bool SaveSettings()
        {
            // initial value
            bool saved = false;

            // if the value for HasSettings is true and the SettingsFile exists
            if ((HasSettings) && (HasSettingsFile))
            {
                // Create a new instance of a 'SettingsWriter' object.
                SettingsWriter writer = new SettingsWriter();

                // export the notes to xml
                string xml = writer.ExportSetting(Settings);

                // if the file exists on the hard drive
                if (File.Exists(SettingsFile))
                {
                    // Delete the existing file
                    File.Delete(SettingsFile);
                }

                // write out the xml
                File.AppendAllText(SettingsFile, xml);
            }

            // return value
            return(saved);
        }
        private void SaveSettings()
        {
            if (_settings == null)
            {
                _settings = new ApplicationSettings();
            }

            _settings.WindowPositionX = Location.X;
            _settings.WindowPositionY = Location.Y;
            _settings.WindowHeight    = Size.Height;
            _settings.WindowWidth     = Size.Width;
            _settings.FormWindowState = WindowState;

            _settings.BackgroundColorRed   = textToEncrypt.BackColor.R;
            _settings.BackgroundColorGreen = textToEncrypt.BackColor.G;
            _settings.BackgroundColorBlue  = textToEncrypt.BackColor.B;

            _settings.ForegroundColorRed   = textToEncrypt.ForeColor.R;
            _settings.ForegroundColorGreen = textToEncrypt.ForeColor.G;
            _settings.ForegroundColorBlue  = textToEncrypt.ForeColor.B;

            _settings.WordWrap = wordWrapToolStripMenuItem.Checked;

            _settings.DisableUpgradeNoticeVersion11 = _upgradeNotice.DontShowThisAgain;

            SettingsWriter.WriteSettingsFile(_settings);
        }
Exemplo n.º 3
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            //Notify.KillAndClose();
            ni.Dispose();
            CloseAll();
            Pinger.Stop();

            SettingsWriter w = new SettingsWriter(Settings.Reg);

            w.Write(total, "TOTAL");
            w.Close("Total");

            GlobalProperties.Client.Close();

            if (Opacity != 0.0)
            {
                e.Cancel = true;
                new Thread(() =>
                {
                    while (Opacity != 0.0)
                    {
                        Invoke((MethodInvoker) delegate
                        {
                            Opacity -= 0.1;
                        });
                        Thread.Sleep(50);
                    }
                    Invoke((MethodInvoker) delegate
                    {
                        base.OnFormClosing(e);
                        Environment.Exit(0);
                    });
                }).Start();
            }
        }
Exemplo n.º 4
0
        private void SaveSettings()
        {
            if (_settings == null)
            {
                _settings = new ApplicationSettings();
            }

            _settings.WindowPositionX = Location.X;
            _settings.WindowPositionY = Location.Y;
            _settings.WindowHeight    = Size.Height;
            _settings.WindowWidth     = Size.Width;
            _settings.FormWindowState = WindowState;

            if (_settings.FormWindowState == FormWindowState.Minimized)
            {
                _settings.FormWindowState = FormWindowState.Maximized;
                _settings.WindowWidth     = Screen.PrimaryScreen.Bounds.Width;
                _settings.WindowHeight    = Screen.PrimaryScreen.Bounds.Height;
            }

            _settings.DetectUrl = richTextBox.DetectUrls;
            _settings.WordWrap  = richTextBox.WordWrap;

            _settings.BackgroundColorRed   = richTextBox.BackColor.R;
            _settings.BackgroundColorGreen = richTextBox.BackColor.G;
            _settings.BackgroundColorBlue  = richTextBox.BackColor.B;

            _settings.ForegroundColorRed   = richTextBox.ForeColor.R;
            _settings.ForegroundColorGreen = richTextBox.ForeColor.G;
            _settings.ForegroundColorBlue  = richTextBox.ForeColor.B;

            SettingsWriter.WriteSettingsFile(_settings);
        }
Exemplo n.º 5
0
        private void LoadSettings()
        {
            _settings = SettingsWriter.ReadSettingsFile();

            if (_settings != null)
            {
                Location    = new Point(_settings.WindowPositionX, _settings.WindowPositionY);
                Size        = new Size(_settings.WindowWidth, _settings.WindowHeight);
                WindowState = _settings.FormWindowState;

                richTextBox.BackColor             = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                richTextBox.ForeColor             = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);
                richTextBox.DetectUrls            = _settings.DetectUrl;
                richTextBox.WordWrap              = _settings.WordWrap;
                wordWrapToolStripMenuItem.Checked = _settings.WordWrap;

                foreach (string fileName in _settings.RecentFileList)
                {
                    AddFileToRecentFileListMenu(fileName);
                }
            }
            else
            {
                SaveSettings();
            }
        }
Exemplo n.º 6
0
        public virtual List <string> GetAllKeys()
        {
            var keys = Settings.GetAllKeys().ToHashSet();

            SettingsWriter?.GetAllKeys().Each(x => keys.Add(x));

            return(keys.ToList());
        }
Exemplo n.º 7
0
        public SettingsViewModel(SettingsProvider settingsProvider, SettingsWriter settingsWriter)
        {
            _settingsWriter = settingsWriter;

            Settings = settingsProvider.GetAllSettings();

            SaveSettingsCommand = new RelayCommand(SaveSettings);
        }
Exemplo n.º 8
0
        public virtual void Set <T>(string key, T value)
        {
            if (SettingsWriter == null)
            {
                SettingsWriter = new DictionarySettings();
            }

            SettingsWriter.Set(key, value);
        }
Exemplo n.º 9
0
 void save()
 {
     GlobalProperties.NI.ShowBalloonTip(2000, "Saving Plugins...", "The plugins are now being saved.", ToolTipIcon.Info);
     new Thread(delegate()
     {
         SettingsWriter w = new SettingsWriter(Settings.Reg);
         w.Write(GlobalProperties.RawPlugins, "Plugins");
         w.Close("Plugins");
     }).Start();
     modified = false;
 }
Exemplo n.º 10
0
        public string Get(string name)
        {
            if (SettingsWriter != null)
            {
                var value = SettingsWriter.Get(name);
                if (value != null)
                {
                    return(value);
                }
            }

            return(Settings.Get(name));
        }
Exemplo n.º 11
0
        private void Close(object sender, RoutedEventArgs e)
        {
            var an = new DoubleAnimation(0, TimeSpan.FromMilliseconds(200));

            an.Completed += (s, ev) =>
            {
                Hide();
                if (Settings.ForceSoftwareRendering)
                {
                    RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;
                }
            };
            BeginAnimation(OpacityProperty, an);
            SettingsWriter.Save();
        }
Exemplo n.º 12
0
 void Start()
 {
     sw = new SettingsWriter();
     Debug.LogError(File.Exists(Application.persistentDataPath + "/settings.dat") + " " + Application.persistentDataPath + "/settings.dat");
     if (File.Exists(Application.persistentDataPath + "/settings.dat") == true)
     {
         sw.loadSettings();
         //will need to delete the settings.dat file if I add any more info to the settings class
     }
     else
     {
         sw.saveSettings();
     }
     setVolumes();
     // ls = GameObject.FindGameObjectWithTag("LoadScreen").GetComponent<LoadScreen>();
 }
Exemplo n.º 13
0
        public SystemMessagesConfigWindow()
        {
            InitializeComponent();
            DataContext     = this;
            _hiddenMessages = new SynchronizedObservableCollection <SystemMessageViewModel>();
            _showedMessages = new SynchronizedObservableCollection <SystemMessageViewModel>();

            SettingsHolder.UserExcludedSysMsg.ForEach(opc =>
            {
                _hiddenMessages.Add(new SystemMessageViewModel(opc, SessionManager.DB.SystemMessagesDatabase.Messages[opc]));
            });
            SessionManager.DB.SystemMessagesDatabase.Messages.ToList().ForEach(keyVal =>
            {
                if (SettingsHolder.UserExcludedSysMsg.Contains(keyVal.Key))
                {
                    return;
                }
                _showedMessages.Add(new SystemMessageViewModel(keyVal.Key, keyVal.Value));
            });

            _hiddenMessages.CollectionChanged += (_, args) =>
            {
                switch (args.Action)
                {
                case System.Collections.Specialized.NotifyCollectionChangedAction.Add:
                    foreach (var item in args.NewItems)
                    {
                        SettingsHolder.UserExcludedSysMsg.Add((item as SystemMessageViewModel)?.Opcode);
                    }
                    break;

                case System.Collections.Specialized.NotifyCollectionChangedAction.Remove:
                    foreach (var item in args.OldItems)
                    {
                        SettingsHolder.UserExcludedSysMsg.Remove((item as SystemMessageViewModel)?.Opcode);
                    }
                    break;
                }
                SettingsWriter.Save();
            };

            ShowedMessagesView = CollectionViewUtils.InitLiveView(null, ShowedMessages, new string[] { }, new SortDescription[] { });
            HiddenMessagesView = CollectionViewUtils.InitLiveView(null, HiddenMessages, new string[] { }, new SortDescription[] { });
            ((ICollectionView)ShowedMessagesView).CollectionChanged += GcPls;
            ((ICollectionView)HiddenMessagesView).CollectionChanged += GcPls;
        }
Exemplo n.º 14
0
        private void btnResetTotal_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }

            try
            {
                SettingsWriter w = new SettingsWriter(Settings.Reg);
                w.Write(0, "TOTAL");
                w.Close("Total");
                GlobalProperties.MainForm.ResetTotal();
            }
            catch
            {
            }
        }
Exemplo n.º 15
0
        public void Save(SettingsWriter sw)
        {
            _config.Save(sw);

            sw.Save("MusicBrainzLookup", _editTags);
            sw.Save("CTDBVerifyOnEncode", _CTDBVerifyOnEncode);
            sw.Save("AccurateRipLookup", _ARVerifyOnEncode);
            sw.Save("LocalDBLookup", _useLocalDB);
            sw.Save("SkipRecent", _skipRecent);
            sw.Save("CUEToolsDBLookup", _CTDBVerify);
            sw.Save("OutputAudioType", (int)_outputAudioType);
            sw.Save("OutputAudioFmt", _outputAudioFormat);
            sw.Save("AccurateRipMode", (int)_action);
            sw.Save("CUEStyle", (int)_CUEStyle);
            sw.Save("WriteOffset", (int)_writeOffset);
            sw.Save("OutputPathTemplate", _outputTemplate);
            sw.Save("Script", _script);
        }
Exemplo n.º 16
0
        private void btnSaveProfile_Click(object sender, EventArgs e)
        {
            if (lstProfiles.SelectedItems.Count == 0)
            {
                MessageBox.Show("No profiles selected for saving.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ProfileData d = lstProfiles.SelectedItems[0].Tag as ProfileData;

            d.Host                           = txtHost.Text;
            d.Port                           = cint(txtPort.Text);
            d.EnableBackupHost               = xBackup.Checked;
            d.ConnectionPassword             = txtPassword.Text;
            d.UninstallPassword              = txtUpdatePassword.Text;
            d.VisibleMode                    = xVisMode.Checked;
            d.BackupHost                     = txtBackupHost.Text;
            d.BackupPort                     = cint(txtBackupPort.Text);
            d.DirectoryName                  = txtFolderName.Text;
            d.FileName                       = txtFilename.Text;
            d.Hkcu                           = xHKCU.Checked;
            d.HkcuKey                        = txtHKCU.Text;
            d.Hklm                           = xHKLM.Checked;
            d.HklmKey                        = txtHKLM.Text;
            d.ShowConsole                    = xShowConsole.Checked;
            d.PluginRegName                  = txtPluginStoreName.Text;
            d.PluginRegLocation              = txtPluginStoreLoc.Text;
            d.Mutex                          = txtMutex.Text;
            d.Melt                           = xMelt.Checked;
            d.LastModified                   = DateTime.Now.ToShortDateString();
            d.Install                        = xInstall.Checked;
            d.Name                           = lstProfiles.SelectedItems[0].Text;
            lstProfiles.SelectedItems[0].Tag = d;
            lstProfiles.SelectedItems[0].SubItems[1].Text = d.LastModified;

            SettingsWriter w = new SettingsWriter(Net_Weave_R.Misc.Settings.Reg);

            w.Write(d, "DATA");
            w.Close("PROFILE_" + d.ID.ToString());

            MessageBox.Show("Saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 17
0
 private void OnSizeChanged(object sender, SizeChangedEventArgs e)
 {
     if (!WindowSettings.AllowOffScreen)
     {
         CheckBounds();
     }
     if (_ignoreSize)
     {
         return;
     }
     if (WindowSettings.W != ActualWidth ||
         WindowSettings.H != ActualHeight)
     {
         WindowSettings.W = ActualWidth;
         WindowSettings.H = ActualHeight;
         if (!App.Loading)
         {
             SettingsWriter.Save();
         }
     }
 }
        private void LoadSettings()
        {
            _settings = SettingsWriter.ReadSettingsFile();

            if (_settings != null)
            {
                Location = new Point(_settings.WindowPositionX, _settings.WindowPositionY);
                Size     = new Size(_settings.WindowWidth, _settings.WindowHeight);

                if (_settings.FormWindowState == FormWindowState.Minimized)
                {
                    _settings.FormWindowState = FormWindowState.Maximized;
                }

                WindowState = _settings.FormWindowState;

                textToEncrypt.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                textToEncrypt.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                encryptedText.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                encryptedText.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                decryptedText.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                decryptedText.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                textToDecrypt.BackColor = Color.FromArgb(_settings.BackgroundColorRed, _settings.BackgroundColorGreen, _settings.BackgroundColorBlue);
                textToDecrypt.ForeColor = Color.FromArgb(_settings.ForegroundColorRed, _settings.ForegroundColorGreen, _settings.ForegroundColorBlue);

                wordWrapToolStripMenuItem.Checked = _settings.WordWrap;
                _upgradeNotice.DontShowThisAgain  = _settings.DisableUpgradeNoticeVersion11;
            }
            else
            {
                SaveSettings();
            }
        }
Exemplo n.º 19
0
 protected void Drag(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (!_ignoreSize)
         {
             ResizeMode = ResizeMode.NoResize;
         }
         DragMove();
         UpdateButtons();
         CheckBounds();
         if (!_ignoreSize)
         {
             ResizeMode = ResizeMode.CanResize;
         }
         _settings.X = Left / Settings.ScreenW;
         _settings.Y = Top / Settings.ScreenH;
         SettingsWriter.Save();
     }
     catch
     {
         // ignored
     }
 }
Exemplo n.º 20
0
 protected void Drag(object sender, MouseButtonEventArgs e)
 {
     try
     {
         if (!_ignoreSize)
         {
             ResizeMode = ResizeMode.NoResize;
         }
         DragMove();
         UpdateButtons();
         CheckBounds();
         if (!_ignoreSize)
         {
             ResizeMode = ResizeMode.CanResize;
         }
         WindowSettings.X = Left / WindowManager.ScreenSize.Width;
         WindowSettings.Y = Top / WindowManager.ScreenSize.Height;
         SettingsWriter.Save();
     }
     catch
     {
         // ignored
     }
 }
Exemplo n.º 21
0
        private void SaveSettings()
        {
            SaveProfile();

            SettingsWriter sw = new SettingsWriter("CUE Tools", "settings.txt", Application.ExecutablePath);
            SaveScripts(SelectedAction);
            sw.Save("LastMOTD", lastMOTD);
            sw.Save("ChoiceWidth", _choiceWidth);
            sw.Save("ChoiceHeight", _choiceHeight);
            sw.Save("ChoiceMaxed", _choiceMaxed);
            sw.Save("InputPath", InputPath);
            sw.Save("DefaultLosslessFormat", _defaultLosslessFormat);
            sw.Save("DefaultLossyFormat", _defaultLossyFormat);
            sw.Save("DefaultHybridFormat", _defaultHybridFormat);
            sw.Save("DefaultNoAudioFormat", _defaultNoAudioFormat);
            sw.Save("DontGenerate", !_outputPathUseTemplate);
            sw.Save("OutputPathUseTemplates", comboBoxOutputFormat.Items.Count - OutputPathUseTemplates.Length);
            for (int iFormat = comboBoxOutputFormat.Items.Count - 1; iFormat >= OutputPathUseTemplates.Length; iFormat--)
                sw.Save(string.Format("OutputPathUseTemplate{0}", iFormat - OutputPathUseTemplates.Length), comboBoxOutputFormat.Items[iFormat].ToString());

            sw.Save("UsePregapForFirstTrackInSingleFile", _usePregapForFirstTrackInSingleFile);
            sw.Save("ReducePriority", _reducePriority);
            sw.Save("FileBrowserState", (int)FileBrowserState);
            sw.Save("ReportState", ReportState);
            sw.Save("CorrectorLookup", (int)CorrectorMode);
            sw.Save("CorrectorOverwrite", toolStripButtonCorrectorOverwrite.Checked);
            sw.Save("CorrectorFormat", toolStripDropDownButtonCorrectorFormat.Text);
            sw.Save("WidthIncrement", FileBrowserState == FileBrowserStateEnum.Hidden ? SizeIncrement.Width : Width - OpenMinimumSize.Width);
            sw.Save("HeightIncrement", !ReportState ? SizeIncrement.Height : Height - OpenMinimumSize.Height);
            sw.Save("Top", Top);
            sw.Save("Left", Left);

            StringBuilder profiles = new StringBuilder();
            foreach (ToolStripItem item in toolStripDropDownButtonProfile.DropDownItems)
                if (item != toolStripTextBoxAddProfile
                    && item != toolStripMenuItemDeleteProfile
                    && item != defaultToolStripMenuItem
                    && item != toolStripSeparator5
                    )
                {
                    if (profiles.Length > 0)
                        profiles.Append(' ');
                    profiles.Append(item.Text);
                }
            sw.Save("Profiles", profiles.ToString());

            _defaultProfile.Save(sw);
            sw.Close();
        }
Exemplo n.º 22
0
        private void SaveProfile()
        {
            _profile._outputAudioType = SelectedOutputAudioType;
            _profile._outputAudioFormat = SelectedOutputAudioFormat;
            _profile._action = SelectedAction;
            _profile._CUEStyle = SelectedCUEStyle;
            _profile._writeOffset = (int)numericWriteOffset.Value;
            _profile._outputTemplate = comboBoxOutputFormat.Text;
            _profile._script = SelectedScript;
            _profile._useFreeDb = checkBoxUseFreeDb.Checked;
            _profile._useMusicBrainz = checkBoxUseMusicBrainz.Checked;
            _profile._useAccurateRip = checkBoxUseAccurateRip.Checked;
            _profile._useCUEToolsDB = checkBoxVerifyUseCDRepair.Checked;
            _profile._useLocalDB = checkBoxVerifyUseLocal.Checked;
            _profile._skipRecent = checkBoxSkipRecent.Checked;

            if (_profile != _defaultProfile)
            {
                SettingsWriter sw = new SettingsWriter("CUE Tools", string.Format("profile-{0}.txt", _profile._name), Application.ExecutablePath);
                _profile.Save(sw);
                sw.Close();
            }
        }
Exemplo n.º 23
0
 void save()
 {
     GlobalProperties.NI.ShowBalloonTip(2000, "Saving Plugins...", "The plugins are now being saved.", ToolTipIcon.Info);
     new Thread(delegate()
         {
             SettingsWriter w = new SettingsWriter(Settings.Reg);
             w.Write(GlobalProperties.RawPlugins, "Plugins");
             w.Close("Plugins");
         }).Start();
     modified = false;
 }
 private void OnCloseButtonClick(object sender, RoutedEventArgs e)
 {
     HideWindow();
     SettingsWriter.Save();
 }
Exemplo n.º 25
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            //Notify.KillAndClose();
            ni.Dispose();
            CloseAll();
            Pinger.Stop();

            SettingsWriter w = new SettingsWriter(Settings.Reg);
            w.Write(total, "TOTAL");
            w.Close("Total");

            GlobalProperties.Client.Close();

            if (Opacity != 0.0)
            {
                e.Cancel = true;
                new Thread(() =>
                {
                    while (Opacity != 0.0)
                    {
                        Invoke((MethodInvoker)delegate
                        {
                            Opacity -= 0.1;
                        });
                        Thread.Sleep(50);
                    }
                    Invoke((MethodInvoker)delegate
                    {
                        base.OnFormClosing(e);
                        Environment.Exit(0);
                    });
                }).Start();
            }
        }
Exemplo n.º 26
0
        public void Save(SettingsWriter sw)
        {
            sw.Save("Version", 204);
            sw.Save("ArFixWhenConfidence", fixOffsetMinimumConfidence);
            sw.Save("ArFixWhenPercent", fixOffsetMinimumTracksPercent);
            sw.Save("ArEncodeWhenConfidence", encodeWhenConfidence);
            sw.Save("ArEncodeWhenPercent", encodeWhenPercent);
            sw.Save("ArEncodeWhenZeroOffset", encodeWhenZeroOffset);
            sw.Save("ArNoUnverifiedOutput", noUnverifiedOutput);
            sw.Save("ArFixOffset", fixOffset);
            sw.Save("ArWriteCRC", writeArTagsOnEncode);
            sw.Save("ArWriteLog", writeArLogOnConvert);
            sw.Save("ArWriteTagsOnVerify", writeArTagsOnVerify);
            sw.Save("ArWriteLogOnVerify", writeArLogOnVerify);

            sw.Save("PreserveHTOA", preserveHTOA);
            sw.Save("DetectGaps", detectGaps);
            sw.Save("AutoCorrectFilenames", autoCorrectFilenames);
            sw.Save("KeepOriginalFilenames", keepOriginalFilenames);
            sw.Save("SingleFilenameFormat", singleFilenameFormat);
            sw.Save("TrackFilenameFormat", trackFilenameFormat);
            sw.Save("RemoveSpecialCharacters", removeSpecial);
            sw.Save("SpecialCharactersExceptions", specialExceptions);
            sw.Save("ReplaceSpaces", replaceSpaces);
            sw.Save("EmbedLog", embedLog);
            sw.Save("ExtractLog", extractLog);
            sw.Save("FillUpCUE", fillUpCUE);
            sw.Save("OverwriteCUEData", overwriteCUEData);
            sw.Save("FilenamesANSISafe", filenamesANSISafe);
            if (bruteForceDTL)
            {
                sw.Save("BruteForceDTL", bruteForceDTL);
            }
            sw.Save("CreateEACLOG", createEACLOG);
            sw.Save("DetectHDCD", detectHDCD);
            sw.Save("Wait750FramesForHDCD", wait750FramesForHDCD);
            sw.Save("DecodeHDCD", decodeHDCD);
            sw.Save("CreateM3U", createM3U);
            sw.Save("CreateCUEFileWhenEmbedded", createCUEFileWhenEmbedded);
            sw.Save("Truncate4608ExtraSamples", truncate4608ExtraSamples);
            sw.Save("DecodeHDCDToLossyWAV16", decodeHDCDtoLW16);
            sw.Save("DecodeHDCDTo24bit", decodeHDCDto24bit);
            sw.Save("OneInstance", oneInstance);
            sw.Save("CheckForUpdates", checkForUpdates);
            sw.Save("Language", language);

            sw.Save("SeparateDecodingThread", separateDecodingThread);

            sw.Save("WriteBasicTagsFromCUEData", writeBasicTagsFromCUEData);
            sw.Save("CopyBasicTags", copyBasicTags);
            sw.Save("CopyUnknownTags", copyUnknownTags);
            sw.Save("CopyAlbumArt", CopyAlbumArt);
            sw.Save("EmbedAlbumArt", embedAlbumArt);
            sw.Save("ExtractAlbumArt", extractAlbumArt);
            sw.Save("MaxAlbumArtSize", maxAlbumArtSize);

            sw.Save("ArLogToSourceFolder", arLogToSourceFolder);
            sw.Save("ArLogVerbose", arLogVerbose);
            sw.Save("FixOffsetToNearest", fixOffsetToNearest);

            sw.Save("ArLogFilenameFormat", ArLogFilenameFormat);
            sw.Save("AlArtFilenameFormat", AlArtFilenameFormat);

            sw.SaveText("Advanced", JsonConvert.SerializeObject(advanced,
                                                                Newtonsoft.Json.Formatting.Indented,
                                                                new JsonSerializerSettings
            {
                DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate,
                TypeNameHandling     = TypeNameHandling.Auto,
            }));

            int nFormats = 0;

            foreach (KeyValuePair <string, CUEToolsFormat> format in formats)
            {
                sw.Save(string.Format("CustomFormat{0}Name", nFormats), format.Key);
                sw.Save(string.Format("CustomFormat{0}EncoderLossless", nFormats), format.Value.encoderLossless == null ? "" : format.Value.encoderLossless.Name);
                sw.Save(string.Format("CustomFormat{0}EncoderLossy", nFormats), format.Value.encoderLossy == null ? "" : format.Value.encoderLossy.Name);
                sw.Save(string.Format("CustomFormat{0}Decoder", nFormats), format.Value.decoder == null ? "" : format.Value.decoder.Name);
                sw.Save(string.Format("CustomFormat{0}Tagger", nFormats), (int)format.Value.tagger);
                sw.Save(string.Format("CustomFormat{0}AllowLossless", nFormats), format.Value.allowLossless);
                sw.Save(string.Format("CustomFormat{0}AllowLossy", nFormats), format.Value.allowLossy);
                sw.Save(string.Format("CustomFormat{0}AllowEmbed", nFormats), format.Value.allowEmbed);
                nFormats++;
            }
            sw.Save("CustomFormats", nFormats);

            int nScripts = 0;

            foreach (KeyValuePair <string, CUEToolsScript> script in scripts)
            {
                sw.Save(string.Format("CustomScript{0}Name", nScripts), script.Key);
                int nCondition = 0;
                foreach (CUEAction action in script.Value.conditions)
                {
                    sw.Save(string.Format("CustomScript{0}Condition{1}", nScripts, nCondition++), (int)action);
                }
                sw.Save(string.Format("CustomScript{0}Conditions", nScripts), nCondition);
                nScripts++;
            }
            sw.Save("CustomScripts", nScripts);
            sw.Save("DefaultVerifyScript", defaultVerifyScript);
            sw.Save("DefaultVerifyAndConvertScript", defaultEncodeScript);

            sw.Save("GapsHandling", (int)gapsHandling);
        }
Exemplo n.º 27
0
        private void btnSaveProfile_Click(object sender, EventArgs e)
        {
            if (lstProfiles.SelectedItems.Count == 0)
            {
                MessageBox.Show("No profiles selected for saving.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ProfileData d = lstProfiles.SelectedItems[0].Tag as ProfileData;
            d.Host = txtHost.Text;
            d.Port = cint(txtPort.Text);
            d.EnableBackupHost = xBackup.Checked;
            d.ConnectionPassword = txtPassword.Text;
            d.UninstallPassword = txtUpdatePassword.Text;
            d.VisibleMode = xVisMode.Checked;
            d.BackupHost = txtBackupHost.Text;
            d.BackupPort = cint(txtBackupPort.Text);
            d.DirectoryName = txtFolderName.Text;
            d.FileName = txtFilename.Text;
            d.Hkcu = xHKCU.Checked;
            d.HkcuKey = txtHKCU.Text;
            d.Hklm = xHKLM.Checked;
            d.HklmKey = txtHKLM.Text;
            d.ShowConsole = xShowConsole.Checked;
            d.PluginRegName = txtPluginStoreName.Text;
            d.PluginRegLocation = txtPluginStoreLoc.Text;
            d.Mutex = txtMutex.Text;
            d.Melt = xMelt.Checked;
            d.LastModified = DateTime.Now.ToShortDateString();
            d.Install = xInstall.Checked;
            d.Name = lstProfiles.SelectedItems[0].Text;
            lstProfiles.SelectedItems[0].Tag = d;
            lstProfiles.SelectedItems[0].SubItems[1].Text = d.LastModified;

            SettingsWriter w = new SettingsWriter(Net_Weave_R.Misc.Settings.Reg);
            w.Write(d, "DATA");
            w.Close("PROFILE_" + d.ID.ToString());

            MessageBox.Show("Saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 28
0
 private void Image_MouseLeftButtonDown(object sender, RoutedEventArgs routedEventArgs)
 {
     SettingsWriter.Save();
     HideWindow();
 }
Exemplo n.º 29
0
        private void btnResetTotal_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes)
                return;

            try
            {
                SettingsWriter w = new SettingsWriter(Settings.Reg);
                w.Write(0, "TOTAL");
                w.Close("Total");
                GlobalProperties.MainForm.ResetTotal();
            }
            catch
            {
            }
        }
Exemplo n.º 30
0
        public static void Save()
        {
            try
            {
                SettingsWriter w = new SettingsWriter(Reg);
                w.Write(Ports, "Ports");
                w.Write(Passwords, "Passwords");
                w.Write(DupPrevnt, "Dup");
                w.Write(LogConnected, "LogConnect");
                w.Write(LogDisconnected, "LogDis");
                w.Write(NotifyConnected, "NotifyCon");
                w.Write(NotifyDisconnected, "NotifyDis");
                w.Close("Settings");
            }
            catch { }

            if (GlobalProperties.RawPlugins.Count > 0)
            {
                try
                {
                    SettingsWriter w = new SettingsWriter(Reg);
                    w.Write(GlobalProperties.RawPlugins, "List");
                    w.Close("Plugins");
                }
                catch { }
            }
        }