private void FormGISView_Load(object sender, EventArgs e) { SecureForm(); FormLoad(Settings.Default.GIS_VIEW_IMAGE_KEY, Settings.Default.GIS_VIEW_IMAGE_KEY_SELECTED); MainMapImage.Map.BackColor = System.Drawing.Color.White; // Set the tab text to the name of the associated network this.TabText = "GIS-" + m_strNetwork; /* TEST CODE */ //SharpMap.Layers.VectorLayer layCountries = new SharpMap.Layers.VectorLayer("Countries"); //MainMapImage.Image = Image.FromFile(@"C:\Documents and Settings\cbecker\Desktop\9282_08.tif"); /* END TEST CODE */ // We need to load the simulations combo box with all simulations for a given networkID String query = "SELECT SIMULATION, SIMULATIONID FROM SIMULATIONS WHERE NETWORKID = '" + m_strNetworkID + "'"; try { toolStripComboBoxSimulations.Items.Add(""); DataSet dsSimulation = DBMgr.ExecuteQuery(query); foreach (DataRow dataRow in dsSimulation.Tables[0].Rows) { String strSimulationName = dataRow["SIMULATION"].ToString(); String strSimulationID = dataRow["SIMULATIONID"].ToString(); m_hashSimulationSimulationID.Add(strSimulationName, strSimulationID); toolStripComboBoxSimulations.Items.Add(strSimulationName); } } catch (Exception exception) { Global.WriteOutput("Error: Loading simulations." + exception.Message); } Global.Attributes.Clear(); Global.LoadAttributes(); if (this.ImageView) { geometries = new List <SharpMap.Geometries.Geometry>(); m_layerImageView = new SharpMap.Layers.VectorLayer("Image View"); m_layerImageView.Tag = "ImageView"; m_layerImageView.DataSource = new SharpMap.Data.Providers.GeometryProvider(geometries); m_layerImageView.Style.Symbol = (Bitmap)imageListDefaultSymbols.Images[1]; //m_layerImageView.Style.SymbolScale = 2; MainMapImage.Map.Layers.Add(m_layerImageView); m_formGISLayerManager = new FormGISLayerManager(m_strNetwork, m_htAttributeYears); m_formGISLayerManager.MapImage = this.MainMapImage; m_formGISLayerManager.GISView = this; } else { toolStripButtonManager.Visible = false; } }
public static bool IsFormGISLayerManagerOpen(out FormGISLayerManager formGISLayerManager) { if (m_formGISLayerManager != null) { formGISLayerManager = m_formGISLayerManager; m_formGISLayerManager.Focus(); return(true); } else { formGISLayerManager = null; return(false); } }
public static void AddFormGISLayerManager(FormGISLayerManager form) { m_formGISLayerManager = form; }
public static void RemoveFormGISLayerManager(FormGISLayerManager form) { m_formGISLayerManager.Dispose(); m_formGISLayerManager = null; }