Ejemplo 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));
        }
Ejemplo 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')
     });
 }
Ejemplo 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')
     });
 }