Пример #1
0
 /// <summary>
 ///     Compare two configurations.
 /// </summary>
 /// <param name="other">Other configuration.</param>
 /// <returns>Equals or not.</returns>
 protected bool Equals(
     WavesConfiguration other)
 {
     return(Equals(
                Properties,
                other.Properties));
 }
Пример #2
0
        /// <inheritdoc />
        public virtual Task SaveConfigurationAsync()
        {
            Configuration = new WavesConfiguration();

            var pluginType = GetType();
            var properties = pluginType.GetProperties();

            foreach (var property in properties)
            {
                var attributes = property.GetCustomAttributes(true);
                foreach (var attribute in attributes)
                {
                    if (!(attribute is WavesPropertyAttribute))
                    {
                        continue;
                    }

                    var name  = property.Name;
                    var value = property.GetValue(this);
                    Configuration.AddProperty(name, value);
                }
            }

            return(Task.CompletedTask);
        }
Пример #3
0
        /// <inheritdoc />
        public object Clone()
        {
            var configuration = new WavesConfiguration();

            foreach (var property in Properties)
            {
                configuration.Properties.Add((IWavesProperty)property.Clone());
            }

            return(configuration);
        }