예제 #1
0
        private void LogException(Exception ex)
        {
            ex = WrapCOMException(ex);

            ExceptionXml exceptionXml = new ExceptionXml(ex);

            DVDProfilerSerializer <ExceptionXml> .Serialize(ErrorFile, exceptionXml);
        }
예제 #2
0
        private void LogException(Exception ex)
        {
            ex = this.WrapCOMException(ex);

            var exceptionXml = new ExceptionXml(ex);

            DVDProfilerSerializer <ExceptionXml> .Serialize(_errorFile, exceptionXml);
        }
예제 #3
0
        private void SaveIgnore(string fileName)
        {
            DVDProfilerSerializer <Ignore.IgnoreConfiguration> .Serialize(fileName, _ignore);

            IgnoreFileTextBox.Text = fileName;

            Properties.Settings.Default.IgnoreFile = fileName;
            Properties.Settings.Default.Save();

            UpdateIgnoreLabel();
        }
        private static void ExecuteSave <T>(T configuration, string fileName) where T : class, new()
        {
            using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read))
            {
                using (var xtw = new XmlTextWriter(fs, Encoding.UTF8))
                {
                    xtw.Formatting = Formatting.Indented;

                    DVDProfilerSerializer <T> .Serialize(xtw, configuration);
                }
            }
        }
예제 #5
0
        public void Unload()
        {
            Api.UnregisterMenuItem(_addMenuToken);

            try
            {
                DVDProfilerSerializer <Settings> .Serialize(_settingsFile, _settings);
            }
            catch (Exception ex)
            {
                UIServices.ShowMessageBox(string.Format(MessageBoxTexts.FileCantBeWritten, _settingsFile, ex.Message), MessageBoxTexts.ErrorHeader, Buttons.OK, Icon.Error);
            }

            _serviceProvider.Api = null;
        }
예제 #6
0
        private static void SaveSetting()
        {
            try
            {
                if (Directory.Exists(_SettingsPath) == false)
                {
                    Directory.CreateDirectory(_SettingsPath);
                }

                DVDProfilerSerializer <Settings> .Serialize(_SettingsFile, _Settings);
            }
            catch (Exception ex)
            {
                MessageBox.Show(String.Format(MessageBoxTexts.FileCantBeWritten, _SettingsFile, ex.Message), MessageBoxTexts.WarningHeader, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
예제 #7
0
        private static void TryWriteErrorFile(Exception ex)
        {
            try
            {
                ExceptionXml xml = new ExceptionXml(ex);

                String temp = Path.GetTempPath();

                String file = Path.Combine(temp, "ProfileHistoryError.xml");

                DVDProfilerSerializer <ExceptionXml> .Serialize(file, xml);

                MessageBox.Show(String.Format(MessageBoxTexts.CriticalError, ex.Message, file), MessageBoxTexts.CriticalErrorHeader, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch
            { }
        }
예제 #8
0
        public void Unload()
        {
            this.UnloadReceiver();

            try
            {
                DVDProfilerSerializer <Settings> .Serialize(_settingsFile, _settings);
            }
            catch (Exception ex)
            {
                MessageBox.Show(string.Format(MessageBoxTexts.FileCantBeWritten, _settingsFile, ex.Message), MessageBoxTexts.ErrorHeader, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            Api.UnregisterMenuItem(_copyCastMenuToken);
            Api.UnregisterMenuItem(_copyCrewMenuToken);
            Api.UnregisterMenuItem(_pasteMenuToken);
            Api.UnregisterMenuItem(_receiverSettingMenuToken);

            Api = null;
        }