zoukankan      html  css  js  c++  java
  • C#中实例一个自定义类的数组的做法

    /类
    public class BarChartValue
    {
        public BarChartValue()
        {

        }
        public BarChartValue(string MyName, int Myvalue)
        {
            Name = MyName;
            MValue = Myvalue;
        }
        private string name;
        public string Name
        {
            get
            {
                return name;
            }
            set
            {
                name = value;
            }
        }

        private int mvalue;
        public int MValue
        {
            get
            {
                return mvalue;
            }
            set
            {
                mvalue = value;
            }
        }
    }

    1.
            BarChartValue[] BarChartValue ={
            new BarChartValue("第一个仓库",1),
            new BarChartValue("第一个仓库",2)
            };
    2.

            BarChartValue[] BarChartValue= new BarChartValue[2];
            BarChartValue[0] = new mytest();
            BarChartValue[0].Name = "";
            BarChartValue[1] = new mytest();
            BarChartValue[1].Name = "";
    3.
            for (int i = 0; i < 5; i++)
            {
                BarChartValue[i] = new BarChartValue();
                BarChartValue[i].Name = "";
            }

    用法:
    用方法 :
    Render("BarChartValue);
    方法:
    public string Render(PieChartValue[] Mydata)

  • 相关阅读:
    python 协程
    python中基于descriptor的一些概念
    python remove del pop 的区别
    python 装饰器 和面向切面编程(AOP)
    python yield详解
    Python的列表推导式,字典推导式,集合推导式使用方法
    python 垃圾回收机制
    (5) etcd 介绍、经典适用场景、安装、配置、测试
    grafana 安装配置
    open-falcon 安装配置
  • 原文地址:https://www.cnblogs.com/cuihongyu3503319/p/759687.html
Copyright © 2011-2022 走看看