Esempio n. 1
0
 internal override void CreateFromStream(BinaryReader reader)
 {
     base.CreateFromStream(reader);
     child = new TargetInProgessState();
     child.CreateFromStream(reader);
     parent = new TargetInProgessState();
     parent.CreateFromStream(reader);
 }
Esempio n. 2
0
        internal static NodeStatus CreateFromStream(BinaryReader reader)
        {
            NodeStatus status = new NodeStatus(null);

            status.traversalType               = reader.ReadBoolean();
            status.statusTimeStamp             = reader.ReadInt64();
            status.requestId                   = reader.ReadInt32();
            status.isActive                    = reader.ReadBoolean();
            status.isLaunchInProgress          = reader.ReadBoolean();
            status.queueDepth                  = reader.ReadInt32();
            status.lastTaskActivityTimeStamp   = reader.ReadInt64();
            status.lastEngineActivityTimeStamp = reader.ReadInt64();

            if (reader.ReadByte() == 0)
            {
                status.stateOfInProgressTargets = null;
            }
            else
            {
                int numberOfInProgressTargets = reader.ReadInt32();
                status.stateOfInProgressTargets = new TargetInProgessState[numberOfInProgressTargets];
                for (int i = 0; i < numberOfInProgressTargets; i++)
                {
                    if (reader.ReadByte() == 0)
                    {
                        status.stateOfInProgressTargets[i] = null;
                    }
                    else
                    {
                        TargetInProgessState state = new TargetInProgessState();
                        state.CreateFromStream(reader);
                        status.stateOfInProgressTargets[i] = state;
                    }
                }
            }

            if (reader.ReadByte() == 0)
            {
                status.unhandledException = null;
            }
            else
            {
                status.unhandledException = (Exception)formatter.Deserialize(reader.BaseStream);
            }
            return(status);
        }