本文整理汇总了C#中Altaxo.Data.DataTable.SetTableProperty方法的典型用法代码示例。如果您正苦于以下问题:C# DataTable.SetTableProperty方法的具体用法?C# DataTable.SetTableProperty怎么用?C# DataTable.SetTableProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Altaxo.Data.DataTable
的用法示例。
在下文中一共展示了DataTable.SetTableProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public override void Run(Altaxo.Gui.Worksheet.Viewing.WorksheetController ctrl)
{
m_Table = ctrl.DataTable;
ExtractTableDataScript script = ctrl.DataTable.GetTableProperty(ExtractTableDataScriptPropertyName) as ExtractTableDataScript;
if (script == null)
script = new ExtractTableDataScript();
object[] args = new object[] { script, new ScriptExecutionHandler(this.EhScriptExecution) };
if (Current.Gui.ShowDialog(args, "WorksheetScript of " + m_Table.Name))
{
m_Table.SetTableProperty(ExtractTableDataScriptPropertyName, args[0]);
}
this.m_Table = null;
}
示例2: ExecuteAnalysis
/// <summary>
/// Makes a PLS (a partial least squares) analysis of the table or the selected columns / rows and stores the results in a newly created table.
/// </summary>
/// <param name="mainDocument">The main document of the application.</param>
/// <param name="srctable">The table where the data come from.</param>
/// <param name="selectedColumns">The selected columns.</param>
/// <param name="selectedRows">The selected rows.</param>
/// <param name="selectedPropertyColumns">The selected property column(s).</param>
/// <param name="bHorizontalOrientedSpectrum">True if a spectrum is a single row, False if a spectrum is a single column.</param>
/// <param name="plsOptions">Provides information about the max number of factors and the calculation of cross PRESS value.</param>
/// <param name="preprocessOptions">Provides information about how to preprocess the spectra.</param>
/// <returns></returns>
public virtual string ExecuteAnalysis(
Altaxo.AltaxoDocument mainDocument,
Altaxo.Data.DataTable srctable,
IAscendingIntegerCollection selectedColumns,
IAscendingIntegerCollection selectedRows,
IAscendingIntegerCollection selectedPropertyColumns,
bool bHorizontalOrientedSpectrum,
MultivariateAnalysisOptions plsOptions,
SpectralPreprocessingOptions preprocessOptions
)
{
IMatrix matrixX, matrixY;
IROVector xOfX;
var plsContent = new MultivariateContentMemento();
plsContent.Analysis = this;
// now we have to create a new table where to place the calculated factors and loads
// we will do that in a vertical oriented manner, i.e. even if the loads are
// here in horizontal vectors: in our table they are stored in (vertical) columns
string newName = this.AnalysisName + " of " + Main.ProjectFolder.GetNamePart(srctable.Name);
newName = Main.ProjectFolder.CreateFullName(srctable.Name, newName);
Altaxo.Data.DataTable table = new Altaxo.Data.DataTable(newName);
// Fill the Table
using (var suspendToken = table.SuspendGetToken())
{
table.SetTableProperty("Content", plsContent);
plsContent.OriginalDataTableName = srctable.Name;
// Get matrices
GetXYMatrices(
srctable,
selectedColumns,
selectedRows,
selectedPropertyColumns,
bHorizontalOrientedSpectrum,
plsContent,
out matrixX, out matrixY, out xOfX);
StoreXOfX(xOfX, table);
// Preprocess
plsContent.SpectralPreprocessing = preprocessOptions;
IVector meanX, scaleX, meanY, scaleY;
MultivariateRegression.PreprocessForAnalysis(preprocessOptions, xOfX, matrixX, matrixY,
out meanX, out scaleX, out meanY, out scaleY);
StorePreprocessedData(meanX, scaleX, meanY, scaleY, table);
// Analyze and Store
IROVector press;
ExecuteAnalysis(
matrixX,
matrixY,
plsOptions,
plsContent,
table, out press);
this.StorePRESSData(press, table);
if (plsOptions.CrossPRESSCalculation != CrossPRESSCalculationType.None)
CalculateCrossPRESS(xOfX, matrixX, matrixY, plsOptions, plsContent, table);
StoreFRatioData(table, plsContent);
StoreOriginalY(table, plsContent);
suspendToken.Dispose();
}
Current.Project.DataTableCollection.Add(table);
// create a new worksheet without any columns
Current.ProjectService.CreateNewWorksheet(table);
return null;
}
示例3: Deserialize
public virtual void Deserialize(DataTable s, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
{
s._tableName = info.GetString("Name");
s._dataColumns = (DataColumnCollection)info.GetValue("DataCols",s);
s._dataColumns.ParentObject = s;
s._propertyColumns = (DataColumnCollection)info.GetValue("PropCols",s);
s._propertyColumns.ParentObject = s;
// new in version 1
s._tableScript = (TableScript)info.GetValue("TableScript",s);
// new in version 2 - Add table properties
int numberproperties = info.OpenArray(); // "TableProperties"
for(int i=0;i<numberproperties;i++)
{
info.OpenElement(); // "e"
string propkey = info.GetString("Key");
object propval = info.GetValue("Value",parent);
info.CloseElement(); // "e"
s.SetTableProperty(propkey,propval);
}
info.CloseArray(numberproperties);
}