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); }
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()); }
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()); }
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; }