void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
        {
            switch (definition.Version)
            {
            case 1:
                packet.GetField("name", out m_Name);

                string typeName;
                packet.GetField("valueType", out typeName);
                SetType(Type.GetType(typeName));

                packet.GetField("caption", out m_Caption);
                packet.GetField("description", out m_Description);

                int rawDefaultTrend;
                packet.GetField("defaultTrend", out rawDefaultTrend);
                m_DefaultTrend = (EventMetricValueTrend)rawDefaultTrend;

                packet.GetField("eventDefinitionPacketId", out m_EventDefinitionPacketId);
                packet.GetField("unitCaption", out m_UnitCaption);

                break;

            default:
                throw new GibraltarPacketVersionException(definition.Version);
            }
        }
Exemple #2
0
 public SheetMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.SheetCollectionSelector = (SheetCollection)SerializedPacket.DeserializeLong(p.GetNextPart());
     this.Disposition             = (SheetDisposition)SerializedPacket.DeserializeLong(p.GetNextPart());
     this.Bounds = SerializedPacket.DeserializeRectangle(p.GetNextPart());
     this.Height = SerializedPacket.DeserializeInt(p.GetNextPart());
 }
 public GroupInformationMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.GroupId = SerializedPacket.DeserializeGuid( p.GetNextPart() );
     this.FriendlyName = SerializedPacket.DeserializeString( p.GetNextPart() );
     this.Singleton = SerializedPacket.DeserializeBool( p.GetNextPart() );
 }
        public BroadcastMessage(SerializedPacket p)
        {
            SerializedPacket.VerifyPacket(p, this.GetClassId());
            this.EndPoints = null;
            if (SerializedPacket.DeserializeBool(p.GetNextPart()))
            {
                this.EndPoints = new IPEndPoint[SerializedPacket.DeserializeInt(p.GetNextPart())];
                for (int i = 0; i < this.EndPoints.Length; i++)
                {
                    this.EndPoints[i] = SerializedPacket.DeserializeIPEndPoint(p.GetNextPart());
                }
            }
            this.HumanName        = SerializedPacket.DeserializeString(p.GetNextPart());
            this.SenderID         = SerializedPacket.DeserializeGuid(p.GetNextPart());
            this.PresentationName = SerializedPacket.DeserializeString(p.GetNextPart());
            this.ShowIP           = SerializedPacket.DeserializeBool(p.GetNextPart());

/*
 * //CMPRINCE DEBUGGING
 *          string IPs = "";
 *          foreach( IPEndPoint ep in this.EndPoints ) {
 *              IPs += ep.Address.ToString() + " ";
 *          }
 *          System.Diagnostics.Debug.Write( "RECVD: BroadcastListener: " +
 *              IPs +
 *              this.HumanName + " " +
 *              this.SenderID.ToString() + " " +
 *              this.PresentationName +
 *              System.Environment.NewLine
 *              );
 */
        }
        private void Packet_ThrowsException_IfPacketIsntRegistered(ISerializer serializer)
        {
            var packet = new UnregisteredPacket {
            };

            try {
                SerializedPacket.Create(packet, serializer);
                Assert.Fail("Exception should have been thrown");
            } catch (UnregisteredPacketException) {
            }

            Packet.RegisterPacketType <UnregisteredPacket>();

            var serialized = SerializedPacket.Create(packet, serializer);

            Packet.UnregisterPacketType <UnregisteredPacket>();

            try {
                var ser = SerializedPacket.Read(serialized);
                ser.DeserializePacket(serializer);
                Assert.Fail("Exception should have been thrown");
            } catch (UnregisteredPacketException) {
                Assert.Pass();
            }
        }
Exemple #6
0
 public TextSheetMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.Text       = SerializedPacket.DeserializeString(p.GetNextPart());
     this.font_      = new Font(SerializedPacket.DeserializeString(p.GetNextPart()), 12.0f);
     this.color_     = SerializedPacket.DeserializeColor(p.GetNextPart());
     this.is_public_ = SerializedPacket.DeserializeBool(p.GetNextPart());
 }
 public RealTimeInkSheetDataMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.StylusId = SerializedPacket.DeserializeInt( p.GetNextPart() );
     this.StrokeId = SerializedPacket.DeserializeInt( p.GetNextPart() );
     this.Packets = SerializedPacket.DeserializeIntArray( p.GetNextPart() );
 }
Exemple #8
0
        void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
        {
            switch (definition.Version)
            {
            case 1:
                packet.GetField("Key", out m_Key);
                packet.GetField("UserName", out m_FullyQualifiedUserName);
                packet.GetField("Caption", out m_Caption);
                packet.GetField("Title", out m_Title);
                packet.GetField("Organization", out m_Organization);
                packet.GetField("Role", out m_Role);
                packet.GetField("Tenant", out m_Tenant);
                packet.GetField("TimeZoneCode", out m_TimeZoneCode);
                packet.GetField("EmailAddress", out m_EmailAddress);
                packet.GetField("Phone", out m_Phone);

                string[] propertyNames;
                packet.GetField("PropertyNames", out propertyNames);

                string[] propertyValues;
                packet.GetField("PropertyValues", out propertyValues);

                for (int index = 0; index < propertyNames.Length; index++)
                {
                    var propertyName  = propertyNames[index];
                    var propertyValue = propertyValues[index];
                    m_Properties.Add(propertyName, propertyValue);
                }

                break;
            }
        }
Exemple #9
0
        void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
        {
            switch (definition.Version)
            {
            case 1:
                packet.GetField("MetricTypeName", out m_MetricTypeName);
                packet.GetField("CategoryName", out m_CategoryName);
                packet.GetField("CounterName", out m_CounterName);

                int rawSampleType;
                packet.GetField("SampleType", out rawSampleType);
                m_SampleType = (SampleType)rawSampleType;

                packet.GetField("Caption", out m_Caption);
                packet.GetField("Description", out m_Description);

                int rawInterval;
                packet.GetField("Interval", out rawInterval);
                m_Interval = (MetricSampleInterval)rawInterval;

                //and our stuff that we have to calculate
                Name = MetricDefinition.GetKey(MetricTypeName, CategoryName, CounterName); //generate the name

                m_ReadOnly = true;                                                         //if we got read out of a file, we're read only.
                break;

            default:
                throw new GibraltarPacketVersionException(definition.Version);
            }

            //we are NOT live - we came from a serialization reader
            IsLive = false;
        }
        public BroadcastMessage( SerializedPacket p )
        {
            SerializedPacket.VerifyPacket( p, this.GetClassId() );
            this.EndPoints = null;
            if( SerializedPacket.DeserializeBool( p.GetNextPart() ) ) {
                this.EndPoints = new IPEndPoint[SerializedPacket.DeserializeInt( p.GetNextPart() )];
                for( int i = 0; i < this.EndPoints.Length; i++ ) {
                    this.EndPoints[i] = SerializedPacket.DeserializeIPEndPoint( p.GetNextPart() );
                }
            }
            this.HumanName = SerializedPacket.DeserializeString( p.GetNextPart() );
            this.SenderID = SerializedPacket.DeserializeGuid( p.GetNextPart() );
            this.PresentationName = SerializedPacket.DeserializeString( p.GetNextPart() );
            this.ShowIP = SerializedPacket.DeserializeBool( p.GetNextPart() );

            /*
            //CMPRINCE DEBUGGING
            string IPs = "";
            foreach( IPEndPoint ep in this.EndPoints ) {
                IPs += ep.Address.ToString() + " ";
            }
            System.Diagnostics.Debug.Write( "RECVD: BroadcastListener: " +
                IPs +
                this.HumanName + " " +
                this.SenderID.ToString() + " " +
                this.PresentationName +
                System.Environment.NewLine
                );
            */
        }
Exemple #11
0
 /// <summary>
 /// Construct the message
 /// </summary>
 /// <param name="p">The packet</param>
 public Message(Message parent, SerializedPacket p)
 {
     SerializedPacket.VerifyPacket(p, this.GetClassId());
     this.Group = (!SerializedPacket.IsNullPacket(p.PeekNextPart())) ?
                  new Group(p.PeekNextPart()) : null; p.GetNextPart();
     if (SerializedPacket.IsNullPacket(p.PeekNextPart()))
     {
         this.TargetId = null;
     }
     else if (p.PeekNextPart().Type == PacketTypes.GuidId)
     {
         this.TargetId = (ValueType)SerializedPacket.DeserializeGuid(p.PeekNextPart());
     }
     else if (p.PeekNextPart().Type == PacketTypes.ByteArrayClassId)
     {
         this.TargetId = (ValueType) new Model.Presentation.ByteArray(SerializedPacket.DeserializeGuid(p.PeekNextPart()));
     }
     else
     {
         throw new Exception("Unknown ValueType");
     }
     p.GetNextPart();
     this.Parent = parent;
     this.Child  = (!SerializedPacket.IsNullPacket(p.PeekNextPart())) ?
                   (Message)PacketTypes.DecodeMessage(this, p.PeekNextPart()): null; p.GetNextPart();
     this.Predecessor = (!SerializedPacket.IsNullPacket(p.PeekNextPart())) ?
                        (Message)PacketTypes.DecodeMessage(this, p.PeekNextPart()): null; p.GetNextPart();
     this.m_MessageIdentifier = SerializedPacket.DeserializeGuid(p.GetNextPart());
 }
Exemple #12
0
        /// <summary>
        /// Serialize this object
        /// </summary>
        /// <returns>The serialized packet</returns>
        public virtual SerializedPacket Serialize()
        {
            SerializedPacket p = new SerializedPacket(this.GetClassId());

            p.Add((this.Group != null) ?
                  this.Group.Serialize() : SerializedPacket.NullPacket(PacketTypes.GroupId));
            if (this.TargetId is Guid && this.TargetId != null)
            {
                p.Add(SerializedPacket.SerializeGuid((Guid)this.TargetId));
            }
            else if (this.TargetId is Model.Presentation.ByteArray && this.TargetId != null)
            {
                p.Add(SerializedPacket.SerializeGuid(((Model.Presentation.ByteArray) this.TargetId).ToGuid()));
            }
            else
            {
                p.Add(SerializedPacket.NullPacket(PacketTypes.GuidId));
            }
            // Don't Serialize Parent
            p.Add((this.Child != null) ?
                  this.Child.Serialize() : SerializedPacket.NullPacket(PacketTypes.MessageId));
            p.Add((this.Predecessor != null) ?
                  this.Predecessor.Serialize() : SerializedPacket.NullPacket(PacketTypes.MessageId));
            p.Add(SerializedPacket.SerializeGuid(this.m_MessageIdentifier));
            return(p);
        }
 void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
 {
     switch (definition.Version)
     {
     case 1:
         packet.GetField("ThreadId", out m_ThreadId);
         if (definition.Fields.ContainsKey("ThreadIndex"))
         {
             packet.GetField("ThreadIndex", out m_ThreadIndex);
             if (m_ThreadIndex == 0)
             {
                 m_ThreadIndex = m_ThreadId;     // Zero isn't legal, so it must not have had it.  Fall back to ThreadId.
             }
         }
         else
         {
             m_ThreadIndex = m_ThreadId;     // Use the "unique" ThreadId from older Agent code.
         }
         packet.GetField("ThreadName", out m_ThreadName);
         packet.GetField("DomainId", out m_DomainId);
         packet.GetField("DomainName", out m_DomainName);
         packet.GetField("IsBackground", out m_IsBackground);
         packet.GetField("IsThreadPoolThread", out m_IsThreadPoolThread);
         break;
     }
 }
Exemple #14
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add(SerializedPacket.SerializeString(this.HumanName));
            return(p);
        }
        void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
        {
            switch (definition.Version)
            {
            case 1:
                long baseValue;
                long counterTimeStamp;
                long counterFrequency;
                long systemFrequency;
                long timeStamp;
                long timeStamp100nSec;

                packet.GetField("baseValue", out baseValue);
                packet.GetField("counterTimeStamp", out counterTimeStamp);
                packet.GetField("counterFrequency", out counterFrequency);
                packet.GetField("systemFrequency", out systemFrequency);
                packet.GetField("timeStamp", out timeStamp);
                packet.GetField("timeStamp100nSec", out timeStamp100nSec);

                //conceptually we shouldn't persist this - it's always the same and it's always on our metric, however
                //we need it here for deserialization purposes because our metric packet object isn't available during
                //the deserialization process.
                int rawCounterType;
                packet.GetField("counterType", out rawCounterType);
                PerformanceCounterType counterType = (PerformanceCounterType)rawCounterType;

                //Now, create our sample object from this data
                m_Sample = new CounterSample((long)base.RawValue, baseValue, counterFrequency, systemFrequency, timeStamp, timeStamp100nSec, counterType, counterTimeStamp);
                break;

            default:
                throw new GibraltarPacketVersionException(definition.Version);
            }
        }
Exemple #16
0
 public InstructorMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.AcceptingStudentSubmissions   = SerializedPacket.DeserializeBool(p.GetNextPart());
     this.ForcingStudentNavigationLock  = SerializedPacket.DeserializeBool(p.GetNextPart());
     this.AcceptingQuickPollSubmissions = SerializedPacket.DeserializeBool(p.GetNextPart());
     this.InstructorClockTicks          = SerializedPacket.DeserializeInt64(p.GetNextPart());
 }
 void IPacket.WriteFields(PacketDefinition definition, SerializedPacket packet)
 {
     packet.SetField("TypeName", TypeName);
     packet.SetField("Message", Message);
     packet.SetField("Source", Source);
     packet.SetField("StackTrace", StackTrace);
 }
        void IPacket.ReadFields(PacketDefinition definition, SerializedPacket packet)
        {
            switch (definition.Version)
            {
            case 1:
                //read the values by our definition
                Values = new object[definition.Fields.Count];

                for (int valueIndex = 0; valueIndex < definition.Fields.Count; valueIndex++)
                {
                    FieldDefinition fieldDefinition = definition.Fields[valueIndex];
                    object          fieldValue;
                    packet.GetField(fieldDefinition.Name, out fieldValue);
                    Values[valueIndex] = fieldValue;
                }

                break;

            default:
                throw new GibraltarPacketVersionException(definition.Version);
            }

            //Now we need to go off and find our value definition so we can be serialized out gain
            IMetric ourMetric;

            if (Session.MetricDefinitions.TryGetMetricValue(MetricId, out ourMetric) == false)
            {
                //BIG problems- no metric for our metric ID?
                throw new ArgumentException("Unable to read event metric sample because the associated metric couldn't be found.");
            }
            m_ValueDefinitions = (EventMetricValueDefinitionCollection)((EventMetric)ourMetric).Definition.Values;
        }
Exemple #19
0
 public SubmissionStatusModel(SerializedPacket p)
 {
     SerializedPacket.VerifyPacket(p, this.GetClassId());
     this.id_ = SerializedPacket.DeserializeGuid(p.GetPart(0));
     this.submission_status_ = (Status)SerializedPacket.DeserializeInt(p.GetPart(1));
     this.role_ = SerializedPacket.DeserializeString(p.GetPart(2));
 }
Exemple #20
0
        private BroadcastMessage deserialize(byte[] buf)
        {
            MemoryStream     ms      = new MemoryStream(buf);
            BroadcastMessage message = null;

#if GENERIC_SERIALIZATION
            try {
                SerializedPacket p = new SerializedPacket(ms);
                message = (BroadcastMessage)PacketTypes.DecodeMessage(null, p);
            } catch (Exception e) {
                Trace.WriteLine(e.ToString(), this.GetType().ToString());
                return(null);
            }
#else
            BinaryFormatter bf = new BinaryFormatter();
            try {
                message = (BroadcastMessage)bf.Deserialize(ms);
            } catch (SerializationException se) {
                Trace.WriteLine("Failed to deserialize a BroadcastMessage: " + se.Message, this.GetType().ToString());
                return(null);
            } catch (Exception e) {
                Trace.WriteLine(e.ToString(), this.GetType().ToString());
                return(null);
            }
#endif
            return(message);
        }
Exemple #21
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add(SerializedPacket.SerializeGuid(this.participantId));
            return(p);
        }
Exemple #22
0
 public InkSheetStrokesDeletingMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.StrokeIds = new string[SerializedPacket.DeserializeInt(p.GetNextPart())];
     for (int i = 0; i < this.StrokeIds.Length; i++)
     {
         this.StrokeIds[i] = SerializedPacket.DeserializeString(p.GetNextPart());
     }
 }
Exemple #23
0
 public InkSheetStrokesAddedMessage(Message parent, SerializedPacket p) : base(parent, p)
 {
     this.SavedInks = new byte[SerializedPacket.DeserializeInt(p.GetNextPart())][];
     for (int i = 0; i < this.SavedInks.Length; i++)
     {
         this.SavedInks[i] = SerializedPacket.DeserializeByteArray(p.GetNextPart());
     }
 }
Exemple #24
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add(SerializedPacket.SerializeGuid(this.SlideGuid));
            p.Add(SerializedPacket.SerializeGuid(this.TOCEntryGuid));
            return(p);
        }
Exemple #25
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add((this.m_Result != null) ?
                  this.m_Result.Serialize() : SerializedPacket.NullPacket(PacketTypes.QuickPollResultModelId));
            return(p);
        }
        void IPacket.WriteFields(PacketDefinition definition, SerializedPacket packet)
        {
            packet.SetField("instanceName", m_InstanceName);
            packet.SetField("definitionId", m_DefinitionId);

            //and now we HAVE persisted
            Persisted = true;
        }
 public SheetMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.SheetCollectionSelector = (SheetCollection)SerializedPacket.DeserializeLong( p.GetNextPart() );
     this.Disposition = (SheetDisposition)SerializedPacket.DeserializeLong( p.GetNextPart() );
     this.Bounds = SerializedPacket.DeserializeRectangle( p.GetNextPart() );
     this.Height = SerializedPacket.DeserializeInt( p.GetNextPart() );
 }
 public TextSheetMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.Text = SerializedPacket.DeserializeString( p.GetNextPart() );
     this.font_ = new Font( SerializedPacket.DeserializeString( p.GetNextPart() ), 12.0f );
     this.color_ = SerializedPacket.DeserializeColor( p.GetNextPart() );
     this.is_public_ = SerializedPacket.DeserializeBool( p.GetNextPart() );
 }
Exemple #29
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add((this.TabletProperties != null) ?
                  this.TabletProperties.Serialize() : SerializedPacket.NullPacket(PacketTypes.TabletPropertyDescriptionCollectionInformationId));
            return(p);
        }
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add((this.PathFromRoot != null) ?
                  SerializedPacket.SerializeIntArray(this.PathFromRoot) : SerializedPacket.NullPacket(PacketTypes.IntArrayId));
            return(p);
        }
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add((this.sender_ != null) ?
                  this.sender_.Serialize() : SerializedPacket.NullPacket(PacketTypes.SubmissionStatusModelId));
            return(p);
        }
Exemple #32
0
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add((this.CurrentDrawingAttributes != null) ?
                  this.CurrentDrawingAttributes.Serialize() : SerializedPacket.NullPacket(PacketTypes.DrawingAttributesSerializerId));
            return(p);
        }
        public override SerializedPacket Serialize()
        {
            SerializedPacket p = base.Serialize();

            p.Add(SerializedPacket.SerializeGuid(this.MD5.ToGuid()));
            // TODO CMPRINCE: Serialize the Image Part
            return(p);
        }
Exemple #34
0
        public SerializedPacket Serialize()
        {
            SerializedPacket p = new SerializedPacket(this.GetClassId());

            p.Add(SerializedPacket.SerializeGuid(this.m_id));
            p.Add(SerializedPacket.SerializeString(this.m_friendlyName));
            return(p);
        }
        void IPacket.WriteFields(PacketDefinition definition, SerializedPacket packet)
        {
            packet.SetField("Id", m_ID);
            packet.SetField("metricPacketId", m_MetricPacket.ID);

            //and now we HAVE persisted
            Persisted = true;
        }
 public SerializedPacket Serialize()
 {
     SerializedPacket p = new SerializedPacket( this.GetClassId() );
     p.Add( SerializedPacket.SerializeGuid( this.ParticipantId ) );
     p.Add( (this.EndPoint != null ) ?
         SerializedPacket.SerializeIPEndPoint( this.EndPoint ) : SerializedPacket.NullPacket( PacketTypes.IPEndPointId ) );
     p.Add( SerializedPacket.SerializeString( this.HumanName ) );
     p.Add( SerializedPacket.SerializeULong( this.LastMessageSequence ) );
     p.Add( SerializedPacket.SerializeULong( this.LastChunkSequence ) );
     return p;
 }
 public SerializedPacket Serialize()
 {
     SerializedPacket p = new SerializedPacket( this.GetClassId() );
     p.Add( SerializedPacket.SerializeBool( this.EndPoints != null ) );
     if( this.EndPoints != null ) {
         p.Add( SerializedPacket.SerializeInt( this.EndPoints.Length ) );
         foreach( IPEndPoint ep in this.EndPoints ) {
             p.Add( SerializedPacket.SerializeIPEndPoint( ep ) );
         }
     }
     p.Add( SerializedPacket.SerializeString( this.HumanName ) );
     p.Add( SerializedPacket.SerializeGuid( this.SenderID ) );
     p.Add( SerializedPacket.SerializeString( this.PresentationName ) );
     p.Add( SerializedPacket.SerializeBool( this.ShowIP ) );
     return p;
 }
        public TCPHandshakeMessage( SerializedPacket p )
        {
            SerializedPacket.VerifyPacket( p, this.GetClassId() );
            this.ParticipantId = SerializedPacket.DeserializeGuid( p.GetNextPart() );
            this.EndPoint = (!SerializedPacket.IsNullPacket( p.PeekNextPart() )) ?
                SerializedPacket.DeserializeIPEndPoint( p.PeekNextPart() ) : null; p.GetNextPart();
            this.HumanName = SerializedPacket.DeserializeString( p.GetNextPart() );
            this.LastMessageSequence = SerializedPacket.DeserializeULong( p.GetNextPart() );
            this.LastChunkSequence = SerializedPacket.DeserializeULong( p.GetNextPart() );

            System.Diagnostics.Debug.Write( "TCPHandshakeMessage: " +
                this.ParticipantId.ToString() + " " +
                ((this.EndPoint != null) ? (this.EndPoint.Address.ToString() + ":" + this.EndPoint.Port.ToString() + " ") : "") +
                this.HumanName + " " +
                this.LastMessageSequence + " " +
                this.LastChunkSequence +
                System.Environment.NewLine );
        }
Exemple #39
0
 public Chunk( SerializedPacket p )
 {
     SerializedPacket.VerifyPacket( p, this.GetClassId() );
     this.Data = (!SerializedPacket.IsNullPacket( p.PeekNextPart() )) ?
         SerializedPacket.DeserializeByteArray( p.PeekNextPart() ) : null; p.GetNextPart();
     this.MessageSequence = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.ChunkSequenceInMessage = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.NumberOfChunksInMessage = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.MessageDependency = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.FrameSequence = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.OldestRecoverableMessage = SerializedPacket.DeserializeULong( p.GetNextPart() );
     this.OldestRecoverableFrame = SerializedPacket.DeserializeULong( p.GetNextPart() );
 }
 public SerializedPacket Serialize()
 {
     SerializedPacket p = new SerializedPacket( this.GetClassId() );
     return p;
 }
 public TCPHeartbeatMessage( SerializedPacket p )
 {
     SerializedPacket.VerifyPacket( p, this.GetClassId() );
 }
 public ImageSheetMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.MD5 = new ByteArray( SerializedPacket.DeserializeGuid( p.GetNextPart() ) );
 }
 public SynchronizationMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.participantId = SerializedPacket.DeserializeGuid( p.GetNextPart() );
 }
 public SyncBeginMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public TableOfContentsEntryRemovedMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public TableOfContentsEntryMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.PathFromRoot = (!SerializedPacket.IsNullPacket( p.PeekNextPart() )) ?
         SerializedPacket.DeserializeIntArray( p.PeekNextPart() ) : null; p.GetNextPart();
 }
 public DeckTraversalMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public InstructorMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.AcceptingStudentSubmissions = SerializedPacket.DeserializeBool( p.GetNextPart() );
     this.ForcingStudentNavigationLock = SerializedPacket.DeserializeBool( p.GetNextPart() );
     this.AcceptingQuickPollSubmissions = SerializedPacket.DeserializeBool( p.GetNextPart() );
     this.InstructorClockTicks = SerializedPacket.DeserializeInt64( p.GetNextPart() );
 }
 public PresentationInformationMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public PresentationEndedMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public PresentationMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
     this.HumanName = SerializedPacket.DeserializeString( p.GetNextPart() );
 }
 private BroadcastMessage deserialize( byte[] buf )
 {
     MemoryStream ms = new MemoryStream( buf );
     BroadcastMessage message = null;
     #if GENERIC_SERIALIZATION
     try {
         SerializedPacket p = new SerializedPacket( ms );
         message = (BroadcastMessage)PacketTypes.DecodeMessage(null, p);
     } catch( Exception e ) {
         Trace.WriteLine( e.ToString(), this.GetType().ToString() );
         return null;
     }
     #else
     BinaryFormatter bf = new BinaryFormatter();
     try {
         message = (BroadcastMessage)bf.Deserialize( ms );
     } catch( SerializationException se ) {
         Trace.WriteLine( "Failed to deserialize a BroadcastMessage: " + se.Message, this.GetType().ToString() );
         return null;
     } catch( Exception e ) {
         Trace.WriteLine( e.ToString(), this.GetType().ToString() );
         return null;
     }
     #endif
     return message;
 }
 public StudentMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public RoleMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public InstructorCurrentDeckTraversalChangedMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
Exemple #56
0
 public Group( SerializedPacket p )
 {
     SerializedPacket.VerifyPacket( p, this.GetClassId() );
     this.m_id = SerializedPacket.DeserializeGuid( p.GetPart( 0 ) );
     this.m_friendlyName = SerializedPacket.DeserializeString( p.GetPart( 1 ) );
 }
Exemple #57
0
 public SerializedPacket Serialize()
 {
     SerializedPacket p = new SerializedPacket( this.GetClassId() );
     p.Add( SerializedPacket.SerializeGuid( this.m_id ) );
     p.Add( SerializedPacket.SerializeString( this.m_friendlyName ) );
     return p;
 }
 public InstructorCurrentPresentationChangedMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public ExecuteScriptMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }
 public DeckTraversalRemovedFromPresentationMessage( Message parent, SerializedPacket p )
     : base(parent, p)
 {
 }