AWSAppender.Core.PatternConverter.NamedPatternConverter.ActivateOptions C# (CSharp) Method

ActivateOptions() public method

Initialize the converter

This is part of the T:log4net.Core.IOptionHandler delayed object activation scheme. The M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions method must be called on this object after the configuration properties have been set. Until M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions is called this object is in an undefined state and must not be used.

If any of the configuration properties are modified then M:log4net.Layout.Pattern.NamedPatternConverter.ActivateOptions must be called again.

public ActivateOptions ( ) : void
return void
        public void ActivateOptions()
        {
            this.m_precision = 0;
            if (this.Option != null)
            {
                string text = this.Option.Trim();
                if (text.Length > 0)
                {
                    int num;
                    if (SystemInfo.TryParse(text, out num))
                    {
                        if (num == 0)
                        {
                            LogLog.Error(NamedPatternConverter.declaringType, "NamedPatternConverter: Precision option (" + text + ") is zero.");
                        }
                        else
                        {
                            this.m_precision = num;
                        }
                    }
                    else
                    {
                        LogLog.Error(NamedPatternConverter.declaringType, "NamedPatternConverter: Precision option \"" + text + "\" not a decimal integer.");
                    }
                }
            }
        }