当前位置: 首页>>代码示例>>C#>>正文


C# Chart.getName方法代码示例

本文整理汇总了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());
//.........这里部分代码省略.........
开发者ID:wshanshan,项目名称:DDD,代码行数:101,代码来源:ChartExplorer.cs


注:本文中的Chart.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。