public void LookupFormAccept(IFormInterface form) { string[] lookupColumns = LookupColumnNames.Split(DAE.Client.DataView.ColumnNameDelimiters); string[] sourceColumns = ColumnNames.Split(DAE.Client.DataView.ColumnNameDelimiters); //Assign the field values for (int i = 0; i < sourceColumns.Length; i++) { Source.DataSource.DataSet.Fields[sourceColumns[i]].Value = form.MainSource.DataView.Fields[lookupColumns[i]].Value; } if (_autoPost) { Source.DataView.Post(); } if (_onLookupAccepted != null) { _onLookupAccepted.Execute(this, new EventParams("AForm", form)); } if (_onLookupClose != null) { _onLookupClose.Execute(this, new EventParams("AForm", form)); } }
public static void TestDataSet3D(string tableName, LookupColumn3dTest lookupColumn3dTest, LookupColumnTest lookupColumnTest, LookupColumnNames variableNames, string filename, TestDataSetType type) { var uri = (string)null; switch (type) { case TestDataSetType.NetCDF: uri = "msds:nc?file=" + filename + "&openMode=readOnly"; break; case TestDataSetType.TSV: uri = "msds:csv?file=" + filename + "&openMode=readOnly&separator=tab"; break; default: throw new Exception("Unexpected test type"); } var dataSet = Microsoft.Research.Science.Data.DataSet.Open(uri); var vs = dataSet.Variables.Reverse(); var actualVariableNames = vs.Select(v => v.Name).ToArray(); Common.TestVariableNames(tableName, actualVariableNames, variableNames()); vs.ToList().ForEach((v) => TestDataSet3DVariable(tableName, lookupColumn3dTest, lookupColumnTest, v)); }
public static void TestDataSetArray(string name, LookupColumnTest[] lookupColumnTests, LookupColumnNames variableNames, string[] filenames, TestDataSetType type) { Enumerable.Range(0, filenames.Length).ToList().ForEach( ii => { if (ii < lookupColumnTests.Length && lookupColumnTests[ii] != null) { TestDataSet(name, lookupColumnTests[ii], variableNames, filenames[ii], type); } }); }
public static void TestDataSet(string name, LookupColumnTest lookupColumnTest, LookupColumnNames variableNames, string filename, TestDataSetType type) { var uri = (string)null; switch (type) { case TestDataSetType.NetCDF: uri = "msds:nc?file=" + filename + "&openMode=readOnly"; break; case TestDataSetType.TSV: uri = "msds:csv?file=" + filename + "&openMode=readOnly&separator=tab"; break; default: throw new Exception("Unexpected test type"); } var dataSet = Microsoft.Research.Science.Data.DataSet.Open(uri); var vs = dataSet.Variables.Reverse(); var actualVariableNames = vs.Select(v => v.Name).ToArray(); Common.TestVariableNames(name, actualVariableNames, variableNames.Invoke()); vs.ToList().ForEach(v => TestDataSetVariable(name, lookupColumnTest, v)); }