Esempio n. 1
0
        public static BridgeProfile Create(string ProfileFilePath)
        {
            using TextReader reader = File.OpenText(ProfileFilePath);
            IDeserializer     deserializer = new DeserializerBuilder().Build();
            BridgeProfileYaml yaml         = deserializer.Deserialize <BridgeProfileYaml>(reader);

            return(CreateFromBridgeProfileYaml(yaml));
        }
Esempio n. 2
0
 private static BridgeProfile CreateFromBridgeProfileYaml(BridgeProfileYaml yaml)
 {
     return(new BridgeProfile
     {
         Name = yaml.Name,
         Description = yaml.Description,
         MessageTransform = yaml.MessageTransform,
         ReadFormat = yaml.ReadFormat.TrimEnd('\n'),
         WriteFormat = yaml.WriteFormat.TrimEnd('\n')
     });
 }
Esempio n. 3
0
 private static BridgeProfile CreateFromBridgeProfileYaml(BridgeProfileYaml yaml)
 {
     return(new BridgeProfile
     {
         Name = yaml.Name,
         Description = yaml.Description,
         MessageTransform = yaml.MessageTransform,
         ReadFormat = yaml.ReadFormat.TrimEnd('\n').Replace("{DATA}", "{0}").Replace("{GUID}", "{1}"),
         WriteFormat = yaml.WriteFormat.TrimEnd('\n').Replace("{DATA}", "{0}").Replace("{GUID}", "{1}"),
         BridgeMessengerCode = yaml.BridgeMessengerCode.TrimEnd('\n')
     });
 }