本文整理汇总了C#中BasicLib.Param.Parameters.GetParam方法的典型用法代码示例。如果您正苦于以下问题:C# Parameters.GetParam方法的具体用法?C# Parameters.GetParam怎么用?C# Parameters.GetParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicLib.Param.Parameters
的用法示例。
在下文中一共展示了Parameters.GetParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadData
public void LoadData(IMatrixData matrixData, Parameters parameters, ProcessInfo processInfo)
{
PerseusLoadFileParam par = (PerseusLoadFileParam) parameters.GetParam("File");
string filename = par.Filename;
if (string.IsNullOrEmpty(filename)){
processInfo.ErrString = "Please specify a filename";
return;
}
if (!File.Exists(filename)){
processInfo.ErrString = "File '" + filename + "' does not exist.";
return;
}
string[] colNames;
Dictionary<string, string[]> annotationRows = new Dictionary<string, string[]>();
try{
colNames = TabSep.GetColumnNames(filename, commentPrefix, commentPrefixExceptions, annotationRows);
} catch (Exception){
processInfo.ErrString = "Could not open the file '" + filename + "'. It is probably opened by another program.";
return;
}
string[] colDescriptions = null;
string[] colTypes = null;
bool[] colVisible = null;
if (annotationRows.ContainsKey("Description")){
colDescriptions = annotationRows["Description"];
annotationRows.Remove("Description");
}
if (annotationRows.ContainsKey("Type")){
colTypes = annotationRows["Type"];
annotationRows.Remove("Type");
}
if (annotationRows.ContainsKey("Visible")){
string[] colVis = annotationRows["Visible"];
colVisible = new bool[colVis.Length];
for (int i = 0; i < colVisible.Length; i++){
colVisible[i] = bool.Parse(colVis[i]);
}
annotationRows.Remove("Visible");
}
int[] eInds = par.ExpressionColumnIndices;
int[] cInds = par.CategoryColumnIndices;
int[] nInds = par.NumericalColumnIndices;
int[] tInds = par.TextColumnIndices;
int[] mInds = par.MultiNumericalColumnIndices;
int[] allInds = ArrayUtils.Concat(new[]{eInds, cInds, nInds, tInds, mInds});
Array.Sort(allInds);
for (int i = 0; i < allInds.Length - 1; i++){
if (allInds[i + 1] == allInds[i]){
processInfo.ErrString = "Column '" + colNames[allInds[i]] + "' has been selected multiple times";
return;
}
}
string[] allColNames = ArrayUtils.SubArray(colNames, allInds);
Array.Sort(allColNames);
for (int i = 0; i < allColNames.Length - 1; i++){
if (allColNames[i + 1].Equals(allColNames[i])){
processInfo.ErrString = "Column name '" + allColNames[i] + "' occurs multiple times.";
return;
}
}
LoadData(colNames, colDescriptions, eInds, cInds, nInds, tInds, mInds, filename, matrixData, annotationRows,
processInfo.Progress, processInfo.Status);
}