private void btnAddData_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Select File Name"; if (Param == null) { Param = new FileParam("open filename"); } FileParam p = Param as FileParam; if (p != null) { dialog.Filter = p.DialogFilter; } if (dialog.ShowDialog() == DialogResult.OK) { TextFile tmpTextFile = new TextFile(dialog.FileName); _addedTextFile = new DataSetArray(Path.GetFileNameWithoutExtension(dialog.FileName), tmpTextFile); Param.ModelName = _addedTextFile.Name; Param.Value = _addedTextFile.DataSet; Refresh(); base.Status = ToolStatus.Ok; } else { return; } }
/// <summary> /// Adds a new entry to the drop down list from data provider /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnAddDataClick(object sender, EventArgs e) { ///////////////////////////////// //Replace with something that uses the default data provider IFeatureSet tempFeatureSet = DataManager.DefaultDataManager.OpenVector(); //If the feature is null don't do anything the user probably hit cancel on the dialog if (tempFeatureSet == null) { return; } //Else if the wrong feature type is returned don't add it and indicate whats wrong if (tempFeatureSet.FeatureType != FeatureType.Line) { MessageBox.Show(ModelingMessageStrings.FeatureTypeException); } //If its good add the feature set and save it else { _addedFeatureSet = new DataSetArray(Path.GetFileNameWithoutExtension(tempFeatureSet.Filename), tempFeatureSet); Param.ModelName = _addedFeatureSet.Name; Param.Value = _addedFeatureSet.DataSet; } }
/// <summary> /// This fires when the selected value in the combo box is changed /// </summary> private void comboFeature_SelectedValueChanged(object sender, EventArgs e) { if (_refreshCombo) { DataSetArray dsa = comboFeatures.SelectedItem as DataSetArray; if (dsa != null) { Param.ModelName = dsa.Name; Param.Value = dsa.DataSet; return; } } }
/// <summary> /// Adds a new entry to the drop down list from data provider /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddData_Click(object sender, EventArgs e) { ///////////////////////////////// //Replace with something that uses the default data provider IFeatureSet tempFeatureSet = DataManager.DefaultDataManager.OpenVector(); //If the feature is null don't do anything the user probably hit cancel on the dialog if (tempFeatureSet == null) { return; } //If its good add the feature set and save it _addedFeatureSet = new DataSetArray(Path.GetFileNameWithoutExtension(tempFeatureSet.Filename), tempFeatureSet); Param.ModelName = _addedFeatureSet.Name; Param.Value = _addedFeatureSet.DataSet; }
/// <summary> /// This changes the color of the light and the tooltip of the light based on the status of the text in the box /// </summary> private void ComboRasterSelectedValueChanged(object sender, EventArgs e) { if (!_refreshCombo) { return; } DataSetArray dsa = comboRaster.SelectedItem as DataSetArray; if (dsa == null) { return; } Param.ModelName = dsa.Name; Param.Value = dsa.DataSet; return; }
private void btnAddData_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Select File Name"; if (Param == null) Param = new FileParam("open filename"); FileParam p = Param as FileParam; if (p != null) dialog.Filter = p.DialogFilter; if (dialog.ShowDialog() == DialogResult.OK) { TextFile tmpTextFile = new TextFile(dialog.FileName); _addedTextFile = new DataSetArray(Path.GetFileNameWithoutExtension(dialog.FileName), tmpTextFile); Param.ModelName = _addedTextFile.Name; Param.Value = _addedTextFile.DataSet; Refresh(); base.Status = ToolStatus.Ok; } else { return; } }
/// <summary> /// Adds a new entry to the drop down list from data provider /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAddData_Click(object sender, EventArgs e) { ///////////////////////////////// //Replace with something that uses the default data provider IFeatureSet tempFeatureSet = DataManager.DefaultDataManager.OpenVector(); //If the feature is null don't do anything the user probably hit cancel on the dialog if (tempFeatureSet == null) return; //If its good add the feature set and save it _addedFeatureSet = new DataSetArray(Path.GetFileNameWithoutExtension(tempFeatureSet.Filename), tempFeatureSet); Param.ModelName = _addedFeatureSet.Name; Param.Value = _addedFeatureSet.DataSet; }
/// <summary> /// Adds a new entry to the drop down list from data provider /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnAddDataClick(object sender, EventArgs e) { ///////////////////////////////// //Replace with something that uses the default data provider IFeatureSet tempFeatureSet = DataManager.DefaultDataManager.OpenVector(); //If the feature is null don't do anything the user probably hit cancel on the dialog if (tempFeatureSet == null) return; //Else if the wrong feature type is returned don't add it and indicate whats wrong if (tempFeatureSet.FeatureType != FeatureType.Line) MessageBox.Show(ModelingMessageStrings.FeatureTypeException); //If its good add the feature set and save it else { _addedFeatureSet = new DataSetArray(Path.GetFileNameWithoutExtension(tempFeatureSet.Filename), tempFeatureSet); Param.ModelName = _addedFeatureSet.Name; Param.Value = _addedFeatureSet.DataSet; } }