本文整理匯總了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));
}
}