コード例 #1
0
ファイル: AddrAssignCommand.cs プロジェクト: zesus19/c5.v1
 protected override Rpc.Serial.IInstruction BuildInstruction(Rpc.Net.Message.DuplexMessage commandMessage)
 {
     using (var scope = ObjectHost.Host.BeginLifetimeScope())
     {
         return(scope.Resolve <AddrAssignInstruction>(
                    new NamedParameter("command", this),
                    new NamedParameter("parameter", commandMessage.GetContent <AddrAssign>())));
     }
 }
コード例 #2
0
ファイル: TimeSyncCommand.cs プロジェクト: zesus19/c5.v1
        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);
        }
コード例 #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 <CardLogoutInstruction>(
                                                new NamedParameter("command", this),
                                                new NamedParameter("parameter", card)));
                }
            }
            return(instrSet);
        }
コード例 #4
0
ファイル: SizeAllocCommand.cs プロジェクト: zesus19/c5.v1
        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);
        }