public Step4a_ReadTableInfoFromDbPage(int index)
 {
     InitializeComponent();
     statusLbl.Visible = false;
     selectedScope = WizardHelper.Instance.SyncConfigSection.SyncScopes.GetElementAt(index);
     this.Init();
 }
示例#2
0
        /// <summary>
        /// Allows programmatic addition to the Collection
        /// </summary>
        /// <param name="element">Element to add to collection</param>
        public void Add(SyncScopeConfigElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            base.BaseAdd(element, true);
        }
示例#3
0
        /// <summary>
        ///     Allows programmatic addition to the Collection
        /// </summary>
        /// <param name="element">Element to add to collection</param>
        public void Add(SyncScopeConfigElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            BaseAdd(element, true);
        }
示例#4
0
        /// <summary>
        /// Returns a clone of the existing Config section
        /// </summary>
        /// <returns>Cloned object</returns>
        public object Clone()
        {
            SyncScopeConfigElement config = new SyncScopeConfigElement()
            {
                Name                      = this.Name,
                IsTemplateScope           = this.IsTemplateScope,
                EnableBulkApplyProcedures = this.EnableBulkApplyProcedures
            };

            if (!string.IsNullOrEmpty(this.SchemaName))
            {
                config.SchemaName = this.SchemaName;
            }

            foreach (SyncTableConfigElement table in SyncTables)
            {
                config.SyncTables.Add((SyncTableConfigElement)table.Clone());
            }
            return(config);
        }
        private void saveBtn_Click(object sender, EventArgs e)
        {
            // Now add this to the SyncScopes list
            if (string.IsNullOrEmpty(this.scopeNameTxtBox.Text))
            {
                MessageBox.Show("Please enter a valid name for sync scope Name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.scopeNameTxtBox.Focus();
            }
            if (addMode)
            {
                SyncScopeConfigElement scope = new SyncScopeConfigElement()
                {
                    Name = this.scopeNameTxtBox.Text,
                    IsTemplateScope = this.isTempScopeOption.Checked,
                    EnableBulkApplyProcedures = this.enableBulkProcsOption.Checked,
                };
                if (!string.IsNullOrEmpty(this.schemaNameTxtBox.Text))
                {
                    scope.SchemaName = this.schemaNameTxtBox.Text;
                }

                WizardHelper.Instance.SyncConfigSection.SyncScopes.Add(scope);
                ReadAndBindData();
            }
            else
            {
                SyncScopeConfigElement scope = WizardHelper.Instance.SyncConfigSection.SyncScopes.GetElementAt(this.syncScopeBox.SelectedIndex);
                scope.Name = this.scopeNameTxtBox.Text;
                if (!string.IsNullOrEmpty(this.schemaNameTxtBox.Text))
                {
                    scope.SchemaName = this.schemaNameTxtBox.Text;
                }
                scope.IsTemplateScope = this.isTempScopeOption.Checked;
                scope.EnableBulkApplyProcedures = this.enableBulkProcsOption.Checked;
            }
            this.scopeSettingsGrp.Enabled = false;
        }
        /// <summary>
        /// Returns a clone of the existing Config section
        /// </summary>
        /// <returns>Cloned object</returns>
        public object Clone()
        {
            SyncScopeConfigElement config = new SyncScopeConfigElement()
            {
                Name = this.Name,
                IsTemplateScope = this.IsTemplateScope,
                EnableBulkApplyProcedures = this.EnableBulkApplyProcedures
            };

            if (!string.IsNullOrEmpty(this.SchemaName))
            {
                config.SchemaName = this.SchemaName;
            }

            foreach (SyncTableConfigElement table in SyncTables)
            {
                config.SyncTables.Add((SyncTableConfigElement)table.Clone());
            }
            return config;
        }