本文整理匯總了C#中Chart.getName方法的典型用法代碼示例。如果您正苦於以下問題:C# Chart.getName方法的具體用法?C# Chart.getName怎麽用?C# Chart.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Chart
的用法示例。
在下文中一共展示了Chart.getName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MakeNode
/// <summary>
/// Help method to add a chart module to the tree
/// </summary>
private TreeNode MakeNode(Chart.IChartExplorer module, String parentNodeName)
{
ThresholdData data = null;
bool found = false;
for (int i = 0; i < thresholdData.AllSets.Length; i++)
{
ThresholdData check = thresholdData.AllSets[i];
if (check.Name.Equals(parentNodeName))
{
data = check;
found = true;
break;
}
}
if (!found)
{
throw new Exception("Could not find threshold data: " + parentNodeName);
}
double summaryValue = -1;
String key = "0";
String name = module.getName();
if (summaryData.ContainsKey(name))
{
summaryValue = summaryData[name];
}
else if (name.EndsWith(")")) // hack to filter out parentheses, ugh
{
name = name.Substring(0, name.Length - 4);
if (summaryData.ContainsKey(name))
{
summaryValue = summaryData[name];
}
else
{
name = name.Substring(0, name.Length - 1);
if (summaryData.ContainsKey(name))
{
summaryValue = summaryData[name];
}
}
}
if (summaryValue != -1) // compare summary values to thresholds
{
String lowerKey = parentNodeName + "lc";
String upperKey = parentNodeName + "uc";
if (data.LowerCheck) // lower
{
if (summaryValue <= data.LowerValue)
{
key = lowerKey;
}
}
else
{
if (summaryValue < data.LowerValue)
{
key = lowerKey;
}
}
if (data.UpperCheck) // upper
{
if (summaryValue >= data.UpperValue)
{
key = upperKey;
}
}
else
{
if (summaryValue > data.UpperValue)
{
key = upperKey;
}
}
if (key == "0") // not upper or lower, must be middle?
{
key = parentNodeName + "mc";
}
TreeNode node = new TreeNode(module.getName());
node.ImageKey = "" + key;
node.SelectedImageKey = "" + key;
node.Tag = module; // The demo module is attached to the node as the Tag property.
// round to two decimals
summaryValue = Math.Round(summaryValue, 2);
node.ToolTipText = summaryValue.ToString();
return node;
}
else
{
Console.WriteLine("(Summary)Had to use default node: " + module.getName() + ", " + summaryData);
TreeNode node = new TreeNode(module.getName());
//.........這裏部分代碼省略.........