none
c# listeye farkli tipten deger ekleme RRS feed

  • Genel Tartışma

  • Günaydin,

     comboboxta secilen degere göre, secilen eksen cesidinin özelliklerini  listeye eklemek istiyorum.

    Kodun icindede yorumladigim yeri nasil yapabilirim.

    public class LineChart 
        {
            
            public Form1.ShowMarker ChartDataMarkerShowlabel { get; set; }
            public string Type { get; set; }
            public int ValueRange { get; set; }
            public List<XAx> xAxes { get; set; }
            public List<YAx> yAxes { get; set; }
            
    
            public static LineChart getLineChart()
            {
                Form1 form = Application.OpenForms[0] as Form1;
    
                XAx x1 = new XAx();
                LineChart linechart = new LineChart();
               
                linechart.ChartDataMarkerShowlabel = Helper.SelectedMarker(form.cmbDMarker_line.SelectedItem.ToString());
                linechart.Type = form.Typtxt_line.Text;
               
    	//????Burada comboboxta secilen degere göre, secilen eksen cesidinin özelliklerini  listeye eklemek istiyorum.
                List<XAx> x = new List<XAx>();
                if (form.cmbX_Achse.SelectedItem.ToString() == "Logaritmische Achse") {
                    x.Add(x1.CategoryAxis);
                }
                else if (form.cmbX_Achse.SelectedItem.ToString() == "Numerische Achse"){
                  x.Add(x1.NumericalAxis);
    	     }
    
                else if (form.cmbX_Achse.SelectedItem.ToString() == "Zeit Datum Achse") { 
    	     x.Add(x1.DatetimeAxis);}
                else  {... }
                linechart.xAxes=x;
                
                return linechart;
            }
            
    
        }
    
     public class LogaritmicAxis
        {
            public string Minimum { get; set; }
            public string Maximum { get; set; }
            public string IntervalType { get; set; }
            public string Interval { get; set; }
            
    
            public static LogaritmicAxis getLogarithmicAxis()
            {
                LogaritmicAxis logarithmicAxis = new LogaritmicAxis();
                Form1 form = Application.OpenForms[0] as Form1;
    
                logarithmicAxis.Minimum = form.txtXLogAxisMin.Text;
                logarithmicAxis.Maximum = form.txtXLogAxisMax.Text;
                logarithmicAxis.Interval = form.txtXLogAxisInt.Text;
                return logarithmicAxis;
            }
        }
    
        public class XAx
        {
            public CategoryAxis CategoryAxis { get; set; }
            public NumericalAxis NumericalAxis { get; set; }
            public DateTimeAxis DateTimeAxis { get; set; }
            public LogaritmicAxis LogaritmicAxis { get; set; }
    
            public static XAx getXAx()
            {
    
                XAx xax = new XAx();
                xax.CategoryAxis = CategoryAxis.getCategoryAxis();
                xax.NumericalAxis = NumericalAxis.getNumericalAxis();
                xax.LogaritmicAxis = LogaritmicAxis.getLogarithmicAxis();
                xax.DateTimeAxis = DateTimeAxis.getDateTimeAxis();
          
               return xax;
    
           
            }
        }
        

    11 Haziran 2018 Pazartesi 07:46