private void AddEditLayer(IEditLayer eLayer) { if (eLayer != null) { _editLayers.Add(eLayer); } }
internal LayerForm(IEditLayer edit) { InitializeComponent(); m_Edit = edit; if (m_Edit == null) { IEnvironmentFactory f = EnvironmentContainer.Factory; m_Edit = f.CreateLayer(); } m_Edit.BeginEdit(); }
bool ValidateEdit() { string name = nameTextBox.Text.Trim(); if (name.Length == 0) { MessageBox.Show("A name must be supplied for the theme"); nameTextBox.Focus(); return(false); } // If any layers have been removed from the list, ensure they no // longer refer to the edited theme foreach (ILayer layer in m_Layers) { ILayer listedLayer = GetListLayer(layer); if (listedLayer == null) { (layer as IEditLayer).Theme = null; } } // Ensure all displayed layers refer to this theme, and have the same // sequence as the display ILayer[] layers = GetListedLayers(); int themeSequence = 0; foreach (ILayer layer in layers) { IEditLayer ed = (IEditLayer)layer; ed.Theme = m_Edit; themeSequence++; ed.ThemeSequence = themeSequence; } m_Edit.Name = name; return(true); }