using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using FormulaEditor.Interfaces;
using FormulaEditor;
namespace DataPerformer
{
/// <summary>
/// Detector of variable helper
/// </summary>
static class VariableDetector
{
/// <summary>
/// Gets creator
/// </summary>
/// <param name="table">Table</param>
/// <returns>Creator</returns>
static internal IFormulaObjectCreator GetCreator(Hashtable table)
{
return ExtendedFormulaCreator.GetCreator(table);
}
/// <summary>
/// Gets creator
/// </summary>
/// <param name="detector">Detector</param>
/// <returns>Creator</returns>
static internal IFormulaObjectCreator GetCreator(IVariableDetector detector)
{
return ExtendedFormulaCreator.GetCreator(detector, new IOperationDetector[] { new DerivationDetector("d/dt", "d/dt") });
}
static internal IOperationAcceptor Detect(MathSymbol sym, IDictionary<string, IOperationAcceptor> dic)
{
string s = sym.Symbol + "";
if (dic != null)
{
if (dic.ContainsKey(s))
{
return dic[s];
}
}
if (sym.SymbolType != (int)FormulaConstants.Variable)
{
return null;
}
return null;
}
}
}