public GetForeignKeyRelationsResponseMessage(Guid requestID, ForeignKeyRelation[] foreignKeyRelations, Exception exception)
 {
     if (foreignKeyRelations == null)
         throw new ArgumentNullException ("foreignKeyRelations");
     this.requestID = requestID;
     this.foreignKeyRelations = foreignKeyRelations;
     this.exception = exception;
 }
        public static ObjectBusMessage Deserialize(byte[] bytes)
        {
            Guid requestID;

            ForeignKeyRelation[] foreignKeyRelations;
            Exception            exception;

            using (System.IO.MemoryStream MS = new System.IO.MemoryStream(bytes, false)) {
                using (System.IO.BinaryReader BR = new System.IO.BinaryReader(MS)) {
                    requestID           = new Guid(BR.ReadBytes(16));
                    foreignKeyRelations = new ForeignKeyRelation[BR.ReadInt32()];
                    for (int n = 0; n != foreignKeyRelations.Length; n++)
                    {
                        foreignKeyRelations [n] = ForeignKeyRelation.Deserialize(BR.ReadBytes(BR.ReadInt32()));
                    }
                    if (MS.ReadByte() == 1)
                    {
                        System.Runtime.Serialization.Formatters.Binary.BinaryFormatter BF = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                        object deserializedObject = BF.Deserialize(MS);
                        if (deserializedObject is Exception)
                        {
                            exception = (Exception)deserializedObject;
                        }
                        else
                        {
                            throw new Exception("buffer contains an object of invalid type, expected System.Exception.");
                        }
                    }
                    else
                    {
                        exception = null;
                    }
                    return(new GetForeignKeyRelationsResponseMessage(requestID, foreignKeyRelations, exception));
                }
            }
        }
Esempio n. 3
0
 public void AddForeignKeyRelation(ForeignKeyRelation foreignKeyRelation)
 {
 }
 public void AddForeignKeyRelation(ForeignKeyRelation foreignKeyRelation)
 {
 }