Ejemplo n.º 1
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmSaveDialog        saveDialog = new frmSaveDialog();
            ConnectionData       connection = null;
            ConnectionTabControl currentTab = (ConnectionTabControl)tabMain.SelectedTab.Controls[0];

            if (currentTab != null)
            {
                connection = currentTab.GetSelectedConnection();
            }

            if (connection == null)
            {
                saveDialog.DisableCurrentScope();
            }
            else
            {
                saveDialog.SetCurScopeName(connection.SourceConnectionName);
            }

            if (saveDialog.ShowDialog() == DialogResult.OK)
            {
                if (saveDialog.Scope == frmSaveDialog.ScopeToSave.All)
                {
                    currentTab = null;
                }

                StorageSerializationInfo serializationInfo = new StorageSerializationInfo(
                    this._model,
                    currentTab,
                    saveDialog.Folder,
                    saveDialog.SaveCurrent,
                    saveDialog.SaveHistoric
                    );

                ProgressForm form = new ProgressForm
                {
                    Text = this._model.LocaleManager.GetLocalizedText(
                        this.Name,
                        "lbSerialization",
                        this._model.Settings.InterfaceLanguage
                        ),
                    StartPosition = FormStartPosition.CenterParent
                };

                form.ProgressBar.Style = ProgressBarStyle.Marquee;

                form.Argument = serializationInfo;
                form.DoWork  += DoSerializationWork;

                StartSerializationForm(form);
            }
        }
Ejemplo n.º 2
0
		private void saveToolStripMenuItem_Click(object sender, EventArgs e)
		{
			frmSaveDialog        saveDialog = new frmSaveDialog();
			ConnectionData       connection = null;
			ConnectionTabControl currentTab = (ConnectionTabControl)tabMain.SelectedTab.Controls[0];

			if (currentTab != null)
			{
				connection = currentTab.GetSelectedConnection();
			}

			if (connection == null)
			{
				saveDialog.DisableCurrentScope();
			}
			else
			{
				saveDialog.SetCurScopeName(connection.SourceConnectionName);
			}

			if (saveDialog.ShowDialog() == DialogResult.OK)
			{
				if (saveDialog.Scope == frmSaveDialog.ScopeToSave.All)
				{
					currentTab = null;
				}

				StorageSerializationInfo serializationInfo = new StorageSerializationInfo(
					this._model,
					currentTab,
					saveDialog.Folder,
					saveDialog.SaveCurrent,
					saveDialog.SaveHistoric
				);

				ProgressForm form = new ProgressForm
				{
					Text = this._model.LocaleManager.GetLocalizedText(
						this.Name,
						"lbSerialization",
						this._model.Settings.InterfaceLanguage
					),
					StartPosition = FormStartPosition.CenterParent
				};

				form.ProgressBar.Style = ProgressBarStyle.Marquee;

				form.Argument = serializationInfo;
				form.DoWork  += DoSerializationWork;

				StartSerializationForm(form);
			}
		}