/// <inheritdoc /> public override Expression VisitLockStatement(ILockStatement operation, LocalBinder argument) { return(Expressive.Lock( operation.LockedObject.Accept(this, argument), operation.Body.Accept(this, argument) )); }
internal BindContext(FieldBinder field, MethodBinder method, LocalBinder local, ArgBinder arg) { this.field = field; this.method = method; this.local = local; this.arg = arg; }
public override void onCreate() { Log.d(TAG, "onCreate"); base.onCreate(); mBinder = new LocalBinder(this); this.mSapaAppService = null; }
/*public void Dispose() * { * }*/ public void OnServiceConnected(ComponentName name, IBinder service) { LocalBinder binder = (LocalBinder)service; ma.mService = binder.GetService(); ma.isConnected = true; }
/// <inheritdoc /> public override Expression VisitUsingStatement(IUsingStatement operation, LocalBinder argument) { // TODO: Declarations in new binder return(Expressive.Using( Visit(operation.Declaration ?? operation.Value, argument), operation.Body.Accept(this, argument) )); }
public virtual void onServiceConnected(ComponentName className, IBinder service) { LocalBinder binder = (LocalBinder)service; outerInstance.mBackendService = binder.Service; outerInstance.mBackendService.registerImageReciever(outerInstance); outerInstance.mIsBound = true; outerInstance.mBackendService.findPeers(); }
/// <inheritdoc /> public override Expression VisitForEachLoopStatement(IForEachLoopStatement operation, LocalBinder argument) { ParameterExpression variable = VisitLocal(operation.IterationVariable); LocalBinder binder = argument.Child(operation.IterationVariable, variable); return(Expressive.ForEach(variable, operation.Collection.Accept(this, argument), operation.Body.Accept(this, binder) )); }
public BindingSubscription(IBindingSubscriptionKey <T> subRequestKey, PSAccessServiceInterface propStoreAccessService) { OwnerPropId = subRequestKey.OwnerPropId; BindingInfo = subRequestKey.BindingInfo; SubscriptionKind = subRequestKey.SubscriptionKind; SubscriptionPriorityGroup = subRequestKey.SubscriptionPriorityGroup; //SubscriptionTargetKind = sKey.SubscriptionTargetKind; LocalBinder = new LocalBinder <T>(propStoreAccessService, OwnerPropId, subRequestKey.BindingInfo); }
public override void onCreate() { Log.d(TAG, "onCreate"); base.onCreate(); this.mBinder = new LocalBinder(this); this.mServiceConnected = false; this.mActionsList = new Dictionary <string, MainService.ActionsPack>(); this.mProcessorList = new Dictionary <string, SapaProcessor>(); this.mAppInfoList = new Dictionary <string, SapaAppInfo>(); this.mCallerPackageNameList = new ConcurrentDictionary <string, string>(); }
public override void OnCreate() { base.OnCreate(); local_binder = new LocalBinder(this); instance = this; plugins = new HashSet <IPluginService> { new DevicePingPluginService(this, PING_INTERVAL), }; }
public override void OnCreate() { base.OnCreate(); local_binder = new LocalBinder(this); instance = this; plugins = new HashSet<IPluginService> { new DevicePingPluginService(this, PING_INTERVAL), }; }
public override void onCreate() { Log.d(TAG, "onCreate"); base.onCreate(); this.mBinder = new LocalBinder(this); this.mIsPlaying = false; this.mSapaAppService = null; this.mServiceConnected = false; this.mActionsList = new Dictionary<string, MainService.ActionsPack>(); this.mProcessorList = new Dictionary<string, SapaProcessor>(); this.mAppInfoList = new Dictionary<string, SapaAppInfo>(); this.mCallerPackageNameList = new ConcurrentDictionary<string, string>(); }
/// <inheritdoc /> public override Expression VisitIfStatement(IIfStatement operation, LocalBinder argument) { if (operation.IfFalseStatement != null) { return(Expression.IfThenElse( operation.Condition.Accept(this, argument), operation.IfTrueStatement.Accept(this, argument), operation.IfFalseStatement.Accept(this, argument) )); } return(Expression.IfThen( operation.Condition.Accept(this, argument), operation.IfTrueStatement.Accept(this, argument) )); }
/// <inheritdoc /> public override Expression VisitBranchStatement(IBranchStatement operation, LocalBinder argument) { GotoExpressionKind kind; switch (operation.BranchKind) { case BranchKind.Break: kind = GotoExpressionKind.Break; break; case BranchKind.Continue: kind = GotoExpressionKind.Continue; break; default: kind = GotoExpressionKind.Goto; break; } return Expression.MakeGoto(kind, ) }
/// <inheritdoc /> public override Expression VisitTryStatement(ITryStatement operation, LocalBinder argument) { CatchBlock MakeCatch(ICatchClause catchClause) { ParameterExpression variable = VisitLocal(catchClause.ExceptionLocal); LocalBinder binder = argument.Child(catchClause.ExceptionLocal, variable); return(Expression.MakeCatchBlock( catchClause.CaughtType.GetCorrespondingType(), variable, catchClause.Handler.Accept(this, binder), catchClause.Filter?.Accept(this, binder) )); } return(Expression.MakeTry(typeof(void), body: operation.Body.Accept(this, argument), @finally: operation.FinallyHandler?.Accept(this, argument), fault: null, handlers: operation.Catches.Select(MakeCatch) )); }
/// <inheritdoc /> public override Expression VisitForLoopStatement(IForLoopStatement operation, LocalBinder argument) { LocalBinder binder = argument.Child(); ImmutableArray <IOperation> before = operation.Before; Expression[] expressions = new Expression[before.Length + 1]; for (int i = 0; i < before.Length; i++) { expressions[i] = before[i].Accept(this, argument); } expressions[before.Length] = Expressive.For( ); return(Expression.Block( expressions )); }
/// <inheritdoc /> public override Expression VisitSwitchStatement(ISwitchStatement operation, LocalBinder argument) { ImmutableArray <ISwitchCase> cases = operation.Cases; SwitchCase[] switchCases = new SwitchCase[cases.Length]; Expression defaultBody = null; for (int i = 0; i < switchCases.Length; i++) { var @case = cases[i]; var block = Expression.Block(@case.Body.Select(x => x.Accept(this, argument))); Expression[] values = new Expression[@case.Clauses.Length]; for (int j = 0; j < values.Length; j++) { var clause = @case.Clauses[j]; switch (clause.CaseKind) { case CaseKind.SingleValue: values[i] = Expression.Constant(clause.ConstantValue.Value); break; case CaseKind.Default: defaultBody = block; values[i] = null; break; default: throw NotSupported(operation); } } switchCases[i] = Expression.SwitchCase(block, values); } return(Expression.Switch(operation.Value.Accept(this, argument), defaultBody, switchCases)); }
public override void RewriteChildren(ContractElement contractElement) { base.RewriteChildren(contractElement); var be = contractElement.Condition as IBlockExpression; if (be != null) { var lb = new LocalBinder(this.host); contractElement.Condition = lb.Rewrite(contractElement.Condition); if (lb.localDeclarations.Any()) { var be2 = new BlockExpression() { BlockStatement = new BlockStatement() { Statements = lb.localDeclarations, }, Expression = contractElement.Condition, }; contractElement.Condition = be2; } } }
/// <inheritdoc /> public override Expression VisitBlockStatement(IBlockStatement operation, LocalBinder argument) { // Create corresponding variables var locals = operation.Locals; var variables = new ParameterExpression[locals.Length]; for (int i = 0; i < locals.Length; i++) { variables[i] = VisitLocal(locals[i]); } // Transform statements var binder = argument.Child(locals, variables); var statements = operation.Statements; var expressions = new Expression[statements.Length]; for (int i = 0; i < expressions.Length; i++) { expressions[i] = statements[i].Accept(this, binder); } // Return created block return(Expression.Block(variables, expressions)); }
private void InitializeInstanceFields() { mBinder = new LocalBinder(this); }
/// <inheritdoc /> public override Expression VisitLiteralExpression(ILiteralExpression operation, LocalBinder argument) { return(Expression.Constant(operation.ConstantValue.Value)); }
/// <inheritdoc /> public override Expression VisitEventAssignmentExpression(IEventAssignmentExpression operation, LocalBinder argument) { return(base.VisitEventAssignmentExpression(operation, argument)); }
/// <inheritdoc /> public override Expression VisitEndStatement(IEndStatement operation, LocalBinder argument) { throw NotSupported(operation); }
/// <inheritdoc /> public override Expression VisitReturnStatement(IReturnStatement operation, LocalBinder argument) { return(Expression.Return(ReturnTarget)); }
/// <inheritdoc /> public override Expression VisitEmptyStatement(IEmptyStatement operation, LocalBinder argument) { return(Expression.Empty()); }
/// <inheritdoc /> public override Expression VisitYieldBreakStatement(IReturnStatement operation, LocalBinder argument) { return Expression.Break() }
/// <inheritdoc /> public override Expression VisitLambdaExpression(ILambdaExpression operation, LocalBinder argument) { // Make parameters ImmutableArray <IParameterSymbol> sigParameters = operation.Signature.Parameters; ParameterExpression[] parameters = new ParameterExpression[sigParameters.Length]; for (int i = 0; i < parameters.Length; i++) { IParameterSymbol sigParameter = sigParameters[i]; parameters[i] = Expression.Parameter(sigParameter.Type.GetCorrespondingType(), sigParameter.Name); } // Return lambda return(Expression.Lambda(operation.Body.Accept(this, argument), operation.Signature.Name, parameters)); }
/// <inheritdoc /> public override Expression VisitThrowStatement(IThrowStatement operation, LocalBinder argument) { return(Expression.Throw(operation.ThrownObject.Accept(this, argument))); }
/// <inheritdoc /> public override Expression VisitUnboundLambdaExpression(IUnboundLambdaExpression operation, LocalBinder argument) { throw NotSupported(operation); }
/// <inheritdoc /> public override Expression VisitExpressionStatement(IExpressionStatement operation, LocalBinder argument) { return(Expression.Convert(operation.Expression.Accept(this, argument), typeof(void))); }
/// <inheritdoc /> public override Expression VisitLocalFunctionStatement(IOperation operation, LocalBinder argument) { throw NotSupported(operation); }
/// <inheritdoc /> public override Expression VisitLabelStatement(ILabelStatement operation, LocalBinder argument) { return(Expression.Label(operation.LabeledStatement.Accept(this, argument))); }