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