Файлы .yaml обрабатываются иначе, чем файлы .properties. Свойства
будут искать файл с активным профилем в имени:
application-dev.properties
application-prod.properties
.. .
файлы yaml, однако вы храните все профили в одном файле, разделенном символом '---'.
Пример [с использованием существующего docker-compose.yaml]:
application.yaml:
spring:
application:
your-application-name
[other global application settings]
...
---
spring:
profiles: dev
[other settings which apply only to dev environment]
---
spring:
profiles: prod
[all production settings (will overwrite other values if present]
public static bool IsInRuntimeMode( IComponent component ) {
bool ret = IsInDesignMode( component );
return !ret;
}
public static bool IsInDesignMode( IComponent component ) {
bool ret = false;
if ( null != component ) {
ISite site = component.Site;
if ( null != site ) {
ret = site.DesignMode;
}
else if ( component is System.Windows.Forms.Control ) {
IComponent parent = ( (System.Windows.Forms.Control)component ).Parent;
ret = IsInDesignMode( parent );
}
}
return ret;
}