예제 #1
0
        public void Commit()
        {
            if (_module == null || _module.MapDocument == null ||
                _module[_module.MapDocument.FocusMap] == null)
            {
                return;
            }

            numScale_ValueChanged(numScale, new EventArgs());
            List <ISnapSchema> schemas = _module[_module.MapDocument.FocusMap];

            schemas.Clear();

            foreach (SnapSchemaItem item in cmbSchemas.Items)
            {
                SnapSchema schema = new SnapSchema(item.SnapSchema.Name);
                foreach (SnapLayerRow row in item.SnapLayerRows)
                {
                    if (row.SnapLayer.Methode != SnapMethode.None)
                    {
                        schema.Add(row.SnapLayer);
                    }
                }
                schema.MaxScale = item.SnapSchema.MaxScale;
                schemas.Add(schema);
            }

            _module.RefreshGUI();
        }
예제 #2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (_module == null || _module.MapDocument == null ||
                _module[_module.MapDocument.FocusMap] == null)
            {
                return;
            }

            FormNewSchema dlg = new FormNewSchema("New Schema");

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                SnapSchema schema = new SnapSchema(dlg.SnapSchemaName);
                //_module[_module.MapDocument.FocusMap].Add(schema);
                cmbSchemas.Items.Add(new SnapSchemaItem(_module.MapDocument.FocusMap, schema));

                cmbSchemas.SelectedIndex = cmbSchemas.Items.Count - 1;
            }
        }