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


C# IEditableRoot.LoadValueByPropertyName方法代码示例

本文整理汇总了C#中IEditableRoot.LoadValueByPropertyName方法的典型用法代码示例。如果您正苦于以下问题:C# IEditableRoot.LoadValueByPropertyName方法的具体用法?C# IEditableRoot.LoadValueByPropertyName怎么用?C# IEditableRoot.LoadValueByPropertyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEditableRoot的用法示例。


在下文中一共展示了IEditableRoot.LoadValueByPropertyName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetChartDescriptor

        private static ChartPanel GetChartDescriptor(IEditableRoot instance, string exprFieldName, string spcFieldName, ChartTypesEnum chartType, int subgroupSize, int dataPoints = 0)
        {
            ChartPanel chartDescriptor = null;

            MobileDictionary<string, ChartPanel> dict = null;
            if (!exprFieldName.Contains("_Rule"))
            {
                dict = instance.GetValueByPropertyName("ChartDescriptorExp") as MobileDictionary<string, ChartPanel>;
                if (dict != null)
                    dict.TryGetValue(string.Format("{0}{1}", exprFieldName, spcFieldName), out chartDescriptor);
                else
                    dict = new MobileDictionary<string, ChartPanel>();
            }

            if (chartDescriptor == null)
            {
                chartDescriptor = SpcManager.CreateChartDescriptor(chartType);
                chartDescriptor.DataPoints = dataPoints;
                chartDescriptor.SubgroupSize = subgroupSize;

                chartDescriptor = MethodCaller.CallFactoryMethod(instance.GetType(), "GetSampleDataForSPC", spcFieldName, instance, chartType, chartDescriptor, true) as ChartPanel;

                if (!exprFieldName.Contains("_Rule"))
                {
                    ChartPanel chartPanel;
                    if (dict.TryGetValue(string.Format("{0}{1}", exprFieldName, spcFieldName), out chartPanel))
                        dict[string.Format("{0}{1}", exprFieldName, spcFieldName)] = chartDescriptor;
                    else
                        dict.Add(string.Format("{0}{1}", exprFieldName, spcFieldName), chartDescriptor);

                    instance.LoadValueByPropertyName("ChartDescriptorExp", dict);
                }
            }
            else
            {
                chartDescriptor.DataPoints = dataPoints;
                chartDescriptor.SubgroupSize = subgroupSize;

                chartDescriptor = MethodCaller.CallFactoryMethod(instance.GetType(), "GetSampleDataForSPC", spcFieldName, instance, chartType, chartDescriptor, true) as ChartPanel;
            }

            return chartDescriptor;
        }        
开发者ID:mparsin,项目名称:Elements,代码行数:43,代码来源:SpcExpressionHelperModule.cs

示例2: GetChartDescriptorAsync

        private static Task<ChartPanel> GetChartDescriptorAsync(IEditableRoot instance, string exprFieldName, string spcFieldName, ChartTypesEnum chartType, int subgroupSize, int dataPoints = 0)
        {
            ChartPanel chartDescriptor = null;

            var dict = instance.GetValueByPropertyName("ChartDescriptorExp") as MobileDictionary<string, ChartPanel>;
            if (dict != null)
                dict.TryGetValue(string.Format("{0}{1}", exprFieldName, spcFieldName), out chartDescriptor);
            else
                dict = new MobileDictionary<string, ChartPanel>();

            if (chartDescriptor == null)
            {
                return SpcManager.CreateChartDescriptorAsync(chartType)
                    .ContinueWith(async task =>
                    {
                        if (task.Result != null)
                        {
                            chartDescriptor = task.Result;
                            chartDescriptor.DataPoints = dataPoints;
                            chartDescriptor.SubgroupSize = subgroupSize;

                            var getDataTask = MethodCaller.CallFactoryMethod(
                                instance.GetType(), "GetSampleDataForSPCAsync", instance, spcFieldName, chartType, chartDescriptor, true) as Task<ChartPanel>;
                            chartDescriptor = await getDataTask;

                            ChartPanel chartPanel;
                            if (dict.TryGetValue(string.Format("{0}{1}", exprFieldName, spcFieldName), out chartPanel))
                                dict[string.Format("{0}{1}", exprFieldName, spcFieldName)] = chartDescriptor;
                            else
                                dict.Add(string.Format("{0}{1}", exprFieldName, spcFieldName), chartDescriptor);

                            instance.LoadValueByPropertyName("ChartDescriptorExp", dict);

                            return chartDescriptor;
                        }

                        return task.Result;
                    }
                    , CancellationToken.None, TaskContinuationOptions.NotOnFaulted, TaskScheduler.FromCurrentSynchronizationContext()).Unwrap();
            }

            chartDescriptor.DataPoints = dataPoints;
            chartDescriptor.SubgroupSize = subgroupSize;

            var getSamplesTask = MethodCaller.CallFactoryMethod(
                instance.GetType(), "GetSampleDataForSPCAsync", instance, spcFieldName, chartType, chartDescriptor, true) as Task<ChartPanel>;
            return getSamplesTask;
        }
开发者ID:mparsin,项目名称:Elements,代码行数:48,代码来源:SpcExpressionHelperModule.cs


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