本文整理汇总了C#中Altaxo.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Altaxo.Remove方法的具体用法?C# Altaxo.Remove怎么用?C# Altaxo.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo
的用法示例。
在下文中一共展示了Altaxo.Remove方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RemoveNonNumericCells
/// <summary>
/// For given selected columns and selected rows, the procedure removes all nonnumeric cells. Furthermore, if either selectedColumns or selectedRows
/// is empty, the collection is filled by the really used rows/columns.
/// </summary>
/// <param name="srctable">The source table.</param>
/// <param name="selectedRows">On entry, contains the selectedRows (or empty if now rows selected). On output, is the row collection.</param>
/// <param name="selectedColumns">On entry, conains the selected columns (or emtpy if only rows selected). On output, contains all numeric columns.</param>
public static void RemoveNonNumericCells(Altaxo.Data.DataTable srctable, Altaxo.Collections.AscendingIntegerCollection selectedRows, Altaxo.Collections.AscendingIntegerCollection selectedColumns)
{
// first the columns
if (0 != selectedColumns.Count)
{
for (int i = 0; i < selectedColumns.Count; i++)
{
int idx = selectedColumns[i];
if (!(srctable[idx] is Altaxo.Data.INumericColumn))
{
selectedColumns.Remove(idx);
}
}
}
else // if no columns where selected, select all that are numeric
{
int end = srctable.DataColumnCount;
for (int i = 0; i < end; i++)
{
if (srctable[i] is Altaxo.Data.INumericColumn)
selectedColumns.Add(i);
}
}
// if now rows selected, then test the max row count of the selected columns
// and add it
// check the number of rows
if (0 == selectedRows.Count)
{
int numrows = 0;
int end = selectedColumns.Count;
for (int i = 0; i < end; i++)
{
int idx = selectedColumns[i];
numrows = Math.Max(numrows, srctable[idx].Count);
}
selectedRows.Add(ContiguousIntegerRange.FromStartAndCount(0, numrows));
}
}