public override object Backup()
        {
            EECExportDestination clone = base.Backup() as EECExportDestination;
            SIEESettings         s     = (SIEESettings)SIEESerializer.Clone(settings.GetEmbeddedSettings());

            clone.settings.SetEmbeddedSettings(s);
            return(clone);
        }
Пример #2
0
        private void btn_configure_Click(object sender, EventArgs e)
        {
            Configure confDlg = new Configure();

            Cursor.Current = Cursors.WaitCursor;
            try
            {
                cbox_extensionSelector_SelectedIndexChanged(null, null);

                confDlg.AddControl(control);
                control.Size = confDlg.Size;

                // Simulate serialization by SIEE and by OCC
                confDlg.Settings = (SIEESettings)SIEESerializer.Clone(settings);
                string xmlString = Serializer.SerializeToXmlString(settings, System.Text.Encoding.Unicode);

                if (Properties.Settings.Default.ConfigSize.Width != 0)
                {
                    confDlg.Size = Properties.Settings.Default.ConfigSize;
                }

                if (confDlg.MyShowDialog() == DialogResult.OK)
                {
                    settings = confDlg.Settings;
                    try
                    {
                        schema = settings.CreateSchema();
                        schema.MakeFieldnamesOCCCompliant();
                        verifySchema(schema);

                        lbl_message.Text          = "Settings and schema";
                        lbl_location.Text         = description.GetLocation(settings);
                        richTextBox_settings.Text = settings.ToString() + Environment.NewLine +
                                                    "---------------" + Environment.NewLine +
                                                    schema.ToString(data: false) + Environment.NewLine +
                                                    "---------------" + Environment.NewLine +
                                                    "Location = " + description.GetLocation(settings);
                        btn_export.Enabled  = false;
                        btn_capture.Enabled = true;
                        lbl_status.Text     = "Configuration ready";
                    }
                    catch (Exception e1)
                    {
                        MessageBox.Show("Error loading configuration\n" + e1.Message);
                    }
                    Properties.Settings.Default.ConfigSize = confDlg.Size;
                    saveCurrentSettings();
                }
            }
            finally { Cursor.Current = Cursors.Default; }
        }