You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Make it immutable, so only changes made through Configure() persist.
This prevents someone (or us) from grabbing the config, tweaking it or passing
it to a FlurlClient and having that accidentally alter the global config.
* Consolidate all configuration into the OpenStackNetConfigurationOptions.
Handle json.net, flurl and the sdk.
* Deprecate Configure(), it doesn't need to be called anymore.
* Deprecate Configure(flurlSettings, sdkSettings), we will respect it for now
but it's gone in 2.0.
/// Provides thread-safe accesss to OpenStack.NET's global configuration options.
40
-
/// <para>
41
-
/// Can only be called once at application start-up, before instantiating any OpenStack.NET objects.
42
-
/// </para>
39
+
/// <para>DEPRECATED. This no longer needs to be explicityly called, unless you require customizations. In that case, use <see cref="Configure(Action{OpenStackNetConfigurationOptions})"/> .</para>
40
+
/// Initializes the SDK using the default configuration.
41
+
/// </summary>
42
+
[Obsolete("This will be removed in v2.0. Use Configure(Action{OpenStackNetConfigurationOptions}) instead if you need to customize anything.")]
43
+
publicstaticvoidConfigure()
44
+
{
45
+
Configure(null);
46
+
}
47
+
48
+
/// <summary>
49
+
/// <para>Provides thread-safe accesss to OpenStack.NET's global configuration options.</para>
50
+
/// <para>Can only be called once at application start-up, before instantiating any OpenStack.NET objects.</para>
51
+
/// </summary>
52
+
/// <param name="configure">Additional configuration of OpenStack.NET's global settings.</param>
Trace.TraceError("Ignoring additional call to OpenStackNet.Configure. It can only be called once at application start-up, before instantiating any OpenStack.NET objects.");
72
+
// Check if a user is attempting to apply custom configuration after the default config has been applied
73
+
if(configureFlurl!=null||configure!=null)
74
+
Trace.TraceError("Ignoring additional call to OpenStackNet.Configure. It can only be called once at application start-up, before instantiating any OpenStack.NET objects.");
75
+
54
76
return;
55
77
}
56
78
57
-
configure?.Invoke(_config);
58
-
ConfigureFlurl(configureFlurl);
59
-
79
+
// TODO: Use the line below once we hit 2.0 and configureFlurl is deprecated
80
+
// _config = new OpenStackNetConfigurationOptions(configure);
/// Resets all configuration (OpenStack.NET, Flurl and Json.NET) so that <see cref="Configure"/> can be called again.
91
+
/// Resets all configuration (OpenStack.NET, Flurl and Json.NET) so that <see cref="Configure(Action{OpenStackNetConfigurationOptions})"/> can be called again.
/// A set of properties that affect OpenStack.NET's behavior.
173
-
/// <para>Generally set via the static <see cref="OpenStack.OpenStackNet.Configure"/> method.</para>
146
+
/// A readonly set of properties that affect OpenStack.NET's behavior.
147
+
/// <para>To configure, pass a custom action via the static <see cref="OpenStackNet.Configure(Action{OpenStackNetConfigurationOptions})"/> method.</para>
0 commit comments