Exemplo n.º 1
0
        protected override IInstruction BuildInstruction(DuplexMessage commandMessage)
        {
            var instrSet = new InstructionSet(this);

            using (var scope = ObjectHost.Host.BeginLifetimeScope())
            {
                instrSet.AddInstruction(scope.Resolve <CheckInQueryInstruction>(
                                            new NamedParameter("command", this),
                                            new NamedParameter("parameter", commandMessage.GetContent <object>())));
                instrSet.AddInstruction(scope.Resolve <CheckInReplyInstruction>(
                                            new NamedParameter("parameter", commandMessage.GetContent <object>())));
            }
            return(instrSet);
        }
Exemplo n.º 2
0
        protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage)
        {
            var instrSet  = new InstructionSet(this);
            var sizeAlloc = commandMessage.GetContent <SizeAlloc>();

            using (var scope = ObjectHost.Host.BeginLifetimeScope())
            {
                instrSet.AddInstruction(scope.Resolve <SizeAllocInstruction>(
                                            new NamedParameter("command", this),
                                            new NamedParameter("parameter", sizeAlloc)));
                foreach (var unit in sizeAlloc.GradeUnits)
                {
                    instrSet.AddInstruction(scope.Resolve <ClassroomProfileSyncInstruction>(
                                                new NamedParameter("command", this),
                                                new NamedParameter("parameter", unit)));
                }
            }
            return(instrSet);
        }
Exemplo n.º 3
0
        protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage)
        {
            var instrSet   = new InstructionSet(this);
            var cardAssign = commandMessage.GetContent <CardAssign>();

            using (var scope = ObjectHost.Host.BeginLifetimeScope())
            {
                foreach (var card in cardAssign.Units)
                {
                    instrSet.AddInstruction(scope.Resolve <CardAssignInstruction>(
                                                new NamedParameter("command", this),
                                                new NamedParameter("parameter", card)));
                    if (card.Profile != null)
                    {
                        instrSet.AddInstruction(scope.Resolve <StudentProfileSyncInstruction>(
                                                    new NamedParameter("command", this),
                                                    new NamedParameter("parameter", card.Profile)));
                    }
                }
            }
            return(instrSet);
        }
Exemplo n.º 4
0
        protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage)
        {
            var instrSet = new InstructionSet(this);

            using (var scope = ObjectHost.Host.BeginLifetimeScope())
            {
                foreach (var addr in commandMessage.GetContent <TimeSync>().DestinationAddrs)
                {
                    instrSet.AddInstruction(scope.Resolve <TimeSyncInstruction>(
                                                new NamedParameter("command", this),
                                                new NamedParameter("parameter", addr)));
                }
            }
            return(instrSet);
        }