public SpeciesObservation() { try { _layerBuilder = new SpeciesLayerFactory { LayerFileName = "Plant Observation by Species.lyr", LayerNameFormat = "Observation types for {0}", LayerFixer = LayerUtilities.RandomizeMarkerColor, }; string msg = _layerBuilder.Validate(); if (string.IsNullOrEmpty(msg)) { foreach (string rank in _layerBuilder.PicklistNames) Add(rank); } else { MessageBox.Show("The data required for this tool is missing or invalid.\n" + msg, "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(GetType() + " encountered a problem.\n\n" + ex, "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public SpeciesRank() { try { _layerBuilder = new SpeciesLayerFactory { LayerFileName = "Plant Species by State Rank.lyr", PickListTableName = "akhpRankPicklist", FieldName = "Taxon_vasc_aknhp_s_rank", LayerNameFormat = "State Rank of {0}", LayerFixer = LayerUtilities.RemoveUnusedItemsFromUniqueValueRenderer, }; string msg = _layerBuilder.Validate(); if (string.IsNullOrEmpty(msg)) { foreach (string rank in _layerBuilder.PicklistNames) Add(rank); } else { MessageBox.Show("The data required for this tool is missing or invalid.\n" + msg, "Configuration Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(GetType() + " encountered a problem.\n\n" + ex, "Unhandled Exception", MessageBoxButtons.OK, MessageBoxIcon.Error); } }