Exemple #1
0
        public void UpdateProtocol(Protocol sourceProtocol, Protocol targetProtocol)
        {
            //update protocol id so that they stay the same (copy object base properties)
            updateProtocolProperties(sourceProtocol, targetProtocol);

            //Structure change should only be propagated if the target is an advanced protocol
            var simpleProtocol   = sourceProtocol as SimpleProtocol;
            var advancedProtocol = targetProtocol as AdvancedProtocol;

            if (simpleProtocol == null)
            {
                return;
            }
            if (advancedProtocol == null)
            {
                return;
            }


            var schemas = _schemaMapper.MapFrom(simpleProtocol).ToList();

            if (!schemas.Any())
            {
                return;
            }

            advancedProtocol.RemoveAllSchemas();

            schemas.Each(advancedProtocol.AddSchema);
        }
Exemple #2
0
 public void Visit(SimpleProtocol simpleProtocol)
 {
     //we need to create a protocol according to the predefined schema
     fillSchemaItemListFrom(_simpleProtocolToSchemaMapper.MapFrom(simpleProtocol));
 }