BACnet.Core.Network.RouterOptions.Clone C# (CSharp) Метод

Clone() публичный Метод

Creates an identical copy of this config object
public Clone ( ) : RouterOptions
Результат RouterOptions
        public RouterOptions Clone()
        {
            RouterOptions clone = new RouterOptions()
            {
                ProcessId = this.ProcessId
            };

            clone.PortNetworkMappings.AddRange(this.PortNetworkMappings);
            return clone;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Constructs a new Router instance
        /// </summary>
        public Router(RouterOptions options)
        {
            this._options = options.Clone();

            foreach (var mapping in _options.PortNetworkMappings)
            {
                _table.AddLocalRoute(mapping.Value, mapping.Key);
            }
        }