Show / Hide Table of Contents

Class StackTracer

Utility class for collecting stack traces - useful when you want to make debugging easier by collecting run-time data on where your classes get called from. Enabled by EnableScaffolding AND EnableStackTracing, which default to FALSE (EnableStackTracing defaults to TRUE in DEBUG builds).

Inheritance
object
StackTracer
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public class StackTracer
Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

Properties

StackTrace

Utility class for collecting stack traces - useful when you want to make debugging easier by collecting run-time data on where your classes get called from. Enabled by EnableScaffolding AND EnableStackTracing, which default to FALSE (EnableStackTracing defaults to TRUE in DEBUG builds).

Declaration
public string[] StackTrace { get; }
Property Value
Type Description
string[]
Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

Methods

FormatTrace(StackTracer)

Return a formatted trace or the empty string

Declaration
public static string FormatTrace(StackTracer trace)
Parameters
Type Name Description
StackTracer trace

StackTracer object to format, or null

Returns
Type Description
string

Formatted trace or empty string

Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

GetStack()

Get one level from the stack directly above the caller's level

Declaration
public static StackTracer GetStack()
Returns
Type Description
StackTracer

StackTracer object containing the trace, or null if tracing is off

Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

GetStack(int)

Get one level from the stack, skipping a number of additional levels first

Declaration
public static StackTracer GetStack(int levelsToSkip)
Parameters
Type Name Description
int levelsToSkip

Number of levels to skip, 1 means your parent etc

Returns
Type Description
StackTracer

StackTracer object containing the trace, or null if tracing is off

Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

GetStack(int, int)

Get the given number of levels from the stack, skipping a number of additional levels first

Declaration
public static StackTracer GetStack(int levelsToSkip, int levelsToKeep)
Parameters
Type Name Description
int levelsToSkip

Number of levels to skip, 1 means your parent etc

int levelsToKeep

Number of levels to keep, will be limited to available. Specify -1 to get all.

Returns
Type Description
StackTracer

StackTracer object containing the trace, or null if tracing is off

Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

GetThreadDomainId()

Return a string with the AppDomain and Thread id's in a form suitable for debugging/console logging

Declaration
public static string GetThreadDomainId()
Returns
Type Description
string
Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

GetToLastSuperOffice()

Obtain a stack trace, from the current frame and back to the most-remote SuperOffice-assembly frame; plus one to show where we came from

Declaration
public static string GetToLastSuperOffice()
Returns
Type Description
string
Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

ToString()

Return the current stack levels as a single string, with newlines between levels

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()
Remarks

StackTracer has been implemented in the TableInfo base class, because it can be infuriatingly hard to discover who allocated a certain ContactTableInfo or whatever when you start getting unwanted cross joins. This example is taken from the TableInfo class:

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top