Object
是从中派生每个其他类的基类。其中,它具有受保护的访问修饰符(即MemberwiseClone()
)的方法
protected
表示可以从声明它的类中以及从声明该成员的类派生的任何类中访问该成员。
这是否意味着Object
所有受保护的成员实际上都是公开的?如果是,为什么要实施?
答案 0 :(得分:-2)
不,这并不意味着他们会公开。这意味着从该类派生的任何类都可以使用受保护的方法。
private void bind10()
{
//Fetch the Statistical data from database.
string query = "SELECT status, DATEPART(Month, Date) as [Year], COUNT(weightedValue) as [Total]";
query += " FROM SalesActivity INNER JOIN STATUS ON SalesActivity.Status_ID = STATUS.Status_ID WHERE status IN ('Request for info', 'Quotation', 'Negotiating','Order Placed', 'Lost' )";
query += " GROUP BY status, DATEPART(Month, Date)";
DataTable dt = GetData(query);
//Get the DISTINCT Countries.
List<string> statuses = (from p in dt.AsEnumerable()
select p.Field<string>("status")).Distinct().ToList();
//Loop through the Countries.
foreach (string status in statuses)
{
//Get the Year for each Country.
int[] x = (from p in dt.AsEnumerable()
where p.Field<string>("status") == status
orderby p.Field<int>("Year") ascending
select p.Field<int>("Year")).ToArray();
//Get the Total of Orders for each Country.
int[] y = (from p in dt.AsEnumerable()
where p.Field<string>("status") == status
orderby p.Field<int>("Year") ascending
select p.Field<int>("Total")).ToArray();
//Add Series to the Chart.
Chart10.Series.Add(new Series(status));
Chart10.Series[status].IsValueShownAsLabel = true;
Chart10.Series[status].ChartType = SeriesChartType.StackedColumn;
Chart10.Series[status].Points.DataBindXY(x, y);
Chart10.Legends[0].Enabled = true;
}
}