本文整理汇总了C#中ItemList.AsReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C# ItemList.AsReadOnly方法的具体用法?C# ItemList.AsReadOnly怎么用?C# ItemList.AsReadOnly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemList
的用法示例。
在下文中一共展示了ItemList.AsReadOnly方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnContentChanged
protected override void OnContentChanged() {
base.OnContentChanged();
if (Content != null) {
var data = Content.Data;
var filterLogic = new FilterLogic(data);
var searchLogic = new SearchLogic(data, filterLogic);
var statisticsLogic = new StatisticsLogic(data, searchLogic);
var manipulationLogic = new ManipulationLogic(data, searchLogic, statisticsLogic);
var viewShortcuts = new ItemList<IViewShortcut> {
new DataGridContent(data, manipulationLogic, filterLogic),
new StatisticsContent(statisticsLogic),
new LineChartContent(data),
new HistogramContent(data),
new ScatterPlotContent(data),
new CorrelationMatrixContent(Content),
new DataCompletenessChartContent(searchLogic),
new FilterContent(filterLogic),
new ManipulationContent(manipulationLogic, searchLogic, filterLogic),
new TransformationContent(data, filterLogic)
};
viewShortcutListView.Content = viewShortcuts.AsReadOnly();
viewShortcutListView.ItemsListView.Items[0].Selected = true;
viewShortcutListView.Select();
} else {
viewShortcutListView.Content = null;
}
}
示例2: DataAnalysisProblemData
protected DataAnalysisProblemData(IDataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<ITransformation> transformations = null) {
if (dataset == null) throw new ArgumentNullException("The dataset must not be null.");
if (allowedInputVariables == null) throw new ArgumentNullException("The allowedInputVariables must not be null.");
if (allowedInputVariables.Except(dataset.DoubleVariables).Any())
throw new ArgumentException("All allowed input variables must be present in the dataset and of type double.");
var inputVariables = new CheckedItemList<StringValue>(dataset.DoubleVariables.Select(x => new StringValue(x)));
foreach (StringValue x in inputVariables)
inputVariables.SetItemCheckedState(x, allowedInputVariables.Contains(x.Value));
int trainingPartitionStart = 0;
int trainingPartitionEnd = dataset.Rows / 2;
int testPartitionStart = dataset.Rows / 2;
int testPartitionEnd = dataset.Rows;
var transformationsList = new ItemList<ITransformation>(transformations ?? Enumerable.Empty<ITransformation>());
Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", (Dataset)dataset));
Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, "", inputVariables.AsReadOnly()));
Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", new IntRange(trainingPartitionStart, trainingPartitionEnd)));
Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", new IntRange(testPartitionStart, testPartitionEnd)));
Parameters.Add(new FixedValueParameter<ReadOnlyItemList<ITransformation>>(TransformationsParameterName, "", transformationsList.AsReadOnly()));
TransformationsParameter.Hidden = true;
((ValueParameter<Dataset>)DatasetParameter).ReactOnValueToStringChangedAndValueItemImageChanged = false;
RegisterEventHandlers();
}