Exemplo n.º 1
0
 /// <inheritdoc />
 public override Expression VisitLockStatement(ILockStatement operation, LocalBinder argument)
 {
     return(Expressive.Lock(
                operation.LockedObject.Accept(this, argument),
                operation.Body.Accept(this, argument)
                ));
 }
Exemplo n.º 2
0
 internal BindContext(FieldBinder field, MethodBinder method, LocalBinder local, ArgBinder arg)
 {
     this.field  = field;
     this.method = method;
     this.local  = local;
     this.arg    = arg;
 }
Exemplo n.º 3
0
 public override void onCreate()
 {
     Log.d(TAG, "onCreate");
     base.onCreate();
     mBinder = new LocalBinder(this);
     this.mSapaAppService = null;
 }
Exemplo n.º 4
0
        /*public void Dispose()
         * {
         * }*/

        public void OnServiceConnected(ComponentName name, IBinder service)
        {
            LocalBinder binder = (LocalBinder)service;

            ma.mService    = binder.GetService();
            ma.isConnected = true;
        }
Exemplo n.º 5
0
		public override void onCreate()
		{
			Log.d(TAG, "onCreate");
			base.onCreate();
			mBinder = new LocalBinder(this);
			this.mSapaAppService = null;
		}
Exemplo n.º 6
0
 /// <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)
                ));
 }
Exemplo n.º 7
0
            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();
            }
Exemplo n.º 8
0
        /// <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)
                                      ));
        }
Exemplo n.º 9
0
        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);
        }
Exemplo n.º 10
0
 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>();
 }
Exemplo n.º 11
0
        public override void OnCreate()
        {
            base.OnCreate();

            local_binder = new LocalBinder(this);

            instance = this;

            plugins = new HashSet <IPluginService> {
                new DevicePingPluginService(this, PING_INTERVAL),
            };
        }
Exemplo n.º 12
0
        public override void OnCreate()
        {
            base.OnCreate();

            local_binder = new LocalBinder(this);

            instance = this;

            plugins = new HashSet<IPluginService> {
                new DevicePingPluginService(this, PING_INTERVAL),
            };
        }
Exemplo n.º 13
0
		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>();
		}
Exemplo n.º 14
0
        /// <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)
                       ));
        }
Exemplo n.º 15
0
        /// <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, )
        }
Exemplo n.º 16
0
        /// <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)
                                      ));
        }
Exemplo n.º 17
0
        /// <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
                       ));
        }
Exemplo n.º 18
0
        /// <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));
        }
Exemplo n.º 19
0
            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;
                    }
                }
            }
Exemplo n.º 20
0
        /// <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));
        }
Exemplo n.º 21
0
 private void InitializeInstanceFields()
 {
     mBinder = new LocalBinder(this);
 }
Exemplo n.º 22
0
 /// <inheritdoc />
 public override Expression VisitLiteralExpression(ILiteralExpression operation, LocalBinder argument)
 {
     return(Expression.Constant(operation.ConstantValue.Value));
 }
Exemplo n.º 23
0
 /// <inheritdoc />
 public override Expression VisitEventAssignmentExpression(IEventAssignmentExpression operation, LocalBinder argument)
 {
     return(base.VisitEventAssignmentExpression(operation, argument));
 }
Exemplo n.º 24
0
 /// <inheritdoc />
 public override Expression VisitEndStatement(IEndStatement operation, LocalBinder argument)
 {
     throw NotSupported(operation);
 }
Exemplo n.º 25
0
 /// <inheritdoc />
 public override Expression VisitReturnStatement(IReturnStatement operation, LocalBinder argument)
 {
     return(Expression.Return(ReturnTarget));
 }
Exemplo n.º 26
0
 /// <inheritdoc />
 public override Expression VisitEmptyStatement(IEmptyStatement operation, LocalBinder argument)
 {
     return(Expression.Empty());
 }
Exemplo n.º 27
0
 /// <inheritdoc />
 public override Expression VisitYieldBreakStatement(IReturnStatement operation, LocalBinder argument)
 {
     return Expression.Break()
 }
Exemplo n.º 28
0
        /// <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));
        }
Exemplo n.º 29
0
 /// <inheritdoc />
 public override Expression VisitThrowStatement(IThrowStatement operation, LocalBinder argument)
 {
     return(Expression.Throw(operation.ThrownObject.Accept(this, argument)));
 }
Exemplo n.º 30
0
 /// <inheritdoc />
 public override Expression VisitUnboundLambdaExpression(IUnboundLambdaExpression operation, LocalBinder argument)
 {
     throw NotSupported(operation);
 }
Exemplo n.º 31
0
 /// <inheritdoc />
 public override Expression VisitExpressionStatement(IExpressionStatement operation, LocalBinder argument)
 {
     return(Expression.Convert(operation.Expression.Accept(this, argument), typeof(void)));
 }
Exemplo n.º 32
0
 /// <inheritdoc />
 public override Expression VisitLocalFunctionStatement(IOperation operation, LocalBinder argument)
 {
     throw NotSupported(operation);
 }
Exemplo n.º 33
0
 /// <inheritdoc />
 public override Expression VisitLabelStatement(ILabelStatement operation, LocalBinder argument)
 {
     return(Expression.Label(operation.LabeledStatement.Accept(this, argument)));
 }
Exemplo n.º 34
0
		private void InitializeInstanceFields()
		{
			mBinder = new LocalBinder(this);
		}