コード例 #1
0
        public static string GetDebugInfo(this IBase baseObject, StringBuilder additional = null)
        {
            var builder = new StringBuilder();

            if (CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowID) || CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowCondensedID))
            {
                builder.AppendFormat("{0}ID={1}{2}", CodeInterfaceExtensions.Prefix, baseObject.GetID(), CodeInterfaceExtensions.Suffix);
            }

            if (CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowName))
            {
                builder.AppendFormat("{0}Name={1}{2}", CodeInterfaceExtensions.Prefix, baseObject.Name, CodeInterfaceExtensions.Suffix);
            }

            if (CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowDatatype))
            {
                builder.Append(baseObject.GetDataTypeInfo());
            }

            if (CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowDescription))
            {
                builder.Append(baseObject.GetDesignComments());
            }

            if (CodeInterfaceExtensions.DebugInfoShowOptions.HasFlag(DebugInfoShowOptions.ShowModifiers))
            {
                builder.Append(baseObject.GetModifiersList());
            }

            builder.AppendFormat("{0}**********************************************{1}", CodeInterfaceExtensions.Prefix, CodeInterfaceExtensions.Suffix);

            if (additional != null)
            {
                builder.Append(additional.ToString());
            }

            return(builder.ToString());
        }