Ejemplo n.º 1
0
        /// <summary>
        /// Deserializa os dados.
        /// </summary>
        /// <param name="reader"></param>
        void Serialization.ICompactSerializable.Deserialize(Serialization.IO.CompactReader reader)
        {
            if (reader.ReadBoolean())
            {
                this.Type = new TypeName();
                this.Type.Deserialize(reader);
            }
            ContractName = reader.ReadString();
            if (reader.ReadBoolean())
            {
                ContractType = new TypeName();
                ContractType.Deserialize(reader);
            }
            ImportingConstructor = reader.ReadBoolean();
            this.CreationPolicy  = (CreationPolicy)reader.ReadInt32();
            UseDispatcher        = reader.ReadBoolean();
            UIContext            = reader.ReadString();
            var count = reader.ReadInt32();

            Metadata = new Dictionary <string, object>(count);
            for (var i = 0; i < count; i++)
            {
                var key   = reader.ReadString();
                var value = reader.ReadObject();
                Metadata.Add(key, value);
            }
        }