本文整理汇总了C#中IScope类的典型用法代码示例。如果您正苦于以下问题:C# IScope类的具体用法?C# IScope怎么用?C# IScope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScope类属于命名空间,在下文中一共展示了IScope类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Register
/// <summary>
/// Add built-in array functions to the scope
/// </summary>
internal static void Register(IScope scope)
{
scope.SetValue("l3.mapToMap", new MapToMap());
scope.SetValue("l3.mapToArray", new MapToArray());
scope.SetValue("l3.getMapKeys", new GetMapKeys());
scope.SetValue("l3.getMapValues", new GetMapValues());
}
示例2: SummonAction
public SummonAction(IScope scope, ICost cost, UnitData unit, IScreenEffect screenEffect)
{
_scope = scope;
_cost = cost;
_unit = unit;
_screenEffect = screenEffect;
}
示例3: GetProviderInput
public IMessageInput GetProviderInput(IScope scope, string name)
{
IMessageInput msgIn = GetLiveProviderInput(scope, name, false);
if (msgIn == null)
return GetVODProviderInput(scope, name);
return msgIn;
}
示例4: ProcedureSql
/// <summary>
/// Constructor
/// </summary>
/// <param name="statement">The statement.</param>
/// <param name="sqlStatement"></param>
/// <param name="scope"></param>
public ProcedureSql(IScope scope, string sqlStatement, IStatement statement)
{
_sqlStatement = sqlStatement;
_statement = statement;
_dataExchangeFactory = scope.DataExchangeFactory;
}
示例5: ParameterScope
public ParameterScope( IScope parent, string[] parameters )
{
_parent = parent;
_contents = new StandardScope();
foreach( string p in parameters )
_contents.set( p, null );
}
示例6: Switch
protected internal Switch(NRefactory.SwitchStatement switchStatement, IScope scope, INRefcatoryExpressionVisitor visitor)
: base(scope, visitor) {
_switchStatement = switchStatement;
SwitchValue = switchStatement.Expression.AcceptVisitor(Visitor, scope);
BuildSwitchCases();
InternalType = TypeSystem.Void;
}
示例7: Equals
public override bool Equals(IScope x, IScope y) {
if (object.ReferenceEquals(x, y)) return true;
if (x == null || y == null) return false;
double q1 = ((DoubleValue)x.Variables[QualityVariableName].Value).Value;
double q2 = ((DoubleValue)y.Variables[QualityVariableName].Value).Value;
return q1.IsAlmost(q2) && CalculateSolutionSimilarity(x, y).IsAlmost(1.0);
}
示例8: Do
/// <summary>Read and eval all the lines in a file</summary>
internal static void Do(string file, IScope scope)
{
StreamReader stream = null;
try
{
List<string> lines = new List<string>();
stream = new StreamReader(file);
while (!stream.EndOfStream)
lines.Add(stream.ReadLine());
LineConsumer consumer = new LineConsumer(lines);
EvalLines.Do(consumer, scope);
stream.Close();
}
catch (Loki3Exception e)
{
e.AddFileName(file);
if (stream != null)
stream.Close();
throw e;
}
catch (System.Exception e)
{
if (stream != null)
stream.Close();
throw e;
}
}
示例9: Do
/// <summary>
/// Eval a list of DelimiterNodes and return a Value
/// </summary>
internal static Value Do(List<DelimiterNode> nodes, IScope scope, ILineRequestor requestor)
{
ListEval eval = new ListEval(nodes, scope);
while (eval.EvalNext(requestor))
;
return eval.GetValue();
}
示例10: GenerateFilename
public string GenerateFilename(IScope scope, string name, string extension, GenerationType type) {
string result = GetStreamDirectory(scope) + name;
if (extension != null && !string.Empty.Equals(extension)) {
result += extension;
}
return result;
}
示例11: Invocation
protected internal Invocation(NRefactory.InvocationExpression invocationExpression, IScope scope, INRefcatoryExpressionVisitor visitor)
: base(scope, visitor) {
var methodReference = invocationExpression.Annotation<Mono.Cecil.MethodReference>();
_invocationExpression = invocationExpression;
if (methodReference != null) {
MethodInfo methodInfo = null;
Member = methodInfo = methodReference.GetActualMethod<MethodInfo>();
if (IsInitializeArray(methodInfo)) {
var first = _invocationExpression.Arguments.First().AcceptVisitor(Visitor, ParentScope);
var invocation = _invocationExpression.Arguments.Last() as NRefactory.InvocationExpression;
var second = invocation.Arguments.First();
var memberReference = invocationExpression.Target as NRefactory.MemberReferenceExpression;
var target = memberReference.Target as NRefactory.TypeReferenceExpression;
var type = target.Type.GetActualType();
var parameters = methodReference.Parameters;
return;
}
}
BuildInvocation();
}
示例12: NamedExpression
protected internal NamedExpression(NRefactory.NamedExpression namedExpression, IScope scope, INRefcatoryExpressionVisitor visitor)
: base(scope, visitor) {
Name = namedExpression.Identifier;
_namedExpression = namedExpression;
Expression = _namedExpression.Expression.AcceptVisitor(Visitor, ParentScope);
InternalType = Expression.Type;
}
示例13: evaluate
//interface
public static IInterface evaluate(Node_Interface node, IScope scope)
{
IList<IInterface> inheritees = new List<IInterface>();
IList<Callee> callees = new List<Callee>();
IList<Breeder> breeders = new List<Breeder>();
IList<Property> props = new List<Property>();
IList<Method> meths = new List<Method>();
foreach( INode_Expression inherNode in node.inheritees )
inheritees.Add(
Bridge.toNativeInterface(
Executor.executeAny(inherNode, scope)));
foreach( Node_StatusedMember sm in node.members ) {
//xxx member status (sm.memberStatus) is ignored
INode_InterfaceMember member = sm.member;
if( member is Node_Callee )
callees.Add(evaluate(member as Node_Callee, scope));
if( member is Node_Breeder )
breeders.Add(evaluate(member as Node_Breeder, scope));
if( member is Node_Property )
props.Add(evaluate(member as Node_Property, scope));
if( member is Node_Method )
meths.Add(evaluate(member as Node_Method, scope));
}
return new Interface(
inheritees, callees, breeders, props, meths );
}
示例14: FileConsumer
/// <summary>
/// Initializes a new instance of the FileConsumer class.
/// </summary>
/// <param name="scope">Scope of consumer.</param>
/// <param name="file">File.</param>
public FileConsumer(IScope scope, FileInfo file) {
_scope = scope;
_file = file;
_offset = 0;
_lastTimestamp = 0;
_startTimestamp = -1;
}
示例15: GiveAbnormalConditionAction
public GiveAbnormalConditionAction(IScope scope, ICost cost, IScreenEffect screenEffect, IAbnormalCondition cond)
{
_scope = scope;
_cost = cost;
_screenEffect = screenEffect;
_cond = cond;
}