示例#1
0
        /// <summary>
        /// Appends the access modifire of the member information to the log buffer.
        /// </summary>
        /// <param name="buff">the log buffer</param>
        /// <param name="memberInfo">the member information</param>
        /// <returns></returns>
        /// <since>1.5.0</since>
        protected override void AppendAccessModifire(LogBuffer buff, MemberInfo memberInfo)
        {
            switch (memberInfo)
            {
            case FieldInfo fieldInfo:
                if (!fieldInfo.IsPublic)
                {
                    if (fieldInfo.IsPrivate)
                    {
                        buff.Append("Private ");
                    }
                    else if (fieldInfo.IsFamily)
                    {
                        buff.Append("Protected ");
                    }
                    else if (fieldInfo.IsAssembly)
                    {
                        buff.Append("Friend ");
                    }
                    else if (fieldInfo.IsFamilyOrAssembly)
                    {
                        buff.Append("Protected Friend ");
                    }
                    else if (fieldInfo.IsFamilyAndAssembly)
                    {
                        buff.Append("Private Protected ");
                    }
                }
                break;

            case PropertyInfo propertyInfo:
                if (!propertyInfo.GetMethod?.IsPublic ?? false)
                {
                    if (propertyInfo.GetMethod?.IsPrivate ?? false)
                    {
                        buff.Append("Private ");
                    }
                    else if (propertyInfo.GetMethod?.IsFamily ?? false)
                    {
                        buff.Append("Protected ");
                    }
                    else if (propertyInfo.GetMethod?.IsAssembly ?? false)
                    {
                        buff.Append("Friend ");
                    }
                    else if (propertyInfo.GetMethod?.IsFamilyOrAssembly ?? false)
                    {
                        buff.Append("Protected Friend ");
                    }
                    else if (propertyInfo.GetMethod?.IsFamilyAndAssembly ?? false)
                    {
                        buff.Append("Private Protected ");
                    }
                }
                break;
            }
        }
示例#2
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, decimal value)
 {
     buff.Append(value).Append('D');
 }
示例#3
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, DateTime value)
 {
     buff.Append(string.Format(DateTimeFormat, value));
 }
示例#4
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, float value)
 {
     buff.Append(value).Append('F');
 }
示例#5
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, double value)
 {
     buff.Append(value);
 }
示例#6
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, long value)
 {
     buff.Append(value).Append('L');
 }
示例#7
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, ulong value)
 {
     buff.Append(value).Append("UL");
 }
示例#8
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, uint value)
 {
     buff.Append(value).Append('U');
 }
示例#9
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, ushort value)
 {
     buff.Append(value).Append("US");
 }
示例#10
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, short value)
 {
     buff.Append(value).Append('S');
 }
示例#11
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, char value)
 {
     buff.Append('"'); AppendChar(buff, value, '\'', true); buff.Append("\"c");
 }
示例#12
0
 /// <summary>
 /// Appends a string representation of the value to the log buffer.
 /// </summary>
 /// <param name="buff">the log buffer</param>
 /// <param name="value">the value</param>
 /// <returns></returns>
 protected override void Append(LogBuffer buff, bool value)
 {
     buff.Append(value ? "True" : "False");
 }