Exemplo n.º 1
0
        public InterfaceDataRecord CreateInterfaceRepresentation(ModelInterface intfc)
        {
            if (intfc == null)
            {
                return(null);
            }
            InterfaceDataRecord raw = new InterfaceDataRecord(intfc.PersistentId);

            if (intfc is ModelInterface)
            {
                // Common parameters
                AddCommonInterfacePropertiesAsNVPairs(intfc, raw);
                raw.AddProperty(AgentKeys.AgentName, AgentId);    // mark it as mine
                raw.AddProperty(AgentKeys.VisaIntfType, VisaIntfTypeString);
            }

            // Unique parameters
            var specificIntfc = intfc as ModelInterfaceSample;

            if (specificIntfc != null)
            {
                AddInfoToInterface(raw, specificIntfc);
            }
            return(raw);
        }
Exemplo n.º 2
0
 private static void AddInfoToInterface(InterfaceDataRecord raw, ModelInterfaceSample specificIntfc)
 {
     raw.AddProperty(Consts.CONNECTION_TIMEOUT_KEY, specificIntfc.ConnectionTimeout.ToString());
     raw.AddProperty(Consts.BUS_ADDRESS_KEY, specificIntfc.BusAddress.ToString());
 }
Exemplo n.º 3
0
 private static void AddInfoToInterface(InterfaceDataRecord raw, ModelInterfaceSample specificIntfc)
 {
     raw.AddProperty(Consts.CONNECTION_TIMEOUT_KEY, specificIntfc.ConnectionTimeout.ToString());
     raw.AddProperty(Consts.BUS_ADDRESS_KEY, specificIntfc.BusAddress.ToString());
 }
Exemplo n.º 4
0
        public InterfaceDataRecord CreateInterfaceRepresentation(ModelInterface intfc)
        {
            if (intfc == null) return null;
            InterfaceDataRecord raw = new InterfaceDataRecord(intfc.PersistentId);

            if (intfc is ModelInterface)
            {
                // Common parameters
                AddCommonInterfacePropertiesAsNVPairs(intfc, raw);
                raw.AddProperty(AgentKeys.AgentName, AgentId);    // mark it as mine
                raw.AddProperty(AgentKeys.VisaIntfType, VisaIntfTypeString);
            }

            // Unique parameters
            var specificIntfc = intfc as ModelInterfaceSample;
            if (specificIntfc != null)
            {
                AddInfoToInterface(raw, specificIntfc);
            }
            return raw;
        }