Example #1
0
        private void yearFieldsListBox_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (yearFieldsListBox.SelectedIndex >= 0)
            {
                var selected = Fields[yearFieldsListBox.SelectedIndex];
                if (selected.Values is IParameter1Dimensional<Timestep, double>)
                {
                    var w = new YearFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter1Dimensional<Timestep, double>)selected.Values);

                    w.Show();
                }
                else if (selected.Values is IParameter1DimensionalTypeless<double>)
                {
                    var w = new RegionFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter1DimensionalTypeless<double>)selected.Values);

                    w.Show();

                }
                else if (selected.Values is IParameter2DimensionalTypeless<double>)
                {
                    var w = new YearRegionFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter2DimensionalTypeless<double>)selected.Values);

                    w.Show();
                }
            }
        }
        private void yearFieldsListBox_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (yearFieldsListBox.SelectedIndex >= 0)
            {
                var selected = Fields[yearFieldsListBox.SelectedIndex];
                if (selected.Values is IParameter1Dimensional <Timestep, double> )
                {
                    var w = new YearFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter1Dimensional <Timestep, double>)selected.Values);

                    w.Show();
                }
                else if (selected.Values is IParameter1DimensionalTypeless <double> )
                {
                    var w = new RegionFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter1DimensionalTypeless <double>)selected.Values);

                    w.Show();
                }
                else if (selected.Values is IParameter2DimensionalTypeless <double> )
                {
                    var w = new YearRegionFieldWindow(String.Format("{0}.{1}", selected.ComponentName, selected.FieldName), (IParameter2DimensionalTypeless <double>)selected.Values);

                    w.Show();
                }
            }
        }