本文整理汇总了C#中CellProcessor类的典型用法代码示例。如果您正苦于以下问题:C# CellProcessor类的具体用法?C# CellProcessor怎么用?C# CellProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CellProcessor类属于命名空间,在下文中一共展示了CellProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ActualValues
public TypedValue[] ActualValues(CellProcessor processor, object theActualRow)
{
var actuals = (object[]) theActualRow;
var result = new TypedValue[actuals.Length];
for (int i = 0; i < actuals.Length; i++) result[i] = new TypedValue(actuals[i]);
return result;
}
示例2: Evaluate
public static void Evaluate(this Tree<Cell> row, CellProcessor processor)
{
var interpreter = processor.CallStack.DomainAdapter.GetValueAs<FlowInterpreter>();
if (!row.InvokeSpecialAction(processor, interpreter).IsValid) {
row.ExecuteMethod(processor, interpreter);
}
}
示例3: ActualValues
public TypedValue[] ActualValues(CellProcessor processor, object theActualRow)
{
if (myColumnsUsed == null) myColumnsUsed = new bool[myHeaderRow.Parts.Size];
var result = new TypedValue[myHeaderRow.Parts.Size];
int column = 0;
foreach (Parse headerCell in new CellRange(myHeaderRow.Parts).Cells) {
TypedValue memberResult = new CellOperationImpl(processor).TryInvoke(theActualRow, headerCell);
if (memberResult.IsValid) {
result[column] = memberResult;
myColumnsUsed[column] = true;
}
else {
TypedValue itemResult = new CellOperationImpl(processor).TryInvoke(theActualRow,
new StringCellLeaf("getitem"),
new CellRange(headerCell, 1));
if (itemResult.IsValid) {
result[column] = itemResult;
myColumnsUsed[column] = true;
}
else {
result[column] = TypedValue.Void;
}
}
column++;
}
return result;
}
示例4: DoTable
public static void DoTable(Tree<Cell> table, Interpreter activeFixture, CellProcessor processor, bool inFlow)
{
var activeFlowFixture = activeFixture as FlowInterpreter;
if (activeFlowFixture != null) activeFlowFixture.DoSetUp(processor, table);
activeFixture.Interpret(processor, table);
if (activeFlowFixture != null && !inFlow) activeFlowFixture.DoTearDown(table);
}
示例5: GetNamedFixture
static Interpreter GetNamedFixture(CellProcessor processor, string theName) {
if (!processor.Get<Symbols>().HasValue(theName)) return null;
var result = processor.Operate<WrapOperator>(new TypedValue(processor.Get<Symbols>().GetValue(theName)));
result.AsNot<Interpreter>(() => { throw new FitFailureException("Result is not a Fixture."); });
return result.GetValueAs<Interpreter>();
}
示例6: Interpret
public void Interpret(CellProcessor processor, Tree<Cell> table)
{
new Traverse<Cell>()
.Rows.First(row => selectValue = new ValuePhrase(row).Evaluate(processor))
.Rows.All(row => SelectRow(processor, row))
.VisitTable(table);
}
示例7: SocketServer
public SocketServer(FitSocket socket, CellProcessor service, ProgressReporter reporter, bool suiteSetUpIsAnonymous)
{
this.service = service;
this.reporter = reporter;
this.socket = socket;
IMaybeProcessingSuiteSetup = suiteSetUpIsAnonymous;
}
示例8: Interpret
public void Interpret(CellProcessor processor, Tree<Cell> table)
{
new Traverse<Cell>()
.Rows.Header(row => headerRow = row)
.Rows.Rest(row => ComputeRow(processor, row))
.VisitTable(table);
}
示例9: Evaluate
public object Evaluate(DomainAdapter theFixture, CellProcessor processor) {
cells.ValueAt(0).SetAttribute(CellAttribute.Syntax, CellAttributeValue.SyntaxKeyword);
var cellCount = cells.Branches.Count;
if (cellCount < 2) throw MakeException("missing cells");
var identifier = cells.ValueAt(1).Text;
if (newIdentifier.Equals(identifier)) {
cells.ValueAt(1).SetAttribute(CellAttribute.Syntax, CellAttributeValue.SyntaxKeyword);
return new MethodPhrase(cells.Skip(1)).EvaluateNew(processor);
}
if (typeIdentifier.Equals(identifier)) {
cells.ValueAt(1).SetAttribute(CellAttribute.Syntax, CellAttributeValue.SyntaxKeyword);
if (cellCount < 3) throw MakeException("missing cells");
cells.ValueAt(2).SetAttribute(CellAttribute.Syntax, CellAttributeValue.SyntaxSUT);
return processor.ParseTree(typeof (Type), cells.Branches[2]).Value;
}
if (currentIdentifier.Equals(identifier)) {
cells.ValueAt(1).SetAttribute(CellAttribute.Syntax, CellAttributeValue.SyntaxKeyword);
return theFixture.SystemUnderTest;
}
var fixture = theFixture as FlowInterpreter;
if (fixture == null) throw MakeException("flow fixture required");
return processor.Get<Symbols>().HasValue(identifier)
? processor.Get<Symbols>().GetValue(identifier)
: fixture.ExecuteFlowRowMethod(processor, cells);
}
示例10: EvaluateNew
public object EvaluateNew(CellProcessor processor)
{
if (cells.Branches.Count < 2) throw MakeException("missing cells");
return processor.Create(
cells.ValueAt(1).Text,
cells.Skip(2))
.Value;
}
示例11: InvokeOperation
public InvokeOperation(CellProcessor processor, TypedValue target, Tree<Cell> member, Tree<Cell> parameters, Tree<Cell> cells)
{
this.processor = processor;
Target = target;
Member = member;
Parameters = parameters;
Cells = cells;
}
示例12: ExecuteMethod
public static TypedValue ExecuteMethod(this Tree<Cell> row, CellProcessor processor, MethodRowSelector selector,
object target)
{
return processor.Execute(target,
selector.SelectMethodCells(row),
selector.SelectParameterCells(row),
row.ValueAt(0));
}
示例13: Execute
static void Execute(CellProcessor processor, object facility, Tree<Cell> currentRow) {
var selector = new DoRowSelector();
var result = processor.ExecuteWithThrow(facility, selector.SelectMethodCells(currentRow),
selector.SelectParameterCells(currentRow),
currentRow.ValueAt(0));
if (result.IsVoid) return;
currentRow.ValueAt(0).SetAttribute(CellAttribute.Folded, result.ValueString);
}
示例14: RunTest
private void RunTest(CellProcessor service, string tables) {
var socket = new TestSocket();
socket.PutByteString(Protocol.FormatInteger(tables.Length));
socket.PutByteString(tables);
socket.PutByteString(Protocol.FormatInteger(0));
var server = new SocketServer(new FitSocket(socket, new NullReporter()), service, new NullReporter(), false);
server.ProcessTestDocuments(new StoryTestStringWriter(service).ForTables(s => resultTables += s));
Assert.IsFalse(socket.isOpen);
}
示例15: DoInvoke
public TypedValue DoInvoke(CellProcessor processor)
{
var targetInstance = new TypedValue(target);
var targetObjectProvider = target as TargetObjectProvider;
var name = GetMemberName(processor);
return processor.Invoke(
targetObjectProvider != null ? new TypedValue(targetObjectProvider.GetTargetObject()) : targetInstance,
name, parameters);
}