Name | Modifier | Summary |
+AssertNotDisposed(string) | protected | Throws an System.ObjectDisposedException when the current object is disposed |
Dispose() | public | Dispose the object |
Dispose(bool) | protected | Internal implementation of dispose - free the managed and native resources using the respective methods |
DisposeManaged() | protected | Dispose any disposable managed fields or properties. |
@@ -3118,14 +3200,36 @@ Methods
Go to namespaces or types or source-only packages
+ BaseDisposable.DisposedFlag Constant
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: BaseDisposable
+Sources: utils\BaseDisposable.cs
+Source-only packages: RadCommons.utils.BaseDisposable
+Internal flag whether the object is fully disposed
+private const int DisposedFlag = 1
+Field value
- int
+Go to namespaces or types or source-only packages
+
+ BaseDisposable.isDisposed Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: BaseDisposable
+Sources: utils\BaseDisposable.cs
+Source-only packages: RadCommons.utils.BaseDisposable
+The object is disposed when equals to DisposedFlag
+private int isDisposed
+Field value
- int
+Go to namespaces or types or source-only packages
+
BaseDisposable.Disposed Property
Namespace: net.adamec.lib.common.utils
Assembly: net.adamec.lib.common
Type: BaseDisposable
Sources: utils\BaseDisposable.cs
Source-only packages: RadCommons.utils.BaseDisposable
-Flag whether the object is fully disposed
-public bool Disposed { get; private set; }
+Returns
true
when the object is fully disposed
+public bool Disposed { get; }
Property value
- bool
Go to namespaces or types or source-only packages
@@ -3135,7 +3239,7 @@ Flag whether the managed resources are disposed
+Returns
true
when the managed resources are disposed
public bool DisposedManaged { get; private set; }
Property value
- bool
Go to namespaces or types or source-only packages
@@ -3146,7 +3250,7 @@ Flag whether the native resources are disposed
+Returns
true
when the native resources are disposed
public bool DisposedNative { get; private set; }
Property value
- bool
Go to namespaces or types or source-only packages
@@ -3160,6 +3264,20 @@ Name | Value | Summary |
+ContextDisposedMessage | Current context has been disposed | Error message that will be put into the exception when there will be any operation on the disposed context. |
+
+
+ Fields
+Name | Modifier | Summary |
+contextState | private | State managed by the context. |
+Local | private static | The context holder that is local to the calling asynchronous control flow. |
+parentContext | private | Parent context. |
+
+
+ Properties
+Name | Modifier | Summary |
+Current | public static | Gets the current context. |
+Disposer | private | Gets the disposer associated with this container. |
+Parent | public | Gets the parent scope. |
+State | protected | Gets the state managed by the context. |
+
+
+ Constructors
+
+
+ Methods
+
+
+Go to namespaces or types or source-only packages
+
+ Context<TState>.ContextDisposedMessage Constant
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Error message that will be put into the exception when there will be any operation on the disposed context.
+private const string ContextDisposedMessage = "Current context has been disposed"
+Field value
- string
+Go to namespaces or types or source-only packages
+
+ Context<TState>.contextState Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+State managed by the context.
+private readonly Context<TState>.TState contextState
+Field value
- net.adamec.lib.common.utils.Context<TState>.TState
+Go to namespaces or types or source-only packages
+
+ Context<TState>.Local Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+The context holder that is local to the calling asynchronous control flow.
+private static readonly AsyncLocal<net.adamec.lib.common.utils.Context<TState>> Local
+Field value
- System.Threading.AsyncLocal<net.adamec.lib.common.utils.Context<TState>>
+Go to namespaces or types or source-only packages
+
+ Context<TState>.parentContext Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Parent context.
+private readonly Context<TState> parentContext
+Field value
- net.adamec.lib.common.utils.Context<TState>
+Go to namespaces or types or source-only packages
+
+ Context<TState>.Current Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Gets the current context.
+public static Context<TState> Current { get; private set; }
+Property value
- net.adamec.lib.common.utils.Context<TState>
+Go to namespaces or types or source-only packages
+
+ Context<TState>.Disposer Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Gets the disposer associated with this container.
+private Disposer Disposer { get; }
+Property value
- net.adamec.lib.common.utils.Disposer
+Go to namespaces or types or source-only packages
+
+ Context<TState>.Parent Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Gets the parent scope.
+public Context<TState> Parent { get; }
+Property value
- net.adamec.lib.common.utils.Context<TState>
+ Exceptions
+- System.ObjectDisposedException
- The current context has been disposed.
+Go to namespaces or types or source-only packages
+
+ Context<TState>.State Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Gets the state managed by the context.
+protected Context<TState>.TState State { get; }
+Property value
- net.adamec.lib.common.utils.Context<TState>.TState
+ Exceptions
+- System.ObjectDisposedException
- The current context has been disposed.
+Go to namespaces or types or source-only packages
+
+ Context<TState>.Context<TState>(Context<TState>.TState) Constructor
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Creates an instance of Context<TState> and initialize its Disposer . The new context will become Current and the previous one its Parent .
+protected Context<TState>(Context<TState>.TState state = null)
+Constructor parameters- net.adamec.lib.common.utils.Context<TState>.TState state
- Optional state managed by the context.
+Go to namespaces or types or source-only packages
+
+ Context<TState>.AddToDisposer(IDisposable) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Adds the disposable object to the context disposer, so it will be disposed with the context
+protected void AddToDisposer(IDisposable disposable)
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value
- void
+ Exceptions
+- System.ArgumentNullException
- disposable is null.
- System.ObjectDisposedException
- The current context has been disposed.
+Go to namespaces or types or source-only packages
+
+ Context<TState>.BeginContext(Context<TState>.TState) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Creates a new Context<TState> within the context chain. The new context will become Current and the previous one its Parent .
+public static IDisposable BeginContext(Context<TState>.TState state = null)
+Method parameters- net.adamec.lib.common.utils.Context<TState>.TState state
- Optional state managed by the context.
+Return value
- IDisposable
+Go to namespaces or types or source-only packages
+
+ Context<TState>.DisposeManaged() Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Context<TState>
+Sources: utils\Context.cs
+Source-only packages: RadCommons.utils.Context
+Dispose any disposable managed objects - all disposables kept in Disposer stack are pop and disposed.
The Parent context of the disposing one will become the new Current context.
+protected override void DisposeManaged()
+Return value
- void
Overrides: BaseDisposable.DisposeManaged()
+Go to namespaces or types or source-only packages
+
+ Disposer Class
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Sources: utils\Disposer.cs
+Source-only packages: RadCommons.utils.Disposer
+Keeps the stack of disposable objects, and disposes them when the disposer is being disposed.
+internal class Disposer : BaseDisposable
+Inheritance: object -> net.adamec.lib.common.utils.BaseDisposable
+Implements: IDisposable
+ Fields
+
+
+ Methods
+Name | Modifier | Summary |
+Add(IDisposable) | public | Adds the disposable object to the disposer. |
+Dispose(bool) | protected | Internal implementation of dispose - free the managed and native resources. |
+
+
+Go to namespaces or types or source-only packages
+
+ Disposer.disposables Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Disposer
+Sources: utils\Disposer.cs
+Source-only packages: RadCommons.utils.Disposer
+Stack of disposables kept by the Disposer .
+private Stack<IDisposable> disposables
+Field value
- Stack<IDisposable>
+Go to namespaces or types or source-only packages
+
+ Disposer.lockObj Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Disposer
+Sources: utils\Disposer.cs
+Source-only packages: RadCommons.utils.Disposer
+Lock object
+private readonly object lockObj
+Field value
- object
+Go to namespaces or types or source-only packages
+
+ Disposer.Add(IDisposable) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Disposer
+Sources: utils\Disposer.cs
+Source-only packages: RadCommons.utils.Disposer
+Adds the disposable object to the disposer.
+public void Add(IDisposable disposable)
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value
- void
+ Exceptions
+- System.ArgumentNullException
- disposable is null.
+Go to namespaces or types or source-only packages
+
+ Disposer.Dispose(bool) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Disposer
+Sources: utils\Disposer.cs
+Source-only packages: RadCommons.utils.Disposer
+Internal implementation of dispose - free the managed and native resources.
+protected override void Dispose(bool disposing)
+Method parameters- bool disposing
- True to dispose both managed and native resources, false to dispose the native resources only.
+Return value
- void
Overrides: BaseDisposable.Dispose(bool)
+ Remarks
+When disposing the managed objects ( disposing is true), all disposables kept in disposables stack are pop and disposed.
+Go to namespaces or types or source-only packages
+
FileUtils Class
Namespace: net.adamec.lib.common.utils
Assembly: net.adamec.lib.common
@@ -3950,6 +4327,221 @@ bool isErrorstring output
Go to namespaces or types or source-only packages
+ Scope<TState> Class
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Base scope implementation.
+internal class Scope<TState> : BaseDisposable, IScope<TState> where TState: class, new()
+Type parameters- TState
- Type of the state object managed by the scope
+Inheritance: object -> net.adamec.lib.common.utils.BaseDisposable
+Implements: net.adamec.lib.common.utils.IScope<TState>, IDisposable
+ Remarks
+The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested, when the scope is disposed, the children are disposed as well. There can be multiple child scopes (siblings) living in parallel. The AddToDisposer(IDisposable) method is to be used in inherited classes whenever they manage any disposable resource to ensure the proper life time (when the State is System.IDisposable , it's added to disposer automatically).
The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the Scope<TState> (and IScope<TState> ) to add the scope related operations (inherited classes have the access to State ).
+ Constants
+Name | Value | Summary |
+ScopeDisposedMessage | The scope has been disposed | Error message that will be put into the exception when there will be any operation on the disposed scope. |
+
+
+ Fields
+
+
+ Properties
+Name | Modifier | Summary |
+Disposer | private | Gets the disposer associated with this container. |
+Parent | public | Gets the parent scope. |
+Root | public static | Gets the root scope. |
+State | protected | Gets the state managed by the scope. |
+
+
+ Constructors
+
+
+ Methods
+
+
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.parentScope Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Parent scope.
+private readonly IScope<TState> parentScope
+Field value
- net.adamec.lib.common.utils.IScope<TState>
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.RootInternal Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Instance of the Scope<TState> created when the singleton is first touched - root scope with default State
+private static readonly Scope<TState> RootInternal
+Field value
- net.adamec.lib.common.utils.Scope<TState>
+ Remarks
+Not using the auto-property to have better control, when the instance is created
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.ScopeDisposedMessage Constant
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Error message that will be put into the exception when there will be any operation on the disposed scope.
+private const string ScopeDisposedMessage = "The scope has been disposed"
+Field value
- string
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.scopeState Field
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+State managed by the scope.
+private readonly Scope<TState>.TState scopeState
+Field value
- net.adamec.lib.common.utils.Scope<TState>.TState
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Disposer Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Gets the disposer associated with this container.
+private Disposer Disposer { get; }
+Property value
- net.adamec.lib.common.utils.Disposer
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Parent Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Gets the parent scope.
+public IScope<TState> Parent { get; }
+Property value
- net.adamec.lib.common.utils.IScope<TState>
Implements: IScope<TState>.Parent
+ Exceptions
+- System.ObjectDisposedException
- The current scope has been disposed.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Root Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Gets the root scope.
+public static Scope<TState> Root { get; }
+Property value
- net.adamec.lib.common.utils.Scope<TState>
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.State Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Gets the state managed by the scope.
+protected Scope<TState>.TState State { get; }
+Property value
- net.adamec.lib.common.utils.Scope<TState>.TState
+ Exceptions
+- System.ObjectDisposedException
- The current scope has been disposed.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Scope<TState>() Constructor
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Static constructor
+private static Scope<TState>()
+ Remarks
+Explicit static constructor to tell C# compiler not to mark type as beforefieldinit
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Scope<TState>(IScope<TState>, Scope<TState>.TState) Constructor
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Creates an instance of child Scope<TState> .
+protected Scope<TState>(IScope<TState> parent, Scope<TState>.TState state = null)
+Constructor parameters- net.adamec.lib.common.utils.IScope<TState> parent
- Parent scope
- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the scope.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.Scope<TState>(Scope<TState>.TState) Constructor
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Creates an instance of Scope<TState> and initialize its Disposer .
+private Scope<TState>(Scope<TState>.TState state = null)
+Constructor parameters- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the scope.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.AddToDisposer(IDisposable) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Adds the disposable object to the scope disposer, so it will be disposed with the scope
+protected void AddToDisposer(IDisposable disposable)
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value
- void
+ Exceptions
+- System.ArgumentNullException
- disposable is null.
- System.ObjectDisposedException
- The current scope has been disposed.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.BeginScope(Scope<TState>.TState) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Creates a child scope of the current scope.
+public IScope<TState> BeginScope(Scope<TState>.TState state = null)
+Method parameters- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the child scope..
+Return value
- net.adamec.lib.common.utils.IScope<TState>
- Child scope owned by the current scope.
Implements: IScope<TState>.BeginScope(IScope<TState>.TState)
+ Exceptions
+- System.ObjectDisposedException
- The current scope has been disposed.
+Go to namespaces or types or source-only packages
+
+ Scope<TState>.DisposeManaged() Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: Scope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Dispose any disposable managed objects - all disposables kept in Disposer stack are pop and disposed.
+protected override void DisposeManaged()
+Return value
- void
Overrides: BaseDisposable.DisposeManaged()
+Go to namespaces or types or source-only packages
+
Txt Class
Namespace: net.adamec.lib.common.utils
Assembly: net.adamec.lib.common
@@ -4185,6 +4777,51 @@ string
Go to namespaces or types or source-only packages
+ IScope<TState> Interface
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Scope interface.
+internal interface IScope<in TState> : IDisposable where TState: class, new()
+Type parameters- TState
- Type of the state object managed by the scope
+Implemented by: net.adamec.lib.common.utils.Scope<TState>
+Implements: IDisposable
+ Properties
+Name | Modifier | Summary |
+Parent | public abstract | Gets the parent scope. |
+
+
+ Methods
+
+
+Go to namespaces or types or source-only packages
+
+ IScope<TState>.Parent Property
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: IScope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Gets the parent scope.
+public abstract IScope<TState> Parent { get; }
+Property value
- net.adamec.lib.common.utils.IScope<TState>
+Go to namespaces or types or source-only packages
+
+ IScope<TState>.BeginScope(IScope<TState>.TState) Method
+Namespace: net.adamec.lib.common.utils
+Assembly: net.adamec.lib.common
+Type: IScope<TState>
+Sources: utils\Scope.cs
+Source-only packages: RadCommons.utils.Scope
+Creates a child scope of the current scope.
+public abstract IScope<TState> BeginScope(IScope<TState>.TState state)
+Method parameters- net.adamec.lib.common.utils.IScope<TState>.TState state
- State managed by the child scope.
+Return value
- net.adamec.lib.common.utils.IScope<TState>
- Child scope owned by the current scope.
+Go to namespaces or types or source-only packages
+
ProcessEventHandler Delegate
Namespace: net.adamec.lib.common.utils
Assembly: net.adamec.lib.common
@@ -4224,6 +4861,8 @@ RadCommon
Simple configuration container in case DI with more sophisticated containers is not used. Supports the JSON config files, command line arguments
and environment variables as sources and their hierarchy/overrides. The configuration can be used as key-value pairs or bound to objects (Source only package).
Usings
- RadCommons.logging.CommonLogging
+ Remarks
+This is the simple configuration container in case DI with more sophisticated containers is not used The configuration is stored as the key-value dictionary, supporting hierarchy using the dot separator and arrays.The arrays can contain values or another objects. Actually, mixed arrays of values and objects can be stored, but they are not supported for binding.
For example section1.option1
means the option1 available in section1, section1.subSection2.option1
means the option1 available in section1.subSection2. section1.option1[0]
means, that the option1 is array of values or objects (sections) within the section1. For arrays, the keys are like OtherSection.SimpleArray[0]
or OtherSection.ComplexObjectArray[0].Name
Configuration class provides a singleton instance, however the key functionality is provided via static functions, so no need to touch the Instance at all. The items can be retrieved by key using the Get(string) and Get<TValueType>(string, Configuration.TValueType) methods. The first one returns null when the key is not found, the other one allow to define the default value to be returned, when the item is not found.
The inner class Configuration.ConfigurationBuilder provides the methods to build the configuration from JSON config files, commandline arguments, environment values and/or direct entries. The static method Builder() clears the configuration items and binding cache and creates a new instance of Configuration.ConfigurationBuilder allowing to build a configuration from scratch. The configuration is updated directly during the calls to builder methods, the existing items (keys) are updated, so it's possible to manage the priority of individual sources and the overrides if needed. The method Build() returns the configuration instance, breaking the fluent design of builder methods, however there is no other functionality within the method, so it's more the convention than need to use it at the end of configuration build.
Configuration binding it the way, how to access the configuration using the configuration objects instead of querying the individual items by key. When the method Bind<TOptionsContainer>(string, bool) is used, it creates a new instance of given type and tries to map the public properties with public setter to the keys (using the "dot notation") within the Configuration . It's possible to bind the object to to the root of the configuration to provide the whole configuration at once or bind it to the particular section to provide a configuration sub-tree. In general, the nested objects and both value and object arrays are supported. There are some rules when binding the arrays: The index must start with zero and must be in sequence (the first non-existing index stops the evaluation). The array should not mix the array or values and array of objects. The decision is made at the first item (index=0) whether it's value or object.
The implementation of binding treats the System.Boolean values the special way - if there is no value, but existing key, the value is converted to true. This is useful when the command line arguments are used like flags. For example having the argument -p:SkipStep1
and prefix -p:
, the binding a bool property SkipStep1
will set the value of the property to true
(doesn't change the configuration item itself). Of course, it's still possible to use the syntax -p:SkipStep1=true
or -p:SkipStep1=false
even in this case.
As the binding uses the reflection, it's quite expensive operation, so by default, the bound objects are cached (the cache key is the type of bound object, so binding the same type to different sections is not recommended ). It's possible to force the binding using the parameter of Bind<TOptionsContainer>(string, bool) method. In general, the recommended pattern is to Bind<TOptionsContainer>(string, bool) the configuration object after the configuration is built and then Retrieve<TOptionsContainer>() it from the cache when needed.
Package members
- Configuration (Type)
- Singleton holding the application configuration (options)
- instance (Field)
- Instance of the Configuration created when the singleton is first touched
- Instance (Property)
- Public Configuration instance
- Configuration() (Method)
- Static constructor
- Configuration() (Method)
- Private constructor used to build the singleton instance
- Items (Property)
- Configuration items stored as key-value pairs
- Get(string) (Method)
- Gets the configuration item by key
- Get<TValueType>(string, Configuration.TValueType) (Method)
- Gets the typed configuration item by key . Returns the default value, that can be provided or is default to given TValueType The function tries to convert the value to TValueType using System.Convert.ChangeType(System.Object,System.Type) if the conversion is not successful, the default is returned.
- bindingsCache (Field)
- Cache for bindings. Dictionary of type bound as a key and the bound object as value.
- Bind<TOptionsContainer>(string, bool) (Method)
- Binds the configuration to given TOptionsContainer type and returns the bound object of such type. The resulting configuration object is stored to the cache and can be later on retrieved using Retrieve<TOptionsContainer>()
- Retrieve<TOptionsContainer>() (Method)
- Retrieves the configuration object of given TOptionsContainer that has been bound and cached before. The new instance of TOptionsContainer is created when the type not found in cache
- Bind(Type, string) (Method)
- Creates a new object with given type and binds the configuration to its public properties where possible.
- GetSection(string) (Method)
- Gets the configuration sub-tree that belongs to given section. The keys returned are relative to given section! When the section is not provided, the whole configuration tree is returned.
- TryConvertValue(Type, object, object) (Method)
- Tries to convert sourceValue to targetType . The converted values is returned in targetValue out parameter, the result of conversion is the function return value.
- AddOrUpdateItem(string, object) (Method)
- Add a new configuration item with given value or updates its value if the key already exists.
- Builder() (Method)
- Clears the configuration items and binding cache and creates a new instance of Configuration.ConfigurationBuilder
- Configuration.ConfigurationBuilder (Type)
- Configuration builder providing the methods for adding the configuration items from individual sources
- Build() (Method)
- Finishes the configuration building and returns the Instance
- Add(string, object) (Method)
- Add a new configuration item with given value or updates its value if the key already exists.
- AddEnvironmentVariables() (Method)
- Adds all environment variables into the Configuration . When a configuration item exists, the value is updated.
- AddCommandLineArguments(string[]) (Method)
- Adds the command line arguments starting with prefixes into the Configuration . When a configuration item exists, the value is updated.
- AddJsonFile(string, bool, bool) (Method)
- Loads the configuration items from JSON file, keeping the hierarchy of JSON objects (and arrays) When a configuration item exists, the value is updated.
Sources
- config\Configuration.cs
Go to namespaces or types or source-only packages
@@ -4261,6 +4900,15 @@ RadCommons.di.Post
Sources
- di\postinit\_SourceOnlyPackage.cs
- di\postinit\ContainerBuilderExtensions.cs
- di\postinit\PostInitAttribute.cs
Go to namespaces or types or source-only packages
+ RadCommons.extensions.ArrayExtensions.ConcatenateBytes Source only package
+Tags: RadCommons source-only extension array
+Includes: None
+Declaring file: extensions\ArrayExtensionsAppendBytes.cs
+Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one) (Source only package).
+Package members
- ArrayExtensions (Type)
- Array extensions
- AppendBytes(byte[], byte[]) (Method)
- Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one)
+Sources
- extensions\ArrayExtensionsAppendBytes.cs
+Go to namespaces or types or source-only packages
+
RadCommons.extensions.ArrayExtensions.Fill Source only package
Tags: RadCommons source-only extension array
Includes: None
@@ -4348,8 +4996,35 @@ RadCommo
Declaring file: logging\_SourceOnlyPackage.cs
RadCommons logging wrapper around NLog with some extended functionality (Source only package).
References needed
- NLog
-Package members
- CommonLogging (Type)
- ILogger factory
- CreateLogger(string) (Method)
- Creates the logger with given categoryName
- CreateLogger(Type) (Method)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- CreateLogger<T>() (Method)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- Trace(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Trace
level. - Debug(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Debug
level. - Info(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Info
level. - Warn(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - Warn(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - ErrorPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Error
level and returns given exception - FatalPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns given exception - Error<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Error
level. Creates and returns the exception of given type - Fatal<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type - ErrorFltr<TException>(ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltr<TException>(ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - TraceCorr(string, string) (Method)
- Writes the diagnostic message at the
Trace
level with correlation ID. - DebugCorr(string, string) (Method)
- Writes the diagnostic message at the
Debug
level with correlation ID. - InfoCorr(string, string) (Method)
- Writes the diagnostic message at the
Info
level with correlation ID. - WarnCorr(string, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - WarnCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - ErrorCorr<TException>(string, ILogger.TException, string) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalCorr<TException>(string, ILogger.TException, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns the exception of given type - ErrorCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. Creates and returns the exception of given type - FatalCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. Creates and returns the exception of given type - ErrorFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - LoggerExt (Type)
- ILogger extensions
- Trace(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Trace
level. - Debug(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Debug
level. - Info(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Info
level. - Warn(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - Warn(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - ErrorPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Error
level and returns given exception - FatalPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns given exception > - Error<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Error
level. Creates and returns the exception of given type - Fatal<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type - CreateException<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type - ErrorFltr<TException>(LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltr<TException>(LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - TraceCorr(string, string) (Method)
- Writes the diagnostic message at the
Trace
level with correlation ID - DebugCorr(string, string) (Method)
- Writes the diagnostic message at the
Debug
level with correlation ID. - InfoCorr(string, string) (Method)
- Writes the diagnostic message at the
Info
level with correlation ID. - WarnCorr(string, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - WarnCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - ErrorCorr<TException>(string, LoggerExt.TException, string) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalCorr<TException>(string, LoggerExt.TException, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns the exception of given type - ErrorCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. Creates and returns the exception of given type - FatalCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. Creates and returns the exception of given type - ErrorFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - LogIt(LogLevel, string, Exception) (Method)
- Writes the item (message with optional exception) into the log
- LogIt(LogLevel, string, string, Exception) (Method)
- Writes the item (message with optional exception) with correlation Id into the log
- LogIt(LogLevel, Dictionary<string,object>, string, Exception) (Method)
- Writes the item (message with optional event properties and exception) into the log
-Sources
- logging\_SourceOnlyPackage.cs
- logging\CommonLogging.cs
- logging\ILogger.cs
- logging\LoggerExt.cs
+ Remarks
+The NLog supports having additional (custom) event properties provided to loggers and optionally rendered to logs. The event properties are represented as key-value dictionary, where key is the unique name of the property.
Extended logger provides following methods to log with given set of the properties.
+
+- Trace(Dictionary<string,object>, string) ,
- Debug(Dictionary<string,object>, string) ,
- Info(Dictionary<string,object>, string) ,
- Warn(Dictionary<string,object>, string) ,
- Error(Dictionary<string,object>, string) ,
- Fatal(Dictionary<string,object>, string) ,
- Warn(Dictionary<string,object>, Exception, string) ,
- Error(Dictionary<string,object>, Exception, string) and
- Fatal(Dictionary<string,object>, Exception, string)
+
+ Sometimes, it's useful to have an exception logging method implemented as the operation returning the exception being logged. The ErrorPassThrough(Exception, string) and FatalPassThrough(Exception, string) methods will log given exception and return it for further processing.
try
+ {
+ ...
+ }
+ catch (Exception ex){
+ if(logger.ErrorPassThrough(ex) is MyException){
+ return null;
+ }else{
+ throw;
+ }
+ }
In the example above, the exception is always logged and then the decision/action is taken. C# 6 brought the exception filters that don't unwind the stack as the exception is not catch yet when processing the filter. It can also be used for logging the exceptions without actually catching them (when the exception filter returns false
). Extended logger provides functions ErrorFltr<TException>(ILogger.TException, string, bool) and FatalFltr<TException>(ILogger.TException, string, bool) for this purpose.
try
+ {
+ ...
+ }
+ catch (Exception ex) when (logger.ErrorFltr(ex,"Error here!"){
+ //newer called as the default return value of ErrorFltr is false
+ }
The example above logs but never catch all exceptions. The following code catch and log the ArgumentException and logs any other exception without catching it. try
+ {
+ ...
+ }
+ catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) { ... }
+ catch (Exception e) when (Logger.FatalFltr(e)) {}
Logger can also create and exception, log it and return using functions Error<TException>(string, Exception) and Fatal<TException>(string, Exception)
if(value is null) throw logger.Fatal<ArgumentNullException>("Value is null");
When logging an exception using the LoggerExt methods, the event property StackTrace
is set from System.Exception.StackTrace , when the logger creates an exception, the property is set using new StackTrace(2, true).ToString()
. In other cases when the System.Exception.StackTrace is null or empty, new StackTrace(true).ToString()
is used.
LoggerExt also provides set of methods for logging with the correlation ID (for example in integration scenarios), where the given correlation ID is set to the event property CorrelationId
. Such methods have the name ending with Corr
suffix.
+Package members
- CommonLogging (Type)
- ILogger factory
- CreateLogger(string) (Method)
- Creates the logger with given categoryName
- CreateLogger(Type) (Method)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- CreateLogger<T>() (Method)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- TraceCorr(string, string) (Method)
- Writes the diagnostic message at the
Trace
level with correlation ID. - DebugCorr(string, string) (Method)
- Writes the diagnostic message at the
Debug
level with correlation ID. - InfoCorr(string, string) (Method)
- Writes the diagnostic message at the
Info
level with correlation ID. - WarnCorr(string, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - WarnCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - ErrorCorr<TException>(string, ILogger.TException, string) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalCorr<TException>(string, ILogger.TException, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns the exception of given type - ErrorCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. Creates and returns the exception of given type - FatalCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. Creates and returns the exception of given type - ErrorFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- Trace(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Trace
level. - Debug(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Debug
level. - Info(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Info
level. - Warn(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - Warn(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- ErrorFltr<TException>(ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltr<TException>(ILogger.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - ILogger (Type)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- ErrorPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Error
level and returns given exception - FatalPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns given exception - Error<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Error
level. Creates and returns the exception of given type - Fatal<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type - LoggerExt (Type)
- Extended logger implementing ILogger
- TraceCorr(string, string) (Method)
- Writes the diagnostic message at the
Trace
level with correlation ID - DebugCorr(string, string) (Method)
- Writes the diagnostic message at the
Debug
level with correlation ID. - InfoCorr(string, string) (Method)
- Writes the diagnostic message at the
Info
level with correlation ID. - WarnCorr(string, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - WarnCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level with correlation ID. - ErrorCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. - FatalCorr(string, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. - ErrorCorr<TException>(string, LoggerExt.TException, string) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalCorr<TException>(string, LoggerExt.TException, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns the exception of given type - ErrorCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Error
level with correlation ID. Creates and returns the exception of given type - FatalCorr<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level with correlation ID. Creates and returns the exception of given type - ErrorFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - LogIt(LogLevel, string, string, Exception, string) (Method)
- Writes the item (message with optional exception) with correlation Id into the log
- LoggerExt (Type)
- Extended logger implementing ILogger
- CreateException<TException>(string, string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type - LogIt(LogLevel, string, Exception, string) (Method)
- Writes the item (message with optional exception) into the log
- LogIt(LogLevel, Dictionary<string,object>, string, Exception, string) (Method)
- Writes the item (message with optional event properties and exception) into the log
- LoggerExt (Type)
- Extended logger implementing ILogger
- Trace(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Trace
level. - Debug(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Debug
level. - Info(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Info
level. - Warn(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - Warn(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Warn
level. - Error(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Error
level. - Fatal(Dictionary<string,object>, Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level. - LoggerExt (Type)
- Extended logger implementing ILogger
- ErrorFltr<TException>(LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Error
level and returns the exception of given type - FatalFltr<TException>(LoggerExt.TException, string, bool) (Method)
- Writes the diagnostic message at the
Fatal
level and returns catchIt value. - LoggerExt (Type)
- Extended logger implementing ILogger
- ErrorPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Error
level and returns given exception - FatalPassThrough(Exception, string) (Method)
- Writes the diagnostic message at the
Fatal
level and returns given exception > - Error<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Error
level. Creates and returns the exception of given type - Fatal<TException>(string, Exception) (Method)
- Writes the diagnostic message at the
Fatal
level. Creates and returns the exception of given type
+Sources
- logging\_SourceOnlyPackage.cs
- logging\CommonLogging.cs
- logging\ILogger.CorrelationId.cs
- logging\ILogger.cs
- logging\ILogger.EventProperties.cs
- logging\ILogger.ExceptionFilter.cs
- logging\ILogger.ExceptionPassThrough.cs
- logging\LoggerExt.CorrelationId.cs
- logging\LoggerExt.cs
- logging\LoggerExt.EventProperties.cs
- logging\LoggerExt.ExceptionFilter.cs
- logging\LoggerExt.ExceptionPassThrough.cs
Go to namespaces or types or source-only packages
RadCommons.utils.BackgroundWorkerWithSyncCancel Source only package
@@ -4366,7 +5041,7 @@ RadCommon
Includes: None
Declaring file: utils\BaseDisposable.cs
Helper class for implementation of IDisposable types (Source only package).
-Package members
- BaseDisposable (Type)
- Helper class for implementation of System.IDisposable types
- Disposed (Property)
- Flag whether the object is fully disposed
- DisposedManaged (Property)
- Flag whether the managed resources are disposed
- DisposedNative (Property)
- Flag whether the native resources are disposed
- Dispose() (Method)
- Dispose the object
- Dispose(bool) (Method)
- Internal implementation of dispose - free the managed and native resources using the respective methods
- DisposeManaged() (Method)
- Dispose any disposable managed fields or properties.
- DisposeNative() (Method)
- Dispose of COM objects, Handles, etc. Then set those objects to null.
- ~BaseDisposable() (Method)
+Package members
- BaseDisposable (Type)
- Helper class for implementation of System.IDisposable types
- DisposedFlag (Field)
- Internal flag whether the object is fully disposed
- isDisposed (Field)
- The object is disposed when equals to DisposedFlag
- Disposed (Property)
- Returns
true
when the object is fully disposed - DisposedManaged (Property)
- Returns
true
when the managed resources are disposed - DisposedNative (Property)
- Returns
true
when the native resources are disposed - Dispose() (Method)
- Dispose the object
- Dispose(bool) (Method)
- Internal implementation of dispose - free the managed and native resources using the respective methods
- DisposeManaged() (Method)
- Dispose any disposable managed fields or properties.
- DisposeNative() (Method)
- Dispose of COM objects, Handles, etc. Then set those objects to null.
- ~BaseDisposable() (Method)
- AssertNotDisposed(string) (Method)
- Throws an System.ObjectDisposedException when the current object is disposed
Sources
- utils\BaseDisposable.cs
Go to namespaces or types or source-only packages
@@ -4379,6 +5054,37 @@ RadCommons.
Sources
- utils\ConsoleUtils.cs
Go to namespaces or types or source-only packages
+ RadCommons.utils.Context Source only package
+Tags: RadCommons source-only disposable context
+Includes: None
+Declaring file: utils\Context.cs
+The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed.
+ The current context is accessible via static property Current.
+ The contexts are chained, when a new context is created using static method BeginContext(),
+ the Current context became the Parent of the new one and
+ the newly created context will be set as the Current one.
+ When the context is disposed, the Current context is set to Parent of disposing context.
+ The base implementation just manages the life time, context chain and keeps the state (when provided).
+ Inherit from the Context to add the context related operations (inherited classes have the access to state).
+ Based on the implementation of Guard Scopes by https://github.com/safakgur.
+ (Source only package).
+Usings
- RadCommons.utils.BaseDisposable
- RadCommons.utils.Disposer
+ Remarks
+The context can be both state-less and state-full and it's valid until it's disposed. The current context is accessible via Current . The contexts are chained, when a new context is created using BeginContext(Context<TState>.TState) , the Current context became the Parent of the new one and the newly created context will be set as the Current one. When the context is disposed, the Current context is set to Parent of disposing context. Context's children are disposed as well during the context disposal. The AddToDisposer(IDisposable) method is to be used in inherited classes whenever they manage any disposable resource to ensure their proper life time (when the State is System.IDisposable , it's added to disposer automatically).
The base implementation just manages the life time, context chain and keeps the state (when provided). Inherit from the Context<TState> to add the context related operations (inherited classes have the access to State ).
Based on the implementation of Guard Scopes by https://github.com/safakgur at https://github.com/safakgur/guard/blob/v1.7.0/src/Guard.Scopes.cs
+Package members
- Context<TState> (Type)
- Base context implementation.
- ContextDisposedMessage (Field)
- Error message that will be put into the exception when there will be any operation on the disposed context.
- Local (Field)
- The context holder that is local to the calling asynchronous control flow.
- Current (Property)
- Gets the current context.
- Disposer (Property)
- Gets the disposer associated with this container.
- parentContext (Field)
- Parent context.
- Parent (Property)
- Gets the parent scope.
- contextState (Field)
- State managed by the context.
- State (Property)
- Gets the state managed by the context.
- Context<TState>(Context<TState>.TState) (Method)
- Creates an instance of Context<TState> and initialize its Disposer . The new context will become Current and the previous one its Parent .
- BeginContext(Context<TState>.TState) (Method)
- Creates a new Context<TState> within the context chain. The new context will become Current and the previous one its Parent .
- AddToDisposer(IDisposable) (Method)
- Adds the disposable object to the context disposer, so it will be disposed with the context
- DisposeManaged() (Method)
- Dispose any disposable managed objects - all disposables kept in Disposer stack are pop and disposed.
The Parent context of the disposing one will become the new Current context.
+Sources
- utils\Context.cs
+Go to namespaces or types or source-only packages
+
+ RadCommons.utils.Disposer Source only package
+Tags: RadCommons source-only disposable
+Includes: None
+Declaring file: utils\Disposer.cs
+Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. (Source only package).
+Usings
- RadCommons.utils.BaseDisposable
+Package members
- Disposer (Type)
- Keeps the stack of disposable objects, and disposes them when the disposer is being disposed.
- disposables (Field)
- Stack of disposables kept by the Disposer .
- lockObj (Field)
- Lock object
- Dispose(bool) (Method)
- Internal implementation of dispose - free the managed and native resources.
- Add(IDisposable) (Method)
- Adds the disposable object to the disposer.
+Sources
- utils\Disposer.cs
+Go to namespaces or types or source-only packages
+
RadCommons.utils.FileUtils.Copy Source only package
Tags: RadCommons source-only file-copy file-utilities
Includes: None
@@ -4424,6 +5130,23 @@ RadCommon
Sources
- utils\ProcessWrapper.cs
Go to namespaces or types or source-only packages
+ RadCommons.utils.Scope Source only package
+Tags: RadCommons source-only disposable scope
+Includes: None
+Declaring file: utils\Scope.cs
+The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed.
+ The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel.
+ The base implementation just manages the life time, child scopes and keeps the state (when provided).
+ Inherit from the Scope (and IScope)
+ to add the scope related operations (inherited classes have the access to state).
+ (Source only package).
+Usings
- RadCommons.utils.BaseDisposable
- RadCommons.utils.Disposer
+ Remarks
+The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested, when the scope is disposed, the children are disposed as well. There can be multiple child scopes (siblings) living in parallel. The AddToDisposer(IDisposable) method is to be used in inherited classes whenever they manage any disposable resource to ensure the proper life time (when the State is System.IDisposable , it's added to disposer automatically).
The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the Scope<TState> (and IScope<TState> ) to add the scope related operations (inherited classes have the access to State ).
+Package members
- IScope<TState> (Type)
- Scope interface.
- Parent (Property)
- Gets the parent scope.
- BeginScope(IScope<TState>.TState) (Method)
- Creates a child scope of the current scope.
- Scope<TState> (Type)
- Base scope implementation.
- ScopeDisposedMessage (Field)
- Error message that will be put into the exception when there will be any operation on the disposed scope.
- RootInternal (Field)
- Instance of the Scope<TState> created when the singleton is first touched - root scope with default State
- Root (Property)
- Gets the root scope.
- Scope<TState>() (Method)
- Static constructor
- Disposer (Property)
- Gets the disposer associated with this container.
- parentScope (Field)
- Parent scope.
- Parent (Property)
- Gets the parent scope.
- scopeState (Field)
- State managed by the scope.
- State (Property)
- Gets the state managed by the scope.
- Scope<TState>(Scope<TState>.TState) (Method)
- Creates an instance of Scope<TState> and initialize its Disposer .
- Scope<TState>(IScope<TState>, Scope<TState>.TState) (Method)
- Creates an instance of child Scope<TState> .
- BeginScope(Scope<TState>.TState) (Method)
- Creates a child scope of the current scope.
- AddToDisposer(IDisposable) (Method)
- Adds the disposable object to the scope disposer, so it will be disposed with the scope
- DisposeManaged() (Method)
- Dispose any disposable managed objects - all disposables kept in Disposer stack are pop and disposed.
+Sources
- utils\Scope.cs
+Go to namespaces or types or source-only packages
+
RadCommons.utils.Txt Source only package
Tags: RadCommons source-only text-builder string-builder
Includes: None
diff --git a/doc/net.adamec.lib.common.md b/doc/net.adamec.lib.common.md
index 9e71103..bf53980 100644
--- a/doc/net.adamec.lib.common.md
+++ b/doc/net.adamec.lib.common.md
@@ -32,11 +32,13 @@
| [ContainerBuilderExtensions](#t-net.adamec.lib.common.di.component.containerbuilderextensions__lgbl4y) | internal static | Class | Autofac Autofac.ContainerBuilder extensions |
| [ContainerBuilderExtensions](#t-net.adamec.lib.common.di.config.extensions.containerbuilderextensions__tpisv7) | internal static | Class | Autofac Autofac.ContainerBuilder extensions |
| [ContainerBuilderExtensions](#t-net.adamec.lib.common.di.postinit.containerbuilderextensions__7mjuw3) | internal static | Class | Autofac Autofac.ContainerBuilder extensions |
+ | [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) | internal | Class | Base context implementation. |
+ | [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q) | internal | Class | Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. |
| [EnumeratorExtensions](#t-net.adamec.lib.common.extensions.enumeratorextensions__obwbb2) | internal static | Class | System.Collections.Generic.IEnumerator`1 class extensions |
| [FileAsync](#t-net.adamec.lib.common.async.fileasync__158f1hu) | internal static | Class | Asynchronous text/lines file read methods https://stackoverflow.com/a/13168006 |
| [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y) | internal static | Class | File copy utilities |
| [IEnumerableExtensions](#t-net.adamec.lib.common.extensions.ienumerableextensions__1a6urvh) | internal static | Class | System.Collections.Generic.IEnumerable`1 extensions |
- | [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) | internal | Class | [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) extensions |
+ | [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) | internal | Class | Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) |
| [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy) | internal static | Class | Marshaling helper methods |
| [NamedComponentRegistrationAttribute](#t-net.adamec.lib.common.di.component.namedcomponentregistrationattribute__158ujcr) | public | Class | Defines the registration name and type for named registration (component type will be used if null) |
| [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj) | internal static | Class | Helper class allowing to execute periodic (or one time) scheduled action |
@@ -45,6 +47,7 @@
| [ProcessUtils](#t-net.adamec.lib.common.utils.processutils__tzt3e1) | internal static | Class | System.Diagnostics.Process related utilities |
| [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p) | public | Class | A class the wraps a process, allowing programmatic input and output. |
| [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan) | protected | Class | Internal class to hold the output chunk within the output worker |
+ | [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) | internal | Class | Base scope implementation. |
| [ServiceCollectionAutoOptionsException](#t-net.adamec.lib.common.di.config.exception.servicecollectionautooptionsexception__1bgevbh) | public | Class | Exception thrown by net.adamec.home.control.common.config.exception.ServiceCollectionAutoOptionsExtension |
| [ServiceCollectionAutoOptionsExtension](#t-net.adamec.lib.common.di.config.extensions.servicecollectionautooptionsextension__1p9fgao) | internal static | Class | Extensions for options (configuration) class automatic binding to appsettings.json |
| [ServiceCollectionConfigureDirectException](#t-net.adamec.lib.common.di.config.exception.servicecollectionconfiguredirectexception__1q7o5xj) | public | Class | Exception thrown by net.adamec.home.control.common.config.exception.ServiceCollectionConfigureDirectExtensions |
@@ -53,6 +56,7 @@
| [Txt](#t-net.adamec.lib.common.utils.txt__1fch6k9) | public | Class | Text builder |
| [TypeExtensions](#t-net.adamec.lib.common.extensions.typeextensions__63ezc8) | internal static | Class | System.Type extensions |
| [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) | internal abstract | Interface | Logger interface - wrapper around the NLog.ILogger with some additional methods |
+ | [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf) | internal abstract | Interface | Scope interface. |
| [ProcessEventHandler](#t-net.adamec.lib.common.utils.processeventhandler__8h5v6w) | public | Delegate | A ProcessEventHandler is a delegate for process output events. |
| [ComponentAttribute.ImplicitRegistrationTypeEnum](#t-net.adamec.lib.common.di.component.componentattribute.implicitregistrationtypeenum__10jaypo) | public | Enum | Kind of the implicit component registration |
| [ComponentAttribute.ScopeEnum](#t-net.adamec.lib.common.di.component.componentattribute.scopeenum__r7ahps) | public | Enum | Component scope |
@@ -73,6 +77,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
| [RadCommons.di.Component](#src-only-package--RadCommons.di.Component) | RadCommons DI Component - allows to mark and inject the component using the class attributes (Source only package). |
| [RadCommons.di.Config](#src-only-package--RadCommons.di.Config) | RadCommons DI helpers for application configuration (Source only package). |
| [RadCommons.di.PostInit](#src-only-package--RadCommons.di.PostInit) | RadCommons DI PostInit - allows to run post init method of component (Source only package). |
+ | [RadCommons.extensions.ArrayExtensions.ConcatenateBytes](#src-only-package--RadCommons.extensions.ArrayExtensions.ConcatenateBytes) | Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one) (Source only package). |
| [RadCommons.extensions.ArrayExtensions.Fill](#src-only-package--RadCommons.extensions.ArrayExtensions.Fill) | Fills the array with given value (Source only package). |
| [RadCommons.extensions.EnumeratorExtensions.ToEnumerable](#src-only-package--RadCommons.extensions.EnumeratorExtensions.ToEnumerable) | Transforms the IEnumerator or IEnumerator to IEnumerable (Source only package). |
| [RadCommons.extensions.IEnumerableExtensions.ForEach](#src-only-package--RadCommons.extensions.IEnumerableExtensions.ForEach) | Invokes the action for each item if IEnumerable (Source only package). |
@@ -86,11 +91,14 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
| [RadCommons.utils.BackgroundWorkerWithSyncCancel](#src-only-package--RadCommons.utils.BackgroundWorkerWithSyncCancel) | Executes an operation on a separate thread with possibility of sync cancel (Source only package). |
| [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable) | Helper class for implementation of IDisposable types (Source only package). |
| [RadCommons.utils.ConsoleUtils](#src-only-package--RadCommons.utils.ConsoleUtils) | Console output utilities (Source only package). |
+ | [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context) | The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed. The current context is accessible via static property Current. The contexts are chained, when a new context is created using static method BeginContext(), the Current context became the Parent of the new one and the newly created context will be set as the Current one. When the context is disposed, the Current context is set to Parent of disposing context. The base implementation just manages the life time, context chain and keeps the state (when provided). Inherit from the Context to add the context related operations (inherited classes have the access to state). Based on the implementation of Guard Scopes by https://github.com/safakgur. (Source only package). |
+ | [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer) | Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. (Source only package). |
| [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy) | File copy utilities (Source only package). |
| [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt) | Marshaling helpers (Source only package). |
| [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask) | Periodic (or scheduled) async task runner (Source only package). |
| [RadCommons.utils.ProcessUtils](#src-only-package--RadCommons.utils.ProcessUtils) | Process related utilities (Source only package). |
| [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper) | A class the wraps a process, allowing programmatic input and output (Source only package). |
+ | [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope) | The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel. The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the Scope (and IScope) to add the scope related operations (inherited classes have the access to state). (Source only package). |
| [RadCommons.utils.Txt](#src-only-package--RadCommons.utils.Txt) | Text builder allowing to build strings from parts, supporting conditions, enumerations, etc.(Source only package). |
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -3369,8 +3377,8 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
## ArrayExtensions Class ##
Namespace: [net.adamec.lib.common.extensions](#n-net.adamec.lib.common.extensions__1vwuhoq)
Assembly: net.adamec.lib.common
-Sources: extensions\ArrayExtensionsFill.cs
-Source-only packages: [RadCommons.extensions.ArrayExtensions.Fill](#src-only-package--RadCommons.extensions.ArrayExtensions.Fill)
+Sources: extensions\ArrayExtensionsAppendBytes.cs, extensions\ArrayExtensionsFill.cs
+Source-only packages: [RadCommons.extensions.ArrayExtensions.ConcatenateBytes](#src-only-package--RadCommons.extensions.ArrayExtensions.ConcatenateBytes), [RadCommons.extensions.ArrayExtensions.Fill](#src-only-package--RadCommons.extensions.ArrayExtensions.Fill)
Array extensions
@@ -3389,6 +3397,7 @@ Inheritance: array or T with defaultValue |
@@ -3400,6 +3409,32 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## ArrayExtensions.AppendBytes(byte[], byte[]) Method ##
+Namespace: [net.adamec.lib.common.extensions](#n-net.adamec.lib.common.extensions__1vwuhoq)
+Assembly: net.adamec.lib.common
+Type: [ArrayExtensions](#t-net.adamec.lib.common.extensions.arrayextensions__icw7wf)
+Sources: extensions\ArrayExtensionsAppendBytes.cs
+Source-only packages: [RadCommons.extensions.ArrayExtensions.ConcatenateBytes](#src-only-package--RadCommons.extensions.ArrayExtensions.ConcatenateBytes)
+
+
+Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one)
+
+
+
+```csharp
+public static byte[] AppendBytes(this byte[] original, byte[] addedBytes)
+```
+
+Method parameters
- byte[] original
- Original byte array
- byte[] addedBytes
- Bytes to add
+Return value- byte[]
- New concatenated byte array ( original + addedBytes )
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## ArrayExtensions.Fill<T>(ArrayExtensions.T[], ArrayExtensions.T) Method ##
Namespace: [net.adamec.lib.common.extensions](#n-net.adamec.lib.common.extensions__1vwuhoq)
Assembly: net.adamec.lib.common
@@ -3940,7 +3975,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
| Name | Modifier | Summary |
| ------ | ---------- | --------- |
| [CommonLogging](#t-net.adamec.lib.common.logging.commonlogging__1dar5wb) | internal static | [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) factory |
- | [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) | internal | [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) extensions |
+ | [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) | internal | Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) |
@@ -4077,11 +4112,11 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
## LoggerExt Class ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
-Sources: logging\LoggerExt.cs
-Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
+Sources: logging\LoggerExt.CorrelationId.cs, logging\LoggerExt.cs, logging\LoggerExt.EventProperties.cs, logging\LoggerExt.ExceptionFilter.cs, logging\LoggerExt.ExceptionPassThrough.cs
+Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
-[ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) extensions
+Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
@@ -4097,7 +4132,7 @@ Implements: [net.adamec.lib.common.logging.ILogger](#t-net.adamec.lib.common.log
| Name | Modifier | Summary |
| ------ | ---------- | --------- |
- | [CreateException<TException>(string, Exception)](#m-net.adamec.lib.common.logging.loggerext.createexception--1_system.string-system.exception___1wtd924) | private static | Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type |
+ | [CreateException<TException>(string, string, Exception)](#m-net.adamec.lib.common.logging.loggerext.createexception--1_system.string-system.string--system.exception___1kt7m7i) | private static | Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type |
| [Debug(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.loggerext.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___by66ma) | public | Writes the diagnostic message at the `Debug` level. |
| [DebugCorr(string, string)](#m-net.adamec.lib.common.logging.loggerext.debugcorr_system.string-system.string___i119af) | public | Writes the diagnostic message at the `Debug` level with correlation ID. |
| [Error(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.loggerext.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___7fy00h) | public | Writes the diagnostic message at the `Error` level. |
@@ -4122,9 +4157,9 @@ Implements: [net.adamec.lib.common.logging.ILogger](#t-net.adamec.lib.common.log
| [FatalPassThrough(Exception, string)](#m-net.adamec.lib.common.logging.loggerext.fatalpassthrough_system.exception-system.string___10psm2o) | public | Writes the diagnostic message at the `Fatal` level and returns given exception > |
| [Info(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.loggerext.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1qxds6b) | public | Writes the diagnostic message at the `Info` level. |
| [InfoCorr(string, string)](#m-net.adamec.lib.common.logging.loggerext.infocorr_system.string-system.string___3vobha) | public | Writes the diagnostic message at the `Info` level with correlation ID. |
- | [LogIt(LogLevel, Dictionary<string,object>, string, Exception)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.collections.generic.dictionary_system.string-system.object_-system.string-system.exception___5yngu4) | private | Writes the item (message with optional event properties and exception) into the log |
- | [LogIt(LogLevel, string, Exception)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.exception___hxtfrf) | private | Writes the item (message with optional exception) into the log |
- | [LogIt(LogLevel, string, string, Exception)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.string-system.exception___1l4ejwt) | private | Writes the item (message with optional exception) with correlation Id into the log |
+ | [LogIt(LogLevel, Dictionary<string,object>, string, Exception, string)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.collections.generic.dictionary_system.string-system.object_-system.string-system.exception-system.string___vo1jng) | private | Writes the item (message with optional event properties and exception) into the log |
+ | [LogIt(LogLevel, string, Exception, string)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.exception-system.string___17r766x) | private | Writes the item (message with optional exception) into the log |
+ | [LogIt(LogLevel, string, string, Exception, string)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.string-system.exception-system.string___14n4i77) | private | Writes the item (message with optional exception) with correlation Id into the log |
| [Trace(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.loggerext.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___1k5wn70) | public | Writes the diagnostic message at the `Trace` level. |
| [TraceCorr(string, string)](#m-net.adamec.lib.common.logging.loggerext.tracecorr_system.string-system.string___1e218kz) | public | Writes the diagnostic message at the `Trace` level with correlation ID |
| [Warn(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.loggerext.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___8kyvvj) | public | Writes the diagnostic message at the `Warn` level. |
@@ -4141,7 +4176,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## LoggerExt.CreateException<TException>(string, Exception) Method ##
+## LoggerExt.CreateException<TException>(string, string, Exception) Method ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
@@ -4154,11 +4189,11 @@ Writes the diagnostic message at the `Fatal` level. Creates and returns the exce
```csharp
-private static LoggerExt.TException CreateException(string message, Exception innerException = null) where TException: Exception
+private static LoggerExt.TException CreateException(string message, out string stackTrace, Exception innerException = null) where TException: Exception
```
Type parameters- TException
-Method parameters- string message
- Log message.
- System.Exception innerException
- Exception to be logged
+Method parameters- string message
- Log message.
- string stackTrace
- Stack trace to be logged in `StackTrace` event property
- System.Exception innerException
- Exception to be logged
Return value- net.adamec.lib.common.logging.LoggerExt.TException
- Created exception
@@ -4172,7 +4207,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4198,7 +4233,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4224,7 +4259,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4250,7 +4285,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4276,7 +4311,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4303,7 +4338,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4329,7 +4364,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4355,7 +4390,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4382,7 +4417,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4409,7 +4444,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionFilter.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4461,7 +4496,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4496,7 +4531,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4522,7 +4557,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4548,7 +4583,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4574,7 +4609,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4601,7 +4636,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4627,7 +4662,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4653,7 +4688,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4680,7 +4715,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4707,7 +4742,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionFilter.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4742,7 +4777,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4777,7 +4812,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4803,7 +4838,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4829,7 +4864,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4851,7 +4886,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## LoggerExt.LogIt(LogLevel, Dictionary<string,object>, string, Exception) Method ##
+## LoggerExt.LogIt(LogLevel, Dictionary<string,object>, string, Exception, string) Method ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
@@ -4864,10 +4899,10 @@ Writes the item (message with optional event properties and exception) into the
```csharp
-private void LogIt(LogLevel level, Dictionary eventProperties, [Localizable(false)] string message, Exception exception = null)
+private void LogIt(LogLevel level, Dictionary eventProperties, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
```
-Method parameters- NLog.LogLevel level
- Dictionary<string,object> eventProperties
- Event properties (null when no properties are provided)
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
+Method parameters- NLog.LogLevel level
- Dictionary<string,object> eventProperties
- Event properties (null when no properties are provided)
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
- string stackTrace
- Optional stack trace to be logged in `StackTrace` event property when the System.Exception.StackTrace of exception is empty
Return value- void
@@ -4877,7 +4912,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## LoggerExt.LogIt(LogLevel, string, Exception) Method ##
+## LoggerExt.LogIt(LogLevel, string, Exception, string) Method ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
@@ -4890,10 +4925,10 @@ Writes the item (message with optional exception) into the log
```csharp
-private void LogIt(LogLevel level, [Localizable(false)] string message, Exception exception = null)
+private void LogIt(LogLevel level, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
```
-Method parameters- NLog.LogLevel level
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
+Method parameters- NLog.LogLevel level
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
- string stackTrace
- Optional stack trace to be logged in `StackTrace` event property when the System.Exception.StackTrace of exception is empty
Return value- void
@@ -4903,11 +4938,11 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## LoggerExt.LogIt(LogLevel, string, string, Exception) Method ##
+## LoggerExt.LogIt(LogLevel, string, string, Exception, string) Method ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4916,10 +4951,10 @@ Writes the item (message with optional exception) with correlation Id into the l
```csharp
-private void LogIt(LogLevel level, string correlationId, [Localizable(false)] string message, Exception exception = null)
+private void LogIt(LogLevel level, string correlationId, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
```
-Method parameters- NLog.LogLevel level
- string correlationId
- Correlation ID
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
+Method parameters- NLog.LogLevel level
- string correlationId
- Correlation ID
- string message
- Log message
- System.Exception exception
- Optional exception to be logged
- string stackTrace
- Optional stack trace to be logged in `StackTrace` event property when the System.Exception.StackTrace of exception is empty
Return value- void
@@ -4933,7 +4968,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4959,7 +4994,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -4985,7 +5020,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5011,7 +5046,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5037,7 +5072,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5063,7 +5098,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
-Sources: logging\LoggerExt.cs
+Sources: logging\LoggerExt.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5088,8 +5123,8 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
## ILogger Interface ##
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
-Sources: logging\ILogger.cs
-Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
+Sources: logging\ILogger.CorrelationId.cs, logging\ILogger.cs, logging\ILogger.EventProperties.cs, logging\ILogger.ExceptionFilter.cs, logging\ILogger.ExceptionPassThrough.cs
+Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging), [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
Logger interface - wrapper around the NLog.ILogger with some additional methods
@@ -5104,6 +5139,76 @@ Implemented by: [net.adamec.lib.common.logging.LoggerExt](#t-net.adamec.lib.comm
Implements: NLog.ILogger, NLog.ILoggerBase, NLog.ISuppress
+### Remarks ###
+The NLog supports having additional (custom) event properties provided to loggers and optionally rendered to logs. The event properties are represented as key-value dictionary, where key is the unique name of the property. Extended logger provides following methods to log with given set of the properties.
+
+
+
+
+ - [Trace(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___15kc02k) ,
+ - [Debug(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___jxdraq) ,
+ - [Info(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1kbhewr) ,
+ - [Warn(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___1hy0rp3) ,
+ - [Error(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.string___kfa9gl) ,
+ - [Fatal(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1yxmkzz) ,
+ - [Warn(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___10z37vj) ,
+ - [Error(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___1watp5d) and
+ - [Fatal(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___175gumn)
+
+
+
+
+
+ Sometimes, it's useful to have an exception logging method implemented as the operation returning the exception being logged. The [ErrorPassThrough(Exception, string)](#m-net.adamec.lib.common.logging.ilogger.errorpassthrough_system.exception-system.string___1vc33gk) and [FatalPassThrough(Exception, string)](#m-net.adamec.lib.common.logging.ilogger.fatalpassthrough_system.exception-system.string___1fx8xs8) methods will log given exception and return it for further processing.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (Exception ex){
+ if(logger.ErrorPassThrough(ex) is MyException){
+ return null;
+ }else{
+ throw;
+ }
+ }
+```
+ In the example above, the exception is always logged and then the decision/action is taken.
+
+ C# 6 brought the exception filters that don't unwind the stack as the exception is not catch yet when processing the filter. It can also be used for logging the exceptions without actually catching them (when the exception filter returns `false` ). Extended logger provides functions [ErrorFltr<TException>(ILogger.TException, string, bool)](#m-net.adamec.lib.common.logging.ilogger.errorfltr--1_--0-system.string-system.boolean___135nosm) and [FatalFltr<TException>(ILogger.TException, string, bool)](#m-net.adamec.lib.common.logging.ilogger.fatalfltr--1_--0-system.string-system.boolean___1av7ixa) for this purpose.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (Exception ex) when (logger.ErrorFltr(ex,"Error here!"){
+ //newer called as the default return value of ErrorFltr is false
+ }
+```
+ The example above logs but never catch all exceptions. The following code catch and log the ArgumentException and logs any other exception without catching it.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) { ... }
+ catch (Exception e) when (Logger.FatalFltr(e)) {}
+```
+
+
+ Logger can also create and exception, log it and return using functions [Error<TException>(string, Exception)](#m-net.adamec.lib.common.logging.ilogger.error--1_system.string-system.exception___pmrssh) and [Fatal<TException>(string, Exception)](#m-net.adamec.lib.common.logging.ilogger.fatal--1_system.string-system.exception___x5u73)
+```csharp
+ if(value is null) throw logger.Fatal("Value is null");
+```
+
+
+ When logging an exception using the [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) methods, the event property `StackTrace` is set from System.Exception.StackTrace , when the logger creates an exception, the property is set using `new StackTrace(2, true).ToString()` . In other cases when the System.Exception.StackTrace is null or empty, `new StackTrace(true).ToString()` is used.
+
+ [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) also provides set of methods for logging with the correlation ID (for example in integration scenarios), where the given correlation ID is set to the event property `CorrelationId` . Such methods have the name ending with `Corr` suffix.
+
+
+
+
### Methods ###
| Name | Modifier | Summary |
@@ -5152,7 +5257,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5178,7 +5283,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5204,7 +5309,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5230,7 +5335,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5256,7 +5361,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5283,7 +5388,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5309,7 +5414,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5335,7 +5440,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5362,7 +5467,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5389,7 +5494,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionFilter.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5441,7 +5546,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5476,7 +5581,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5502,7 +5607,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5528,7 +5633,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5554,7 +5659,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5581,7 +5686,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5607,7 +5712,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5633,7 +5738,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5660,7 +5765,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5687,7 +5792,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionFilter.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5722,7 +5827,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5757,7 +5862,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.ExceptionPassThrough.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5783,7 +5888,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5809,7 +5914,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5835,7 +5940,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5861,7 +5966,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5887,7 +5992,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5913,7 +6018,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.EventProperties.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5939,7 +6044,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5965,7 +6070,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
Namespace: [net.adamec.lib.common.logging](#n-net.adamec.lib.common.logging__1g9pm29)
Assembly: net.adamec.lib.common
Type: [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
-Sources: logging\ILogger.cs
+Sources: logging\ILogger.CorrelationId.cs
Source-only packages: [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
@@ -5995,6 +6100,8 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
| [BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo) | public | Executes an operation on a separate thread with possibility of sync cancel. |
| [BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps) | public abstract | Helper class for implementation of System.IDisposable types |
| [ConsoleUtils](#t-net.adamec.lib.common.utils.consoleutils__8nc415) | internal static | Console output helpers |
+ | [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) | internal | Base context implementation. |
+ | [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q) | internal | Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. |
| [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y) | internal static | File copy utilities |
| [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy) | internal static | Marshaling helper methods |
| [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj) | internal static | Helper class allowing to execute periodic (or one time) scheduled action |
@@ -6002,11 +6109,21 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
| [ProcessUtils](#t-net.adamec.lib.common.utils.processutils__tzt3e1) | internal static | System.Diagnostics.Process related utilities |
| [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p) | public | A class the wraps a process, allowing programmatic input and output. |
| [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan) | protected | Internal class to hold the output chunk within the output worker |
+ | [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) | internal | Base scope implementation. |
| [Txt](#t-net.adamec.lib.common.utils.txt__1fch6k9) | public | Text builder |
+### Interfaces ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf) | internal abstract | Scope interface. |
+
+
+
+
### Delegates ###
| Name | Modifier | Summary |
@@ -6270,16 +6387,35 @@ public abstract class BaseDisposable : IDisposable
```
Inheritance: object
+Derived: [net.adamec.lib.common.utils.Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v), [net.adamec.lib.common.utils.Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q), [net.adamec.lib.common.utils.Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
Implements: IDisposable
+### Constants ###
+
+ | Name | Value | Summary |
+ | ------ | ------- | --------- |
+ | [DisposedFlag](#f-net.adamec.lib.common.utils.basedisposable.disposedflag__1kqq0uz) | 1 | Internal flag whether the object is fully disposed |
+
+
+
+
+### Fields ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [isDisposed](#f-net.adamec.lib.common.utils.basedisposable.isdisposed__2u766d) | private | The object is disposed when equals to [DisposedFlag](#f-net.adamec.lib.common.utils.basedisposable.disposedflag__1kqq0uz) |
+
+
+
+
### Properties ###
| Name | Modifier | Summary |
| ------ | ---------- | --------- |
- | [Disposed](#p-net.adamec.lib.common.utils.basedisposable.disposed__nxq2fp) | public | Flag whether the object is fully disposed |
- | [DisposedManaged](#p-net.adamec.lib.common.utils.basedisposable.disposedmanaged__1pm7df6) | public | Flag whether the managed resources are disposed |
- | [DisposedNative](#p-net.adamec.lib.common.utils.basedisposable.disposednative__fqjn7i) | public | Flag whether the native resources are disposed |
+ | [Disposed](#p-net.adamec.lib.common.utils.basedisposable.disposed__nxq2fp) | public | Returns ```csharp true ``` when the object is fully disposed |
+ | [DisposedManaged](#p-net.adamec.lib.common.utils.basedisposable.disposedmanaged__1pm7df6) | public | Returns ```csharp true ``` when the managed resources are disposed |
+ | [DisposedNative](#p-net.adamec.lib.common.utils.basedisposable.disposednative__fqjn7i) | public | Returns ```csharp true ``` when the native resources are disposed |
@@ -6297,6 +6433,7 @@ Implements: System.ObjectDisposedException when the current object is disposed |
| [Dispose()](#m-net.adamec.lib.common.utils.basedisposable.dispose__6qe9ri) | public | Dispose the object |
| [Dispose(bool)](#m-net.adamec.lib.common.utils.basedisposable.dispose_system.boolean___1vzs8w4) | protected | Internal implementation of dispose - free the managed and native resources using the respective methods |
| [DisposeManaged()](#m-net.adamec.lib.common.utils.basedisposable.disposemanaged__1ht3p85) | protected | Dispose any disposable managed fields or properties. |
@@ -6311,6 +6448,56 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## BaseDisposable.DisposedFlag Constant ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Sources: utils\BaseDisposable.cs
+Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
+
+
+Internal flag whether the object is fully disposed
+
+
+
+```csharp
+private const int DisposedFlag = 1
+```
+
+Field value- int
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## BaseDisposable.isDisposed Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Sources: utils\BaseDisposable.cs
+Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
+
+
+The object is disposed when equals to [DisposedFlag](#f-net.adamec.lib.common.utils.basedisposable.disposedflag__1kqq0uz)
+
+
+
+```csharp
+private int isDisposed
+```
+
+Field value- int
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## BaseDisposable.Disposed Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
@@ -6319,12 +6506,16 @@ Sources: utils\BaseDisposable.cs
Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
-Flag whether the object is fully disposed
+Returns
+```csharp
+true
+```
+ when the object is fully disposed
```csharp
-public bool Disposed { get; private set; }
+public bool Disposed { get; }
```
Property value- bool
@@ -6344,7 +6535,11 @@ Sources: utils\BaseDisposable.cs
Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
-Flag whether the managed resources are disposed
+Returns
+```csharp
+true
+```
+ when the managed resources are disposed
@@ -6369,7 +6564,11 @@ Sources: utils\BaseDisposable.cs
Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
-Flag whether the native resources are disposed
+Returns
+```csharp
+true
+```
+ when the native resources are disposed
@@ -6405,6 +6604,36 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## BaseDisposable.AssertNotDisposed(string) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Sources: utils\BaseDisposable.cs
+Source-only packages: [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
+
+
+Throws an System.ObjectDisposedException when the current object is disposed
+
+
+
+```csharp
+protected void AssertNotDisposed(string message = null)
+```
+
+Method parameters- string message
- Optional exception message
+Return value- void
+
+
+### Exceptions ###
+- System.ObjectDisposedException
- Current object is disposed
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## BaseDisposable.Dispose() Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
@@ -6446,7 +6675,7 @@ Internal implementation of dispose - free the managed and native resources using
protected virtual void Dispose(bool disposing)
```
-Method parameters- bool disposing
- Flag whether the object is disposing (called from [Dispose()](#m-net.adamec.lib.common.utils.basedisposable.dispose__6qe9ri) method). False if called from destructor
+Method parameters- bool disposing
- True to dispose both managed and native resources, false to dispose the native resources only
Return value- void
@@ -6761,63 +6990,84 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## FileUtils Class ##
+## Context<TState> Class ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\FileUtilsCopy.cs
-Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-File copy utilities
+Base context implementation.
```csharp
-internal static class FileUtils
+internal class Context : BaseDisposable where TState: class, new()
```
-Inheritance: object
+Type parameters- TState
- Type of the state object managed by the context
+Inheritance: object -> [net.adamec.lib.common.utils.BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Implements: IDisposable
+### Remarks ###
+The context can be both state-less and state-full and it's valid until it's disposed. The current context is accessible via [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) . The contexts are chained, when a new context is created using [BeginContext(Context<TState>.TState)](#m-net.adamec.lib.common.utils.context-1.begincontext_-0___mkgdox) , the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context became the [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) of the new one and the newly created context will be set as the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) one. When the context is disposed, the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context is set to [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) of disposing context. Context's children are disposed as well during the context disposal. The [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.context-1.addtodisposer_system.idisposable___1y4aua6) method is to be used in inherited classes whenever they manage any disposable resource to ensure their proper life time (when the [State](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy) is System.IDisposable , it's added to disposer automatically). The base implementation just manages the life time, context chain and keeps the state (when provided). Inherit from the [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) to add the context related operations (inherited classes have the access to [State](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy) ).
-### Methods ###
+ Based on the implementation of Guard Scopes by https://github.com/safakgur at https://github.com/safakgur/guard/blob/v1.7.0/src/Guard.Scopes.cs
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [DirectoryCopy(string, string, bool, bool, List<string>)](#m-net.adamec.lib.common.utils.fileutils.directorycopy_system.string-system.string-system.boolean-system.boolean-system.collections.generic.list_system.string____14t7efj) | public static | Copies the source directory to destination directory All files from source directory are copied to the destination directory. The destination directory is created when doesn't exist. recursive parameter set to true let also subdirectories to be copied To overwrite the existing destination files, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path, so applicable to all directories) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown) |
- | [FileCopy(string, string, bool, List<string>)](#m-net.adamec.lib.common.utils.fileutils.filecopy_system.string-system.string-system.boolean-system.collections.generic.list_system.string____1j72c9b) | public static | Copies the source file to destination file To overwrite the existing destination file, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown) |
+
+
+
+### Constants ###
+
+ | Name | Value | Summary |
+ | ------ | ------- | --------- |
+ | [ContextDisposedMessage](#f-net.adamec.lib.common.utils.context-1.contextdisposedmessage__161hgfs) | Current context has been disposed | Error message that will be put into the exception when there will be any operation on the disposed context. |
-Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+### Fields ###
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [contextState](#f-net.adamec.lib.common.utils.context-1.contextstate__5jvaxj) | private | State managed by the context. |
+ | [Local](#f-net.adamec.lib.common.utils.context-1.local__17b69oq) | private static | The context holder that is local to the calling asynchronous control flow. |
+ | [parentContext](#f-net.adamec.lib.common.utils.context-1.parentcontext__1an2htq) | private | Parent context. |
-## FileUtils.DirectoryCopy(string, string, bool, bool, List<string>) Method ##
-Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
-Assembly: net.adamec.lib.common
-Type: [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y)
-Sources: utils\FileUtilsCopy.cs
-Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
+### Properties ###
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) | public static | Gets the current context. |
+ | [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) | private | Gets the disposer associated with this container. |
+ | [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) | public | Gets the parent scope. |
+ | [State](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy) | protected | Gets the state managed by the context. |
-Copies the source directory to destination directory All files from source directory are copied to the destination directory. The destination directory is created when doesn't exist. recursive parameter set to true let also subdirectories to be copied To overwrite the existing destination files, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path, so applicable to all directories) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown)
+
+### Constructors ###
-```csharp
-public static void DirectoryCopy(string sourceDirectoryName, string destDirectoryName, bool recursive, bool overwrite, List doNotOverwriteFileNames = null)
-```
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Context<TState>(Context<TState>.TState)](#m-net.adamec.lib.common.utils.context-1.-ctor_-0___7zfvl8) | protected | Creates an instance of [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) and initialize its [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) . The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) . |
-Method parameters- string sourceDirectoryName
- Full path to the source directory
- string destDirectoryName
- Full path to the destination directory
- bool recursive
- True if the subdirectories are to be copied as well
- bool overwrite
- True to allow overwriting the existing destination files
- List<string> doNotOverwriteFileNames
- Optional list of file names not to be overwritten
-Return value- void
+
-### Exceptions ###
-- System.ArgumentNullException
- sourceDirectoryName or destDirectoryName is null.
- System.IO.DirectoryNotFoundException
- sourceDirectoryName doesn't exist.
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.context-1.addtodisposer_system.idisposable___1y4aua6) | protected | Adds the disposable object to the context disposer, so it will be disposed with the context |
+ | [BeginContext(Context<TState>.TState)](#m-net.adamec.lib.common.utils.context-1.begincontext_-0___mkgdox) | public static | Creates a new [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) within the context chain. The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) . |
+ | [DisposeManaged()](#m-net.adamec.lib.common.utils.context-1.disposemanaged__1ueqxf2) | protected | Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) stack are pop and disposed. The [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) context of the disposing one will become the new [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context. |
+
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6826,28 +7076,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## FileUtils.FileCopy(string, string, bool, List<string>) Method ##
+## Context<TState>.ContextDisposedMessage Constant ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y)
-Sources: utils\FileUtilsCopy.cs
-Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Copies the source file to destination file To overwrite the existing destination file, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown)
+Error message that will be put into the exception when there will be any operation on the disposed context.
```csharp
-public static void FileCopy(string sourceFileName, string destFileName, bool overwrite, List doNotOverwriteFileNames = null)
+private const string ContextDisposedMessage = "Current context has been disposed"
```
-Method parameters- string sourceFileName
- Full path to the source file
- string destFileName
- Full path to the destination file
- bool overwrite
- True to allow overwriting the existing destination file
- List<string> doNotOverwriteFileNames
- Optional list of file names not to be overwritten
-Return value- void
-
-
-### Exceptions ###
-- System.ArgumentNullException
- sourceFileName or destFileName is null.
+Field value- string
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6856,33 +7101,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## MarshalExt Class ##
+## Context<TState>.contextState Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\MarshalExt.cs
-Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Marshaling helper methods
+State managed by the context.
```csharp
-internal static class MarshalExt
+private readonly Context.TState contextState
```
-Inheritance: object
-
-
-
-### Methods ###
-
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [GetDataAsStructure(Type, byte[])](#m-net.adamec.lib.common.utils.marshalext.getdataasstructure_system.type-system.byte_____3ecs3) | public static | Converts the byte array data into the structure of given structureType |
- | [GetStructureAsData(object)](#m-net.adamec.lib.common.utils.marshalext.getstructureasdata_system.object___1emo3ax) | public static | Get's the structure data byte array |
-
-
+Field value- net.adamec.lib.common.utils.Context<TState>.TState
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6891,24 +7126,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## MarshalExt.GetDataAsStructure(Type, byte[]) Method ##
+## Context<TState>.Local Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy)
-Sources: utils\MarshalExt.cs
-Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Converts the byte array data into the structure of given structureType
+The context holder that is local to the calling asynchronous control flow.
```csharp
-public static object GetDataAsStructure(Type structureType, byte[] data)
+private static readonly AsyncLocal> Local
```
-Method parameters- System.Type structureType
- byte[] data
-Return value- object
- The structure build from the data or null when the conversion was not successful.
+Field value- System.Threading.AsyncLocal<net.adamec.lib.common.utils.Context<TState>>
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6917,24 +7151,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## MarshalExt.GetStructureAsData(object) Method ##
+## Context<TState>.parentContext Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy)
-Sources: utils\MarshalExt.cs
-Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Get's the structure data byte array
+Parent context.
```csharp
-public static byte[] GetStructureAsData(object sourceStructure)
+private readonly Context parentContext
```
-Method parameters- object sourceStructure
- Source structure
-Return value- byte[]
- Structure data as byte array
+Field value- [net.adamec.lib.common.utils.Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6943,33 +7176,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## PeriodicTask Class ##
+## Context<TState>.Current Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\PeriodicTask.cs
-Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Helper class allowing to execute periodic (or one time) scheduled action
+Gets the current context.
```csharp
-internal static class PeriodicTask
+public static Context Current { get; private set; }
```
-Inheritance: object
-
-
-
-### Methods ###
-
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [RunAsync(Action, TimeSpan, bool)](#m-net.adamec.lib.common.utils.periodictask.runasync_system.action-system.timespan-system.boolean___9mkw46) | public static | Schedule and run the periodic action |
- | [RunAsync(Action, TimeSpan, CancellationToken, bool)](#m-net.adamec.lib.common.utils.periodictask.runasync_system.action-system.timespan-system.threading.cancellationtoken-system.boolean___uw465x) | public static | Schedule and run the periodic action |
-
-
+Property value- [net.adamec.lib.common.utils.Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -6978,24 +7201,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## PeriodicTask.RunAsync(Action, TimeSpan, bool) Method ##
+## Context<TState>.Disposer Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj)
-Sources: utils\PeriodicTask.cs
-Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Schedule and run the periodic action
+Gets the disposer associated with this container.
```csharp
-public static Task RunAsync(Action action, TimeSpan period, bool oneTimeOnly = false)
+private Disposer Disposer { get; }
```
-Method parameters- System.Action action
- Action to be executed
- System.TimeSpan period
- Period between the individual runs (and even before the first run)
- bool oneTimeOnly
-Return value- System.Threading.Tasks.Task
+Property value- [net.adamec.lib.common.utils.Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7004,32 +7226,27 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## PeriodicTask.RunAsync(Action, TimeSpan, CancellationToken, bool) Method ##
+## Context<TState>.Parent Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj)
-Sources: utils\PeriodicTask.cs
-Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Schedule and run the periodic action
+Gets the parent scope.
```csharp
-public static async Task RunAsync(Action action, TimeSpan period, CancellationToken cancellationToken, bool oneTimeOnly = false)
+public Context Parent { get; }
```
-Method parameters- System.Action action
- Action to be executed
- System.TimeSpan period
- Period between the individual runs (and even before the first run)
- System.Threading.CancellationToken cancellationToken
- Cancellation token used to cancel the (periodic) task execution.
- bool oneTimeOnly
- Flag whether the action should run one time only (after the given period )
-Return value- System.Threading.Tasks.Task
- Async task
-
-
-### Remarks ###
-The cancellationToken interrupts the period/waiting loop, but not the action itself. The method doesn't create any additional thread or worker, it's the responsibility of the caller is needed.
+Property value- [net.adamec.lib.common.utils.Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
### Exceptions ###
-- System.ArgumentNullException
- action , period or cancellationToken is null
+- System.ObjectDisposedException
- The current context has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7038,69 +7255,80 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessEventArgs Class ##
+## Context<TState>.State Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-The ProcessEventArgs are arguments for a console event.
+Gets the state managed by the context.
```csharp
-public class ProcessEventArgs : EventArgs
+protected Context.TState State { get; }
```
-Inheritance: object -> System.EventArgs
+Property value- net.adamec.lib.common.utils.Context<TState>.TState
+### Exceptions ###
+- System.ObjectDisposedException
- The current context has been disposed.
-### Properties ###
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [Code](#p-net.adamec.lib.common.utils.processeventargs.code__q4uuts) | public | Gets the process exit code. |
- | [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) | public | Gets the process input/output content. |
- | [IsError](#p-net.adamec.lib.common.utils.processeventargs.iserror__1dgcqs1) | public | Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true) |
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
-### Constructors ###
+## Context<TState>.Context<TState>(Context<TState>.TState) Constructor ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [ProcessEventArgs(int, string)](#m-net.adamec.lib.common.utils.processeventargs.-ctor_system.int32-system.string___12x7loh) | public | CTOR with code |
- | [ProcessEventArgs(string, bool)](#m-net.adamec.lib.common.utils.processeventargs.-ctor_system.string-system.boolean___1ey6l7b) | public | CTOR with content |
-
+Creates an instance of [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) and initialize its [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) . The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) .
+
+```csharp
+protected Context(Context.TState state = null)
+```
+
+Constructor parameters- net.adamec.lib.common.utils.Context<TState>.TState state
- Optional state managed by the context.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-## ProcessEventArgs.Code Property ##
+## Context<TState>.AddToDisposer(IDisposable) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Gets the process exit code.
+Adds the disposable object to the context disposer, so it will be disposed with the context
```csharp
-public int Code { get; }
+protected void AddToDisposer(IDisposable disposable)
```
-Property value- int
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value- void
+
+
+### Exceptions ###
+- System.ArgumentNullException
- disposable is null.
- System.ObjectDisposedException
- The current context has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7109,23 +7337,24 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessEventArgs.Content Property ##
+## Context<TState>.BeginContext(Context<TState>.TState) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
-Gets the process input/output content.
+Creates a new [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) within the context chain. The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) .
```csharp
-public string Content { get; }
+public static IDisposable BeginContext(Context.TState state = null)
```
-Property value- string
+Method parameters- net.adamec.lib.common.utils.Context<TState>.TState state
- Optional state managed by the context.
+Return value- IDisposable
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7134,23 +7363,25 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessEventArgs.IsError Property ##
+## Context<TState>.DisposeManaged() Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
+Sources: utils\Context.cs
+Source-only packages: [RadCommons.utils.Context](#src-only-package--RadCommons.utils.Context)
+
+
+Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) stack are pop and disposed. The [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) context of the disposing one will become the new [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context.
-Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true)
```csharp
-public bool IsError { get; }
+protected override void DisposeManaged()
```
-Property value- bool
+Return value- void
Overrides: [BaseDisposable.DisposeManaged()](#m-net.adamec.lib.common.utils.basedisposable.disposemanaged__1ht3p85)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7159,78 +7390,93 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessEventArgs.ProcessEventArgs(int, string) Constructor ##
+## Disposer Class ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Sources: utils\Disposer.cs
+Source-only packages: [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
-CTOR with code
+Keeps the stack of disposable objects, and disposes them when the disposer is being disposed.
```csharp
-public ProcessEventArgs(int code, string command)
+internal class Disposer : BaseDisposable
```
-Constructor parameters- int code
- Process exit code
- string command
- Command name to be set to the args [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m)
+Inheritance: object -> [net.adamec.lib.common.utils.BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Implements: IDisposable
+
+
+### Fields ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [disposables](#f-net.adamec.lib.common.utils.disposer.disposables__5cwehn) | private | Stack of disposables kept by the [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q) . |
+ | [lockObj](#f-net.adamec.lib.common.utils.disposer.lockobj__1oj1wh6) | private | Lock object |
+
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Add(IDisposable)](#m-net.adamec.lib.common.utils.disposer.add_system.idisposable___1c4uk8l) | public | Adds the disposable object to the disposer. |
+ | [Dispose(bool)](#m-net.adamec.lib.common.utils.disposer.dispose_system.boolean___32o7wm) | protected | Internal implementation of dispose - free the managed and native resources. |
+
+
+
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-## ProcessEventArgs.ProcessEventArgs(string, bool) Constructor ##
+## Disposer.disposables Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
+Sources: utils\Disposer.cs
+Source-only packages: [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
-CTOR with content
+Stack of disposables kept by the [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q) .
```csharp
-public ProcessEventArgs(string content, bool isError = false)
+private Stack disposables
```
-Constructor parameters- string content
- The content output from or input to process
- bool isError
- Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true)
+Field value- Stack<IDisposable>
+
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-## ProcessUtils Class ##
+## Disposer.lockObj Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\ProcessUtils.cs
-Source-only packages: [RadCommons.utils.ProcessUtils](#src-only-package--RadCommons.utils.ProcessUtils)
+Type: [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
+Sources: utils\Disposer.cs
+Source-only packages: [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
-System.Diagnostics.Process related utilities
+Lock object
```csharp
-internal static class ProcessUtils
+private readonly object lockObj
```
-Inheritance: object
-
-
-
-### Methods ###
-
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [RunCommand(string, string, string, string)](#m-net.adamec.lib.common.utils.processutils.runcommand_system.string-system.string-system.string-system.string-___vsf405) | public static | Synchronously runs a command (process) and returns the standard output or error text |
-
-
+Field value- object
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7239,28 +7485,28 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessUtils.RunCommand(string, string, string, string) Method ##
+## Disposer.Add(IDisposable) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessUtils](#t-net.adamec.lib.common.utils.processutils__tzt3e1)
-Sources: utils\ProcessUtils.cs
-Source-only packages: [RadCommons.utils.ProcessUtils](#src-only-package--RadCommons.utils.ProcessUtils)
+Type: [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
+Sources: utils\Disposer.cs
+Source-only packages: [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
-Synchronously runs a command (process) and returns the standard output or error text
+Adds the disposable object to the disposer.
```csharp
-public static bool RunCommand(string command, string args, string workingDirectory, out string outputOrError)
+public void Add(IDisposable disposable)
```
-Method parameters- string command
- Command to run
- string args
- Command line arguments
- string workingDirectory
- Working directory
- string outputOrError
- OUT: the standard output or error text
-Return value- bool
- True is process runs OK ( outputOrError is standard output) or false in case of exception or command error ( outputOrError is the error output or exception message)
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value- void
### Exceptions ###
-- System.ArgumentException
- command is null or empty
+- System.ArgumentNullException
- disposable is null.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7269,84 +7515,622 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper Class ##
+## Disposer.Dispose(bool) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
+Sources: utils\Disposer.cs
+Source-only packages: [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
-A class the wraps a process, allowing programmatic input and output.
+Internal implementation of dispose - free the managed and native resources.
```csharp
-public class ProcessWrapper
+protected override void Dispose(bool disposing)
```
-Inheritance: object
+Method parameters- bool disposing
- True to dispose both managed and native resources, false to dispose the native resources only.
+Return value- void
Overrides: [BaseDisposable.Dispose(bool)](#m-net.adamec.lib.common.utils.basedisposable.dispose_system.boolean___1vzs8w4)
+
+### Remarks ###
+When disposing the managed objects ( disposing is true), all disposables kept in [disposables](#f-net.adamec.lib.common.utils.disposer.disposables__5cwehn) stack are pop and disposed.
-### Constants ###
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
- | Name | Value | Summary |
- | ------ | ------- | --------- |
- | [OutputWorkerPeriodMs](#f-net.adamec.lib.common.utils.processwrapper.outputworkerperiodms__vrr0db) | 100 | |
-### Fields ###
+## FileUtils Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\FileUtilsCopy.cs
+Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [errorOutputWorker](#f-net.adamec.lib.common.utils.processwrapper.erroroutputworker__16ni2qe) | private | The error output worker. |
- | [errorReader](#f-net.adamec.lib.common.utils.processwrapper.errorreader__q0q33e) | private | The error reader. |
- | [inputWriter](#f-net.adamec.lib.common.utils.processwrapper.inputwriter__1vy4110) | private | The input writer. |
- | [outputReader](#f-net.adamec.lib.common.utils.processwrapper.outputreader__1x6fvbr) | private | The output reader. |
- | [stdOutputWorker](#f-net.adamec.lib.common.utils.processwrapper.stdoutputworker__cmgjmf) | private | The standard output worker. |
-
+File copy utilities
-### Properties ###
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [Command](#p-net.adamec.lib.common.utils.processwrapper.command__fluecw) | public | The command starting the process |
- | [CommandArguments](#p-net.adamec.lib.common.utils.processwrapper.commandarguments__jgk6sk) | public | The command arguments. |
- | [IsProcessRunning](#p-net.adamec.lib.common.utils.processwrapper.isprocessrunning__g9exf9) | public | Returns true when the process is running |
- | [Process](#p-net.adamec.lib.common.utils.processwrapper.process__16lml00) | public | The internal process. |
- | [WorkingDirectory](#p-net.adamec.lib.common.utils.processwrapper.workingdirectory__kyrfvj) | public | The command working directory. |
+```csharp
+internal static class FileUtils
+```
-
+Inheritance: object
-### Events ###
+
+### Methods ###
| Name | Modifier | Summary |
| ------ | ---------- | --------- |
- | [OnProcessExit](#e-net.adamec.lib.common.utils.processwrapper.onprocessexit__qmichq) | public | Occurs when the process ends. |
- | [OnProcessOutput](#e-net.adamec.lib.common.utils.processwrapper.onprocessoutput__m4qoan) | public | Occurs when process output (incl. error stream) is produced. |
+ | [DirectoryCopy(string, string, bool, bool, List<string>)](#m-net.adamec.lib.common.utils.fileutils.directorycopy_system.string-system.string-system.boolean-system.boolean-system.collections.generic.list_system.string____14t7efj) | public static | Copies the source directory to destination directory All files from source directory are copied to the destination directory. The destination directory is created when doesn't exist. recursive parameter set to true let also subdirectories to be copied To overwrite the existing destination files, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path, so applicable to all directories) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown) |
+ | [FileCopy(string, string, bool, List<string>)](#m-net.adamec.lib.common.utils.fileutils.filecopy_system.string-system.string-system.boolean-system.collections.generic.list_system.string____1j72c9b) | public static | Copies the source file to destination file To overwrite the existing destination file, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown) |
-### Constructors ###
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [ProcessWrapper()](#m-net.adamec.lib.common.utils.processwrapper.-ctor__32xh8z) | public | CTOR |
-### Methods ###
+## FileUtils.DirectoryCopy(string, string, bool, bool, List<string>) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y)
+Sources: utils\FileUtilsCopy.cs
+Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [ErrorOutputWorkerDoWorkHandler(object, DoWorkEventArgs)](#m-net.adamec.lib.common.utils.processwrapper.erroroutputworkerdoworkhandler_system.object-system.componentmodel.doworkeventargs___16qj4ty) | private | Handles the DoWork event of the error output worker |
+
+Copies the source directory to destination directory All files from source directory are copied to the destination directory. The destination directory is created when doesn't exist. recursive parameter set to true let also subdirectories to be copied To overwrite the existing destination files, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path, so applicable to all directories) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown)
+
+
+
+```csharp
+public static void DirectoryCopy(string sourceDirectoryName, string destDirectoryName, bool recursive, bool overwrite, List doNotOverwriteFileNames = null)
+```
+
+Method parameters- string sourceDirectoryName
- Full path to the source directory
- string destDirectoryName
- Full path to the destination directory
- bool recursive
- True if the subdirectories are to be copied as well
- bool overwrite
- True to allow overwriting the existing destination files
- List<string> doNotOverwriteFileNames
- Optional list of file names not to be overwritten
+Return value- void
+
+
+### Exceptions ###
+- System.ArgumentNullException
- sourceDirectoryName or destDirectoryName is null.
- System.IO.DirectoryNotFoundException
- sourceDirectoryName doesn't exist.
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## FileUtils.FileCopy(string, string, bool, List<string>) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [FileUtils](#t-net.adamec.lib.common.utils.fileutils__1bi9r8y)
+Sources: utils\FileUtilsCopy.cs
+Source-only packages: [RadCommons.utils.FileUtils.Copy](#src-only-package--RadCommons.utils.FileUtils.Copy)
+
+
+Copies the source file to destination file To overwrite the existing destination file, overwrite must be set to true, otherwise the exception is thrown. When overwrite is set, it's possible to exclude the files by adding the file names (without path) to doNotOverwriteFileNames list. The listed files are being "silently" skipped (no exception thrown)
+
+
+
+```csharp
+public static void FileCopy(string sourceFileName, string destFileName, bool overwrite, List doNotOverwriteFileNames = null)
+```
+
+Method parameters- string sourceFileName
- Full path to the source file
- string destFileName
- Full path to the destination file
- bool overwrite
- True to allow overwriting the existing destination file
- List<string> doNotOverwriteFileNames
- Optional list of file names not to be overwritten
+Return value- void
+
+
+### Exceptions ###
+- System.ArgumentNullException
- sourceFileName or destFileName is null.
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## MarshalExt Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\MarshalExt.cs
+Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+
+
+Marshaling helper methods
+
+
+
+```csharp
+internal static class MarshalExt
+```
+
+Inheritance: object
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [GetDataAsStructure(Type, byte[])](#m-net.adamec.lib.common.utils.marshalext.getdataasstructure_system.type-system.byte_____3ecs3) | public static | Converts the byte array data into the structure of given structureType |
+ | [GetStructureAsData(object)](#m-net.adamec.lib.common.utils.marshalext.getstructureasdata_system.object___1emo3ax) | public static | Get's the structure data byte array |
+
+
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## MarshalExt.GetDataAsStructure(Type, byte[]) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy)
+Sources: utils\MarshalExt.cs
+Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+
+
+Converts the byte array data into the structure of given structureType
+
+
+
+```csharp
+public static object GetDataAsStructure(Type structureType, byte[] data)
+```
+
+Method parameters- System.Type structureType
- byte[] data
+Return value- object
- The structure build from the data or null when the conversion was not successful.
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## MarshalExt.GetStructureAsData(object) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [MarshalExt](#t-net.adamec.lib.common.utils.marshalext__7jyavy)
+Sources: utils\MarshalExt.cs
+Source-only packages: [RadCommons.utils.MarshalExt](#src-only-package--RadCommons.utils.MarshalExt)
+
+
+Get's the structure data byte array
+
+
+
+```csharp
+public static byte[] GetStructureAsData(object sourceStructure)
+```
+
+Method parameters- object sourceStructure
- Source structure
+Return value- byte[]
- Structure data as byte array
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## PeriodicTask Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\PeriodicTask.cs
+Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+
+
+Helper class allowing to execute periodic (or one time) scheduled action
+
+
+
+```csharp
+internal static class PeriodicTask
+```
+
+Inheritance: object
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [RunAsync(Action, TimeSpan, bool)](#m-net.adamec.lib.common.utils.periodictask.runasync_system.action-system.timespan-system.boolean___9mkw46) | public static | Schedule and run the periodic action |
+ | [RunAsync(Action, TimeSpan, CancellationToken, bool)](#m-net.adamec.lib.common.utils.periodictask.runasync_system.action-system.timespan-system.threading.cancellationtoken-system.boolean___uw465x) | public static | Schedule and run the periodic action |
+
+
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## PeriodicTask.RunAsync(Action, TimeSpan, bool) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj)
+Sources: utils\PeriodicTask.cs
+Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+
+
+Schedule and run the periodic action
+
+
+
+```csharp
+public static Task RunAsync(Action action, TimeSpan period, bool oneTimeOnly = false)
+```
+
+Method parameters- System.Action action
- Action to be executed
- System.TimeSpan period
- Period between the individual runs (and even before the first run)
- bool oneTimeOnly
+Return value- System.Threading.Tasks.Task
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## PeriodicTask.RunAsync(Action, TimeSpan, CancellationToken, bool) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [PeriodicTask](#t-net.adamec.lib.common.utils.periodictask__1xfynj)
+Sources: utils\PeriodicTask.cs
+Source-only packages: [RadCommons.utils.PeriodicTask](#src-only-package--RadCommons.utils.PeriodicTask)
+
+
+Schedule and run the periodic action
+
+
+
+```csharp
+public static async Task RunAsync(Action action, TimeSpan period, CancellationToken cancellationToken, bool oneTimeOnly = false)
+```
+
+Method parameters- System.Action action
- Action to be executed
- System.TimeSpan period
- Period between the individual runs (and even before the first run)
- System.Threading.CancellationToken cancellationToken
- Cancellation token used to cancel the (periodic) task execution.
- bool oneTimeOnly
- Flag whether the action should run one time only (after the given period )
+Return value- System.Threading.Tasks.Task
- Async task
+
+
+### Remarks ###
+The cancellationToken interrupts the period/waiting loop, but not the action itself. The method doesn't create any additional thread or worker, it's the responsibility of the caller is needed.
+
+
+### Exceptions ###
+- System.ArgumentNullException
- action , period or cancellationToken is null
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The ProcessEventArgs are arguments for a console event.
+
+
+
+```csharp
+public class ProcessEventArgs : EventArgs
+```
+
+Inheritance: object -> System.EventArgs
+
+
+
+### Properties ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Code](#p-net.adamec.lib.common.utils.processeventargs.code__q4uuts) | public | Gets the process exit code. |
+ | [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) | public | Gets the process input/output content. |
+ | [IsError](#p-net.adamec.lib.common.utils.processeventargs.iserror__1dgcqs1) | public | Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true) |
+
+
+
+
+### Constructors ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [ProcessEventArgs(int, string)](#m-net.adamec.lib.common.utils.processeventargs.-ctor_system.int32-system.string___12x7loh) | public | CTOR with code |
+ | [ProcessEventArgs(string, bool)](#m-net.adamec.lib.common.utils.processeventargs.-ctor_system.string-system.boolean___1ey6l7b) | public | CTOR with content |
+
+
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs.Code Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Gets the process exit code.
+
+
+
+```csharp
+public int Code { get; }
+```
+
+Property value- int
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs.Content Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Gets the process input/output content.
+
+
+
+```csharp
+public string Content { get; }
+```
+
+Property value- string
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs.IsError Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true)
+
+
+
+```csharp
+public bool IsError { get; }
+```
+
+Property value- bool
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs.ProcessEventArgs(int, string) Constructor ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+CTOR with code
+
+
+
+```csharp
+public ProcessEventArgs(int code, string command)
+```
+
+Constructor parameters- int code
- Process exit code
- string command
- Command name to be set to the args [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m)
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessEventArgs.ProcessEventArgs(string, bool) Constructor ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessEventArgs](#t-net.adamec.lib.common.utils.processeventargs__1gw60ix)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+CTOR with content
+
+
+
+```csharp
+public ProcessEventArgs(string content, bool isError = false)
+```
+
+Constructor parameters- string content
- The content output from or input to process
- bool isError
- Flag whether the [Content](#p-net.adamec.lib.common.utils.processeventargs.content__dgou0m) is from error stream (true)
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessUtils Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\ProcessUtils.cs
+Source-only packages: [RadCommons.utils.ProcessUtils](#src-only-package--RadCommons.utils.ProcessUtils)
+
+
+System.Diagnostics.Process related utilities
+
+
+
+```csharp
+internal static class ProcessUtils
+```
+
+Inheritance: object
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [RunCommand(string, string, string, string)](#m-net.adamec.lib.common.utils.processutils.runcommand_system.string-system.string-system.string-system.string-___vsf405) | public static | Synchronously runs a command (process) and returns the standard output or error text |
+
+
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessUtils.RunCommand(string, string, string, string) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessUtils](#t-net.adamec.lib.common.utils.processutils__tzt3e1)
+Sources: utils\ProcessUtils.cs
+Source-only packages: [RadCommons.utils.ProcessUtils](#src-only-package--RadCommons.utils.ProcessUtils)
+
+
+Synchronously runs a command (process) and returns the standard output or error text
+
+
+
+```csharp
+public static bool RunCommand(string command, string args, string workingDirectory, out string outputOrError)
+```
+
+Method parameters- string command
- Command to run
- string args
- Command line arguments
- string workingDirectory
- Working directory
- string outputOrError
- OUT: the standard output or error text
+Return value- bool
- True is process runs OK ( outputOrError is standard output) or false in case of exception or command error ( outputOrError is the error output or exception message)
+
+
+### Exceptions ###
+- System.ArgumentException
- command is null or empty
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper Class ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+A class the wraps a process, allowing programmatic input and output.
+
+
+
+```csharp
+public class ProcessWrapper
+```
+
+Inheritance: object
+
+
+
+### Constants ###
+
+ | Name | Value | Summary |
+ | ------ | ------- | --------- |
+ | [OutputWorkerPeriodMs](#f-net.adamec.lib.common.utils.processwrapper.outputworkerperiodms__vrr0db) | 100 | |
+
+
+
+
+### Fields ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [errorOutputWorker](#f-net.adamec.lib.common.utils.processwrapper.erroroutputworker__16ni2qe) | private | The error output worker. |
+ | [errorReader](#f-net.adamec.lib.common.utils.processwrapper.errorreader__q0q33e) | private | The error reader. |
+ | [inputWriter](#f-net.adamec.lib.common.utils.processwrapper.inputwriter__1vy4110) | private | The input writer. |
+ | [outputReader](#f-net.adamec.lib.common.utils.processwrapper.outputreader__1x6fvbr) | private | The output reader. |
+ | [stdOutputWorker](#f-net.adamec.lib.common.utils.processwrapper.stdoutputworker__cmgjmf) | private | The standard output worker. |
+
+
+
+
+### Properties ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Command](#p-net.adamec.lib.common.utils.processwrapper.command__fluecw) | public | The command starting the process |
+ | [CommandArguments](#p-net.adamec.lib.common.utils.processwrapper.commandarguments__jgk6sk) | public | The command arguments. |
+ | [IsProcessRunning](#p-net.adamec.lib.common.utils.processwrapper.isprocessrunning__g9exf9) | public | Returns true when the process is running |
+ | [Process](#p-net.adamec.lib.common.utils.processwrapper.process__16lml00) | public | The internal process. |
+ | [WorkingDirectory](#p-net.adamec.lib.common.utils.processwrapper.workingdirectory__kyrfvj) | public | The command working directory. |
+
+
+
+
+### Events ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [OnProcessExit](#e-net.adamec.lib.common.utils.processwrapper.onprocessexit__qmichq) | public | Occurs when the process ends. |
+ | [OnProcessOutput](#e-net.adamec.lib.common.utils.processwrapper.onprocessoutput__m4qoan) | public | Occurs when process output (incl. error stream) is produced. |
+
+
+
+
+### Constructors ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [ProcessWrapper()](#m-net.adamec.lib.common.utils.processwrapper.-ctor__32xh8z) | public | CTOR |
+
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [ErrorOutputWorkerDoWorkHandler(object, DoWorkEventArgs)](#m-net.adamec.lib.common.utils.processwrapper.erroroutputworkerdoworkhandler_system.object-system.componentmodel.doworkeventargs___16qj4ty) | private | Handles the DoWork event of the error output worker |
| [OutputWorkerProgressChangedHandler(object, ProgressChangedEventArgs)](#m-net.adamec.lib.common.utils.processwrapper.outputworkerprogresschangedhandler_system.object-system.componentmodel.progresschangedeventargs___2syz2c) | private | Handles the ProgressChanged event of the output worker |
| [ProcessExitedHandler(object, EventArgs)](#m-net.adamec.lib.common.utils.processwrapper.processexitedhandler_system.object-system.eventargs___u7crnb) | private | Handles the Exited event of the currentProcess control. |
| [ProcessOutput(BackgroundWorkerWithSyncCancel, TextReader, bool)](#m-net.adamec.lib.common.utils.processwrapper.processoutput_net.adamec.lib.common.utils.backgroundworkerwithsynccancel-system.io.textreader-system.boolean___132jrkz) | private | Processes the output from standard output or error output stream reader |
@@ -7366,7 +8150,204 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.errorOutputWorker Field ##
+## ProcessWrapper.errorOutputWorker Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The error output worker.
+
+
+
+```csharp
+private readonly BackgroundWorkerWithSyncCancel errorOutputWorker
+```
+
+Field value- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo)
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.errorReader Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The error reader.
+
+
+
+```csharp
+private TextReader errorReader
+```
+
+Field value- System.IO.TextReader
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.inputWriter Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The input writer.
+
+
+
+```csharp
+private StreamWriter inputWriter
+```
+
+Field value- System.IO.StreamWriter
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.outputReader Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The output reader.
+
+
+
+```csharp
+private TextReader outputReader
+```
+
+Field value- System.IO.TextReader
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.OutputWorkerPeriodMs Constant ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+
+```csharp
+private const int OutputWorkerPeriodMs = 100
+```
+
+Field value- int
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.stdOutputWorker Field ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The standard output worker.
+
+
+
+```csharp
+private readonly BackgroundWorkerWithSyncCancel stdOutputWorker
+```
+
+Field value- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo)
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.Command Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The command starting the process
+
+
+
+```csharp
+public string Command { get; private set; }
+```
+
+Property value- string
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.CommandArguments Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+The command arguments.
+
+
+
+```csharp
+public string CommandArguments { get; private set; }
+```
+
+Property value- string
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.IsProcessRunning Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7374,15 +8355,15 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The error output worker.
+Returns true when the process is running
```csharp
-private readonly BackgroundWorkerWithSyncCancel errorOutputWorker
+public bool IsProcessRunning { get; }
```
-Field value- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo)
+Property value- bool
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7391,7 +8372,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.errorReader Field ##
+## ProcessWrapper.Process Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7399,15 +8380,15 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The error reader.
+The internal process.
```csharp
-private TextReader errorReader
+public Process Process { get; private set; }
```
-Field value- System.IO.TextReader
+Property value- System.Diagnostics.Process
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7416,7 +8397,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.inputWriter Field ##
+## ProcessWrapper.WorkingDirectory Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7424,15 +8405,15 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The input writer.
+The command working directory.
```csharp
-private StreamWriter inputWriter
+public string WorkingDirectory { get; private set; }
```
-Field value- System.IO.StreamWriter
+Property value- string
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7441,7 +8422,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.outputReader Field ##
+## ProcessWrapper.OnProcessExit Event ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7449,15 +8430,218 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The output reader.
+Occurs when the process ends.
```csharp
-private TextReader outputReader
+public ProcessEventHandler OnProcessExit
```
-Field value- System.IO.TextReader
+Event handler- [net.adamec.lib.common.utils.ProcessEventHandler](#t-net.adamec.lib.common.utils.processeventhandler__8h5v6w)
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.OnProcessOutput Event ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Occurs when process output (incl. error stream) is produced.
+
+
+
+```csharp
+public ProcessEventHandler OnProcessOutput
+```
+
+Event handler- [net.adamec.lib.common.utils.ProcessEventHandler](#t-net.adamec.lib.common.utils.processeventhandler__8h5v6w)
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.ProcessWrapper() Constructor ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+CTOR
+
+
+
+```csharp
+public ProcessWrapper()
+```
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.ErrorOutputWorkerDoWorkHandler(object, DoWorkEventArgs) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Handles the DoWork event of the error output worker
+
+
+
+```csharp
+private void ErrorOutputWorkerDoWorkHandler(object sender, DoWorkEventArgs e)
+```
+
+Method parameters- object sender
- The source of the event
- System.ComponentModel.DoWorkEventArgs e
- Event data
+Return value- void
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.OutputWorkerProgressChangedHandler(object, ProgressChangedEventArgs) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Handles the ProgressChanged event of the output worker
+
+
+
+```csharp
+private void OutputWorkerProgressChangedHandler(object sender, ProgressChangedEventArgs e)
+```
+
+Method parameters- object sender
- The source of the event
- System.ComponentModel.ProgressChangedEventArgs e
- Event data.
+Return value- void
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.ProcessExitedHandler(object, EventArgs) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Handles the Exited event of the currentProcess control.
+
+
+
+```csharp
+private void ProcessExitedHandler(object sender, EventArgs e)
+```
+
+Method parameters- object sender
- The source of the event.
- System.EventArgs e
- The System.EventArgs instance containing the event data.
+Return value- void
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.ProcessOutput(BackgroundWorkerWithSyncCancel, TextReader, bool) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Processes the output from standard output or error output stream reader
+
+
+
+```csharp
+private void ProcessOutput(BackgroundWorkerWithSyncCancel worker, TextReader reader, bool isError)
+```
+
+Method parameters- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo) worker
- Worker providing the output
- System.IO.TextReader reader
- Standard output or error output stream reader to process
- bool isError
- Flag whether the output is to be marked as error
+Return value- void
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.RaiseProcessExitEvent(int, string) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Raises OnProcessExit event
+
+
+
+```csharp
+private void RaiseProcessExitEvent(int code, string command)
+```
+
+Method parameters- int code
- The exit code
- string command
- Command name to be set to the args Content
+Return value- void
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## ProcessWrapper.RaiseProcessOutputEvent(ProcessWrapper.OutputChunk) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Sources: utils\ProcessWrapper.cs
+Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+
+
+Raises OnProcessOutput event
+
+
+
+```csharp
+private void RaiseProcessOutputEvent(ProcessWrapper.OutputChunk outputChunk)
+```
+
+Method parameters- [net.adamec.lib.common.utils.ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan) outputChunk
- The output from process
+Return value- void
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7466,7 +8650,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OutputWorkerPeriodMs Constant ##
+## ProcessWrapper.StartProcess(string, string, string) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7474,12 +8658,20 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Runs a process with given command
+
+
```csharp
-private const int OutputWorkerPeriodMs = 100
+public bool StartProcess(string command, string arguments = null, string workingDirectory = null)
```
-Field value- int
+Method parameters- string command
- Name of the file to run
- string arguments
- Optional command line arguments
- string workingDirectory
- Optional working directory
+Return value- bool
+
+
+### Exceptions ###
+- System.ArgumentException
- command is null or empty
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7488,7 +8680,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.stdOutputWorker Field ##
+## ProcessWrapper.StdOutputWorkerDoWorkHandler(object, DoWorkEventArgs) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7496,15 +8688,16 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The standard output worker.
+Handles the DoWork event of the standard output worker
```csharp
-private readonly BackgroundWorkerWithSyncCancel stdOutputWorker
+private void StdOutputWorkerDoWorkHandler(object sender, DoWorkEventArgs e)
```
-Field value- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo)
+Method parameters- object sender
- The source of the event
- System.ComponentModel.DoWorkEventArgs e
- Event data
+Return value- void
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7513,7 +8706,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.Command Property ##
+## ProcessWrapper.StopProcess() Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7521,15 +8714,15 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The command starting the process
+Stops the process.
```csharp
-public string Command { get; private set; }
+public void StopProcess()
```
-Property value- string
+Return value- void
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7538,7 +8731,7 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.CommandArguments Property ##
+## ProcessWrapper.WriteInput(string) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
@@ -7546,15 +8739,16 @@ Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The command arguments.
+Writes the input into the process
```csharp
-public string CommandArguments { get; private set; }
+public void WriteInput(string input)
```
-Property value- string
+Method parameters- string input
- The process input
+Return value- void
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7563,23 +8757,42 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.IsProcessRunning Property ##
+## ProcessWrapper.OutputChunk Class ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-Returns true when the process is running
+Internal class to hold the output chunk within the output worker
```csharp
-public bool IsProcessRunning { get; }
+protected class ProcessWrapper.OutputChunk
```
-Property value- bool
+Inheritance: object
+
+
+
+### Properties ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [IsError](#p-net.adamec.lib.common.utils.processwrapper.outputchunk.iserror__1d9rwlz) | public | |
+ | [Output](#p-net.adamec.lib.common.utils.processwrapper.outputchunk.output__1v5g27m) | public | |
+
+
+
+
+### Constructors ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [ProcessWrapper.OutputChunk(bool, string)](#m-net.adamec.lib.common.utils.processwrapper.outputchunk.-ctor_system.boolean-system.string___edttbd) | public | |
+
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7588,23 +8801,20 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.Process Property ##
+## ProcessWrapper.OutputChunk.IsError Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The internal process.
-
-
```csharp
-public Process Process { get; private set; }
+public bool IsError { get; }
```
-Property value- System.Diagnostics.Process
+Property value- bool
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7613,20 +8823,17 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.WorkingDirectory Property ##
+## ProcessWrapper.OutputChunk.Output Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-The command working directory.
-
-
```csharp
-public string WorkingDirectory { get; private set; }
+public string Output { get; }
```
Property value- string
@@ -7638,96 +8845,104 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OnProcessExit Event ##
+## ProcessWrapper.OutputChunk.ProcessWrapper.OutputChunk(bool, string) Constructor ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
+Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
Sources: utils\ProcessWrapper.cs
Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
-Occurs when the process ends.
-
-
```csharp
-public ProcessEventHandler OnProcessExit
+public ProcessWrapper.OutputChunk(bool isError, string output)
```
-Event handler- [net.adamec.lib.common.utils.ProcessEventHandler](#t-net.adamec.lib.common.utils.processeventhandler__8h5v6w)
-
-
+Constructor parameters- bool isError
- string output
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-## ProcessWrapper.OnProcessOutput Event ##
+## Scope<TState> Class ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Occurs when process output (incl. error stream) is produced.
+Base scope implementation.
```csharp
-public ProcessEventHandler OnProcessOutput
+internal class Scope : BaseDisposable, IScope where TState: class, new()
```
-Event handler- [net.adamec.lib.common.utils.ProcessEventHandler](#t-net.adamec.lib.common.utils.processeventhandler__8h5v6w)
+Type parameters- TState
- Type of the state object managed by the scope
+Inheritance: object -> [net.adamec.lib.common.utils.BaseDisposable](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
+Implements: [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf), IDisposable
-Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+### Remarks ###
+The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested, when the scope is disposed, the children are disposed as well. There can be multiple child scopes (siblings) living in parallel. The [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.scope-1.addtodisposer_system.idisposable___154ejbt) method is to be used in inherited classes whenever they manage any disposable resource to ensure the proper life time (when the [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) is System.IDisposable , it's added to disposer automatically). The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) (and [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf) ) to add the scope related operations (inherited classes have the access to [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) ).
-
-## ProcessWrapper.ProcessWrapper() Constructor ##
-Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
-Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+### Constants ###
+ | Name | Value | Summary |
+ | ------ | ------- | --------- |
+ | [ScopeDisposedMessage](#f-net.adamec.lib.common.utils.scope-1.scopedisposedmessage__12oxry0) | The scope has been disposed | Error message that will be put into the exception when there will be any operation on the disposed scope. |
-CTOR
+
+### Fields ###
-```csharp
-public ProcessWrapper()
-```
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [parentScope](#f-net.adamec.lib.common.utils.scope-1.parentscope__h8qyu6) | private | Parent scope. |
+ | [RootInternal](#f-net.adamec.lib.common.utils.scope-1.rootinternal__coycy3) | private static | Instance of the [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) created when the singleton is first touched - root scope with default [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) |
+ | [scopeState](#f-net.adamec.lib.common.utils.scope-1.scopestate__16lomdz) | private | State managed by the scope. |
-Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+### Properties ###
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) | private | Gets the disposer associated with this container. |
+ | [Parent](#p-net.adamec.lib.common.utils.scope-1.parent__1hk8ypk) | public | Gets the parent scope. |
+ | [Root](#p-net.adamec.lib.common.utils.scope-1.root__17hnd9c) | public static | Gets the root scope. |
+ | [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) | protected | Gets the state managed by the scope. |
-## ProcessWrapper.ErrorOutputWorkerDoWorkHandler(object, DoWorkEventArgs) Method ##
-Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
-Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+### Constructors ###
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Scope<TState>()](#m-net.adamec.lib.common.utils.scope-1.-cctor__1t7jr8v) | private static | Static constructor |
+ | [Scope<TState>(IScope<TState>, Scope<TState>.TState)](#m-net.adamec.lib.common.utils.scope-1.-ctor_net.adamec.lib.common.utils.iscope_-0_--0___a63u7z) | protected | Creates an instance of child [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) . |
+ | [Scope<TState>(Scope<TState>.TState)](#m-net.adamec.lib.common.utils.scope-1.-ctor_-0___17usleh) | private | Creates an instance of [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) and initialize its [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) . |
-Handles the DoWork event of the error output worker
+
+### Methods ###
-```csharp
-private void ErrorOutputWorkerDoWorkHandler(object sender, DoWorkEventArgs e)
-```
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.scope-1.addtodisposer_system.idisposable___154ejbt) | protected | Adds the disposable object to the scope disposer, so it will be disposed with the scope |
+ | [BeginScope(Scope<TState>.TState)](#m-net.adamec.lib.common.utils.scope-1.beginscope_-0___1bcz3lp) | public | Creates a child scope of the current scope. |
+ | [DisposeManaged()](#m-net.adamec.lib.common.utils.scope-1.disposemanaged__19g6lc3) | protected | Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) stack are pop and disposed. |
-Method parameters- object sender
- The source of the event
- System.ComponentModel.DoWorkEventArgs e
- Event data
-Return value- void
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7736,24 +8951,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OutputWorkerProgressChangedHandler(object, ProgressChangedEventArgs) Method ##
+## Scope<TState>.parentScope Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Handles the ProgressChanged event of the output worker
+Parent scope.
```csharp
-private void OutputWorkerProgressChangedHandler(object sender, ProgressChangedEventArgs e)
+private readonly IScope parentScope
```
-Method parameters- object sender
- The source of the event
- System.ComponentModel.ProgressChangedEventArgs e
- Event data.
-Return value- void
+Field value- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7762,24 +8976,27 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.ProcessExitedHandler(object, EventArgs) Method ##
+## Scope<TState>.RootInternal Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Handles the Exited event of the currentProcess control.
+Instance of the [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) created when the singleton is first touched - root scope with default [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar)
```csharp
-private void ProcessExitedHandler(object sender, EventArgs e)
+private static readonly Scope RootInternal
```
-Method parameters- object sender
- The source of the event.
- System.EventArgs e
- The System.EventArgs instance containing the event data.
-Return value- void
+Field value- [net.adamec.lib.common.utils.Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+
+
+### Remarks ###
+Not using the auto-property to have better control, when the instance is created
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7788,24 +9005,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.ProcessOutput(BackgroundWorkerWithSyncCancel, TextReader, bool) Method ##
+## Scope<TState>.ScopeDisposedMessage Constant ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Processes the output from standard output or error output stream reader
+Error message that will be put into the exception when there will be any operation on the disposed scope.
```csharp
-private void ProcessOutput(BackgroundWorkerWithSyncCancel worker, TextReader reader, bool isError)
+private const string ScopeDisposedMessage = "The scope has been disposed"
```
-Method parameters- [net.adamec.lib.common.utils.BackgroundWorkerWithSyncCancel](#t-net.adamec.lib.common.utils.backgroundworkerwithsynccancel__1hdlhvo) worker
- Worker providing the output
- System.IO.TextReader reader
- Standard output or error output stream reader to process
- bool isError
- Flag whether the output is to be marked as error
-Return value- void
+Field value- string
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7814,24 +9030,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.RaiseProcessExitEvent(int, string) Method ##
+## Scope<TState>.scopeState Field ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Raises OnProcessExit event
+State managed by the scope.
```csharp
-private void RaiseProcessExitEvent(int code, string command)
+private readonly Scope.TState scopeState
```
-Method parameters- int code
- The exit code
- string command
- Command name to be set to the args Content
-Return value- void
+Field value- net.adamec.lib.common.utils.Scope<TState>.TState
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7840,24 +9055,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.RaiseProcessOutputEvent(ProcessWrapper.OutputChunk) Method ##
+## Scope<TState>.Disposer Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Raises OnProcessOutput event
+Gets the disposer associated with this container.
```csharp
-private void RaiseProcessOutputEvent(ProcessWrapper.OutputChunk outputChunk)
+private Disposer Disposer { get; }
```
-Method parameters- [net.adamec.lib.common.utils.ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan) outputChunk
- The output from process
-Return value- void
+Property value- [net.adamec.lib.common.utils.Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7866,28 +9080,27 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.StartProcess(string, string, string) Method ##
+## Scope<TState>.Parent Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Runs a process with given command
+Gets the parent scope.
```csharp
-public bool StartProcess(string command, string arguments = null, string workingDirectory = null)
+public IScope Parent { get; }
```
-Method parameters- string command
- Name of the file to run
- string arguments
- Optional command line arguments
- string workingDirectory
- Optional working directory
-Return value- bool
+Property value- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
Implements: [IScope<TState>.Parent](#p-net.adamec.lib.common.utils.iscope-1.parent__iyc99h)
### Exceptions ###
-- System.ArgumentException
- command is null or empty
+- System.ObjectDisposedException
- The current scope has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7896,24 +9109,23 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.StdOutputWorkerDoWorkHandler(object, DoWorkEventArgs) Method ##
+## Scope<TState>.Root Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Handles the DoWork event of the standard output worker
+Gets the root scope.
```csharp
-private void StdOutputWorkerDoWorkHandler(object sender, DoWorkEventArgs e)
+public static Scope Root { get; }
```
-Method parameters- object sender
- The source of the event
- System.ComponentModel.DoWorkEventArgs e
- Event data
-Return value- void
+Property value- [net.adamec.lib.common.utils.Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7922,23 +9134,27 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.StopProcess() Method ##
+## Scope<TState>.State Property ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Stops the process.
+Gets the state managed by the scope.
```csharp
-public void StopProcess()
+protected Scope.TState State { get; }
```
-Return value- void
+Property value- net.adamec.lib.common.utils.Scope<TState>.TState
+
+
+### Exceptions ###
+- System.ObjectDisposedException
- The current scope has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7947,24 +9163,24 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.WriteInput(string) Method ##
+## Scope<TState>.Scope<TState>() Constructor ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper](#t-net.adamec.lib.common.utils.processwrapper__1oqe83p)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Writes the input into the process
+Static constructor
```csharp
-public void WriteInput(string input)
+private static Scope()
```
-Method parameters- string input
- The process input
-Return value- void
+### Remarks ###
+Explicit static constructor to tell C# compiler not to mark type as beforefieldinit
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -7973,64 +9189,74 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OutputChunk Class ##
+## Scope<TState>.Scope<TState>(IScope<TState>, Scope<TState>.TState) Constructor ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-Internal class to hold the output chunk within the output worker
+Creates an instance of child [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) .
```csharp
-protected class ProcessWrapper.OutputChunk
+protected Scope(IScope parent, Scope.TState state = null)
```
-Inheritance: object
-
+Constructor parameters- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf) parent
- Parent scope
- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the scope.
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-### Properties ###
+
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [IsError](#p-net.adamec.lib.common.utils.processwrapper.outputchunk.iserror__1d9rwlz) | public | |
- | [Output](#p-net.adamec.lib.common.utils.processwrapper.outputchunk.output__1v5g27m) | public | |
-
+## Scope<TState>.Scope<TState>(Scope<TState>.TState) Constructor ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
-### Constructors ###
+Creates an instance of [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) and initialize its [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) .
- | Name | Modifier | Summary |
- | ------ | ---------- | --------- |
- | [ProcessWrapper.OutputChunk(bool, string)](#m-net.adamec.lib.common.utils.processwrapper.outputchunk.-ctor_system.boolean-system.string___edttbd) | public | |
-
+```csharp
+private Scope(Scope.TState state = null)
+```
+Constructor parameters- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the scope.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
-## ProcessWrapper.OutputChunk.IsError Property ##
+## Scope<TState>.AddToDisposer(IDisposable) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Adds the disposable object to the scope disposer, so it will be disposed with the scope
```csharp
-public bool IsError { get; }
+protected void AddToDisposer(IDisposable disposable)
```
-Property value- bool
+Method parameters- IDisposable disposable
- System.IDisposable object to be added to the disposer.
+Return value- void
+
+
+### Exceptions ###
+- System.ArgumentNullException
- disposable is null.
- System.ObjectDisposedException
- The current scope has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -8039,20 +9265,28 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OutputChunk.Output Property ##
+## Scope<TState>.BeginScope(Scope<TState>.TState) Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Creates a child scope of the current scope.
```csharp
-public string Output { get; }
+public IScope BeginScope(Scope.TState state = null)
```
-Property value- string
+Method parameters- net.adamec.lib.common.utils.Scope<TState>.TState state
- Optional state managed by the child scope..
+Return value- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
- Child scope owned by the current scope.
Implements: [IScope<TState>.BeginScope(IScope<TState>.TState)](#m-net.adamec.lib.common.utils.iscope-1.beginscope_-0___1d7nxoa)
+
+
+### Exceptions ###
+- System.ObjectDisposedException
- The current scope has been disposed.
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -8061,20 +9295,25 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
-## ProcessWrapper.OutputChunk.ProcessWrapper.OutputChunk(bool, string) Constructor ##
+## Scope<TState>.DisposeManaged() Method ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
-Type: [ProcessWrapper.OutputChunk](#t-net.adamec.lib.common.utils.processwrapper.outputchunk__o3evan)
-Sources: utils\ProcessWrapper.cs
-Source-only packages: [RadCommons.utils.ProcessWrapper](#src-only-package--RadCommons.utils.ProcessWrapper)
+Type: [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) stack are pop and disposed.
```csharp
-public ProcessWrapper.OutputChunk(bool isError, string output)
+protected override void DisposeManaged()
```
-Constructor parameters- bool isError
- string output
+Return value- void
Overrides: [BaseDisposable.DisposeManaged()](#m-net.adamec.lib.common.utils.basedisposable.disposemanaged__1ht3p85)
+
+
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -8570,6 +9809,101 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## IScope<TState> Interface ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Scope interface.
+
+
+
+```csharp
+internal interface IScope : IDisposable where TState: class, new()
+```
+
+Type parameters- TState
- Type of the state object managed by the scope
+Implemented by: [net.adamec.lib.common.utils.Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
+Implements: IDisposable
+
+
+### Properties ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [Parent](#p-net.adamec.lib.common.utils.iscope-1.parent__iyc99h) | public abstract | Gets the parent scope. |
+
+
+
+
+### Methods ###
+
+ | Name | Modifier | Summary |
+ | ------ | ---------- | --------- |
+ | [BeginScope(IScope<TState>.TState)](#m-net.adamec.lib.common.utils.iscope-1.beginscope_-0___1d7nxoa) | public abstract | Creates a child scope of the current scope. |
+
+
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## IScope<TState>.Parent Property ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Gets the parent scope.
+
+
+
+```csharp
+public abstract IScope Parent { get; }
+```
+
+Property value- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## IScope<TState>.BeginScope(IScope<TState>.TState) Method ##
+Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
+Assembly: net.adamec.lib.common
+Type: [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
+Sources: utils\Scope.cs
+Source-only packages: [RadCommons.utils.Scope](#src-only-package--RadCommons.utils.Scope)
+
+
+Creates a child scope of the current scope.
+
+
+
+```csharp
+public abstract IScope BeginScope(IScope.TState state)
+```
+
+Method parameters- net.adamec.lib.common.utils.IScope<TState>.TState state
- State managed by the child scope.
+Return value- [net.adamec.lib.common.utils.IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
- Child scope owned by the current scope.
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## ProcessEventHandler Delegate ##
Namespace: [net.adamec.lib.common.utils](#n-net.adamec.lib.common.utils__7vdji9)
Assembly: net.adamec.lib.common
@@ -8657,6 +9991,22 @@ Simple configuration container in case DI with more sophisticated containers is
Usings- [RadCommons.logging.CommonLogging](#src-only-package--RadCommons.logging.CommonLogging)
+### Remarks ###
+This is the simple configuration container in case DI with more sophisticated containers is not used The configuration is stored as the key-value dictionary, supporting hierarchy using the dot separator and arrays.The arrays can contain values or another objects. Actually, mixed arrays of values and objects can be stored, but they are not supported for binding. For example `section1.option1` means the option1 available in section1, `section1.subSection2.option1` means the option1 available in section1.subSection2. `section1.option1[0]` means, that the option1 is array of values or objects (sections) within the section1. For arrays, the keys are like `OtherSection.SimpleArray[0]` or `OtherSection.ComplexObjectArray[0].Name`
+
+ [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) class provides a singleton instance, however the key functionality is provided via static functions, so no need to touch the [Instance](#p-net.adamec.lib.common.config.configuration.instance__131avv7) at all. The items can be retrieved by key using the [Get(string)](#m-net.adamec.lib.common.config.configuration.get_system.string___8ykaxa) and [Get<TValueType>(string, Configuration.TValueType)](#m-net.adamec.lib.common.config.configuration.get--1_system.string---0___1dcpnhz) methods. The first one returns null when the key is not found, the other one allow to define the default value to be returned, when the item is not found.
+
+ The inner class [Configuration.ConfigurationBuilder](#t-net.adamec.lib.common.config.configuration.configurationbuilder__13eawwj) provides the methods to build the configuration from JSON config files, commandline arguments, environment values and/or direct entries. The static method [Builder()](#m-net.adamec.lib.common.config.configuration.builder__700lxw) clears the configuration items and binding cache and creates a new instance of [Configuration.ConfigurationBuilder](#t-net.adamec.lib.common.config.configuration.configurationbuilder__13eawwj) allowing to build a configuration from scratch. The configuration is updated directly during the calls to builder methods, the existing items (keys) are updated, so it's possible to manage the priority of individual sources and the overrides if needed. The method [Build()](#m-net.adamec.lib.common.config.configuration.configurationbuilder.build__bwvls6) returns the configuration instance, breaking the fluent design of builder methods, however there is no other functionality within the method, so it's more the convention than need to use it at the end of configuration build.
+
+ Configuration binding it the way, how to access the configuration using the configuration objects instead of querying the individual items by key. When the method [Bind<TOptionsContainer>(string, bool)](#m-net.adamec.lib.common.config.configuration.bind--1_system.string-system.boolean___16p0943) is used, it creates a new instance of given type and tries to map the public properties with public setter to the keys (using the "dot notation") within the [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) . It's possible to bind the object to to the root of the configuration to provide the whole configuration at once or bind it to the particular section to provide a configuration sub-tree. In general, the nested objects and both value and object arrays are supported. There are some rules when binding the arrays: The index must start with zero and must be in sequence (the first non-existing index stops the evaluation). The array should not mix the array or values and array of objects. The decision is made at the first item (index=0) whether it's value or object.
+
+ The implementation of binding treats the System.Boolean values the special way - if there is no value, but existing key, the value is converted to true. This is useful when the command line arguments are used like flags. For example having the argument `-p:SkipStep1` and prefix `-p:` , the binding a bool property `SkipStep1` will set the value of the property to `true` (doesn't change the configuration item itself). Of course, it's still possible to use the syntax `-p:SkipStep1=true` or `-p:SkipStep1=false` even in this case.
+
+ As the binding uses the reflection, it's quite expensive operation, so by default, the bound objects are cached (the cache key is the type of bound object, so binding the same type to different sections is not recommended ). It's possible to force the binding using the parameter of [Bind<TOptionsContainer>(string, bool)](#m-net.adamec.lib.common.config.configuration.bind--1_system.string-system.boolean___16p0943) method. In general, the recommended pattern is to [Bind<TOptionsContainer>(string, bool)](#m-net.adamec.lib.common.config.configuration.bind--1_system.string-system.boolean___16p0943) the configuration object after the configuration is built and then [Retrieve<TOptionsContainer>()](#m-net.adamec.lib.common.config.configuration.retrieve--1__1xuxip8) it from the cache when needed.
+
+
+
+
Package members- [Configuration (Type)](#t-net.adamec.lib.common.config.configuration__1md5nwk)
- Singleton holding the application configuration (options)
- [instance (Field)](#f-net.adamec.lib.common.config.configuration.instance__1aq1w9t)
- Instance of the [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) created when the singleton is first touched
- [Instance (Property)](#p-net.adamec.lib.common.config.configuration.instance__131avv7)
- Public [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) instance
- [Configuration() (Method)](#m-net.adamec.lib.common.config.configuration.-cctor__1xl390h)
- Static constructor
- [Configuration() (Method)](#m-net.adamec.lib.common.config.configuration.-ctor__11tp9ak)
- Private constructor used to build the singleton instance
- [Items (Property)](#p-net.adamec.lib.common.config.configuration.items__1i9u236)
- Configuration items stored as key-value pairs
- [Get(string) (Method)](#m-net.adamec.lib.common.config.configuration.get_system.string___8ykaxa)
- Gets the configuration item by key
- [Get<TValueType>(string, Configuration.TValueType) (Method)](#m-net.adamec.lib.common.config.configuration.get--1_system.string---0___1dcpnhz)
- Gets the typed configuration item by key . Returns the default value, that can be provided or is default to given TValueType The function tries to convert the value to TValueType using System.Convert.ChangeType(System.Object,System.Type) if the conversion is not successful, the default is returned.
- [bindingsCache (Field)](#f-net.adamec.lib.common.config.configuration.bindingscache__thj354)
- Cache for bindings. Dictionary of type bound as a key and the bound object as value.
- [Bind<TOptionsContainer>(string, bool) (Method)](#m-net.adamec.lib.common.config.configuration.bind--1_system.string-system.boolean___16p0943)
- Binds the configuration to given TOptionsContainer type and returns the bound object of such type. The resulting configuration object is stored to the cache and can be later on retrieved using [Retrieve<TOptionsContainer>()](#m-net.adamec.lib.common.config.configuration.retrieve--1__1xuxip8)
- [Retrieve<TOptionsContainer>() (Method)](#m-net.adamec.lib.common.config.configuration.retrieve--1__1xuxip8)
- Retrieves the configuration object of given TOptionsContainer that has been bound and cached before. The new instance of TOptionsContainer is created when the type not found in cache
- [Bind(Type, string) (Method)](#m-net.adamec.lib.common.config.configuration.bind_system.type-system.string___1b0yb6e)
- Creates a new object with given type and binds the configuration to its public properties where possible.
- [GetSection(string) (Method)](#m-net.adamec.lib.common.config.configuration.getsection_system.string___17z37ez)
- Gets the configuration sub-tree that belongs to given section. The keys returned are relative to given section! When the section is not provided, the whole configuration tree is returned.
- [TryConvertValue(Type, object, object) (Method)](#m-net.adamec.lib.common.config.configuration.tryconvertvalue_system.type-system.object-system.object-___1f1lwmk)
- Tries to convert sourceValue to targetType . The converted values is returned in targetValue out parameter, the result of conversion is the function return value.
- [AddOrUpdateItem(string, object) (Method)](#m-net.adamec.lib.common.config.configuration.addorupdateitem_system.string-system.object___1atv1og)
- Add a new configuration item with given value or updates its value if the key already exists.
- [Builder() (Method)](#m-net.adamec.lib.common.config.configuration.builder__700lxw)
- Clears the configuration items and binding cache and creates a new instance of [Configuration.ConfigurationBuilder](#t-net.adamec.lib.common.config.configuration.configurationbuilder__13eawwj)
- [Configuration.ConfigurationBuilder (Type)](#t-net.adamec.lib.common.config.configuration.configurationbuilder__13eawwj)
- Configuration builder providing the methods for adding the configuration items from individual sources
- [Build() (Method)](#m-net.adamec.lib.common.config.configuration.configurationbuilder.build__bwvls6)
- Finishes the configuration building and returns the [Instance](#p-net.adamec.lib.common.config.configuration.instance__131avv7)
- [Add(string, object) (Method)](#m-net.adamec.lib.common.config.configuration.configurationbuilder.add_system.string-system.object___t030mu)
- Add a new configuration item with given value or updates its value if the key already exists.
- [AddEnvironmentVariables() (Method)](#m-net.adamec.lib.common.config.configuration.configurationbuilder.addenvironmentvariables__1behrcd)
- Adds all environment variables into the [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) . When a configuration item exists, the value is updated.
- [AddCommandLineArguments(string[]) (Method)](#m-net.adamec.lib.common.config.configuration.configurationbuilder.addcommandlinearguments_system.string_____f7vkq1)
- Adds the command line arguments starting with prefixes into the [Configuration](#t-net.adamec.lib.common.config.configuration__1md5nwk) . When a configuration item exists, the value is updated.
- [AddJsonFile(string, bool, bool) (Method)](#m-net.adamec.lib.common.config.configuration.configurationbuilder.addjsonfile_system.string-system.boolean-system.boolean___fpcrpi)
- Loads the configuration items from JSON file, keeping the hierarchy of JSON objects (and arrays) When a configuration item exists, the value is updated.
@@ -8750,6 +10100,27 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## RadCommons.extensions.ArrayExtensions.ConcatenateBytes Source only package ##
+Tags: RadCommons source-only extension array
+Includes: None
+Declaring file: extensions\ArrayExtensionsAppendBytes.cs
+
+
+Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one) (Source only package).
+
+
+Package members- [ArrayExtensions (Type)](#t-net.adamec.lib.common.extensions.arrayextensions__icw7wf)
- Array extensions
- [AppendBytes(byte[], byte[]) (Method)](#m-net.adamec.lib.common.extensions.arrayextensions.appendbytes_system.byte__-system.byte_____1lkijjg)
- Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one)
+
+
+Sources- extensions\ArrayExtensionsAppendBytes.cs
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## RadCommons.extensions.ArrayExtensions.Fill Source only package ##
Tags: RadCommons source-only extension array
Includes: None
@@ -8951,10 +10322,80 @@ RadCommons logging wrapper around NLog with some extended functionality (Source
References needed- NLog
-Package members- [CommonLogging (Type)](#t-net.adamec.lib.common.logging.commonlogging__1dar5wb)
- [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) factory
- [CreateLogger(string) (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger_system.string___wn77if)
- Creates the logger with given categoryName
- [CreateLogger(Type) (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger_system.type___uhum9e)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- [CreateLogger<T>() (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger--1__lp2vax)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [Trace(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___15kc02k)
- Writes the diagnostic message at the `Trace` level.
- [Debug(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___jxdraq)
- Writes the diagnostic message at the `Debug` level.
- [Info(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1kbhewr)
- Writes the diagnostic message at the `Info` level.
- [Warn(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___1hy0rp3)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.string___kfa9gl)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1yxmkzz)
- Writes the diagnostic message at the `Fatal` level.
- [Warn(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___10z37vj)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___1watp5d)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___175gumn)
- Writes the diagnostic message at the `Fatal` level.
- [ErrorPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorpassthrough_system.exception-system.string___1vc33gk)
- Writes the diagnostic message at the `Error` level and returns given exception
- [FatalPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalpassthrough_system.exception-system.string___1fx8xs8)
- Writes the diagnostic message at the `Fatal` level and returns given exception
- [Error<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.error--1_system.string-system.exception___pmrssh)
- Writes the diagnostic message at the `Error` level. Creates and returns the exception of given type
- [Fatal<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal--1_system.string-system.exception___x5u73)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
- [ErrorFltr<TException>(ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorfltr--1_--0-system.string-system.boolean___135nosm)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltr<TException>(ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalfltr--1_--0-system.string-system.boolean___1av7ixa)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [TraceCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.tracecorr_system.string-system.string___1bdni2z)
- Writes the diagnostic message at the `Trace` level with correlation ID.
- [DebugCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.debugcorr_system.string-system.string___aozvfj)
- Writes the diagnostic message at the `Debug` level with correlation ID.
- [InfoCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.infocorr_system.string-system.string___2iypny)
- Writes the diagnostic message at the `Info` level with correlation ID.
- [WarnCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warncorr_system.string-system.string___pr2tiu)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr_system.string-system.string___coifvu)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr_system.string-system.string___ufcx32)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [WarnCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warncorr_system.string-system.exception-system.string___1kh0i9m)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr_system.string-system.exception-system.string___1qll13u)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr_system.string-system.exception-system.string___yt34nm)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [ErrorCorr<TException>(string, ILogger.TException, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr--1_system.string---0-system.string___eypxkv)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalCorr<TException>(string, ILogger.TException, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr--1_system.string---0-system.string___108vdu1)
- Writes the diagnostic message at the `Fatal` level and returns the exception of given type
- [ErrorCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr--1_system.string-system.string-system.exception___91akh7)
- Writes the diagnostic message at the `Error` level with correlation ID. Creates and returns the exception of given type
- [FatalCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr--1_system.string-system.string-system.exception___1hlu7x)
- Writes the diagnostic message at the `Fatal` level with correlation ID. Creates and returns the exception of given type
- [ErrorFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorfltrcorr--1_system.string---0-system.string-system.boolean___1spds2w)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalfltrcorr--1_system.string---0-system.string-system.boolean___a9m338)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) extensions
- [Trace(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___1k5wn70)
- Writes the diagnostic message at the `Trace` level.
- [Debug(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___by66ma)
- Writes the diagnostic message at the `Debug` level.
- [Info(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1qxds6b)
- Writes the diagnostic message at the `Info` level.
- [Warn(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___wuc2dz)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.error_system.collections.generic.dictionary_system.string-system.object_-system.string___u5pc5h)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1ff2uef)
- Writes the diagnostic message at the `Fatal` level.
- [Warn(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___8kyvvj)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___7fy00h)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___pw9hcn)
- Writes the diagnostic message at the `Fatal` level.
- [ErrorPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorpassthrough_system.exception-system.string___1ey2kd0)
- Writes the diagnostic message at the `Error` level and returns given exception
- [FatalPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalpassthrough_system.exception-system.string___10psm2o)
- Writes the diagnostic message at the `Fatal` level and returns given exception >
- [Error<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.error--1_system.string-system.exception___1qowqgx)
- Writes the diagnostic message at the `Error` level. Creates and returns the exception of given type
- [Fatal<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal--1_system.string-system.exception___1myw0tj)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
- [CreateException<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.createexception--1_system.string-system.exception___1wtd924)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
- [ErrorFltr<TException>(LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorfltr--1_--0-system.string-system.boolean___ipfsfa)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltr<TException>(LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalfltr--1_--0-system.string-system.boolean___5rdjqe)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [TraceCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.tracecorr_system.string-system.string___1e218kz)
- Writes the diagnostic message at the `Trace` level with correlation ID
- [DebugCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.debugcorr_system.string-system.string___i119af)
- Writes the diagnostic message at the `Debug` level with correlation ID.
- [InfoCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.infocorr_system.string-system.string___3vobha)
- Writes the diagnostic message at the `Info` level with correlation ID.
- [WarnCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warncorr_system.string-system.string___cfr64e)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr_system.string-system.string___1vt0qk2)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr_system.string-system.string___c131ta)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [WarnCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warncorr_system.string-system.exception-system.string___sfdb1u)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr_system.string-system.exception-system.string___1tdd1hu)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr_system.string-system.exception-system.string___1q1adwi)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [ErrorCorr<TException>(string, LoggerExt.TException, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr--1_system.string---0-system.string___bk3vj3)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalCorr<TException>(string, LoggerExt.TException, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr--1_system.string---0-system.string___17i1735)
- Writes the diagnostic message at the `Fatal` level and returns the exception of given type
- [ErrorCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr--1_system.string-system.string-system.exception___4hcjn7)
- Writes the diagnostic message at the `Error` level with correlation ID. Creates and returns the exception of given type
- [FatalCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr--1_system.string-system.string-system.exception___w1l5gt)
- Writes the diagnostic message at the `Fatal` level with correlation ID. Creates and returns the exception of given type
- [ErrorFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorfltrcorr--1_system.string---0-system.string-system.boolean___84xqu8)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalfltrcorr--1_system.string---0-system.string-system.boolean___15t2hh0)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [LogIt(LogLevel, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.exception___hxtfrf)
- Writes the item (message with optional exception) into the log
- [LogIt(LogLevel, string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.string-system.exception___1l4ejwt)
- Writes the item (message with optional exception) with correlation Id into the log
- [LogIt(LogLevel, Dictionary<string,object>, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.collections.generic.dictionary_system.string-system.object_-system.string-system.exception___5yngu4)
- Writes the item (message with optional event properties and exception) into the log
+### Remarks ###
+The NLog supports having additional (custom) event properties provided to loggers and optionally rendered to logs. The event properties are represented as key-value dictionary, where key is the unique name of the property. Extended logger provides following methods to log with given set of the properties.
+
+
+
+
+ - [Trace(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___15kc02k) ,
+ - [Debug(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___jxdraq) ,
+ - [Info(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1kbhewr) ,
+ - [Warn(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___1hy0rp3) ,
+ - [Error(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.string___kfa9gl) ,
+ - [Fatal(Dictionary<string,object>, string)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1yxmkzz) ,
+ - [Warn(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___10z37vj) ,
+ - [Error(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___1watp5d) and
+ - [Fatal(Dictionary<string,object>, Exception, string)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___175gumn)
+
+
+
+
+
+ Sometimes, it's useful to have an exception logging method implemented as the operation returning the exception being logged. The [ErrorPassThrough(Exception, string)](#m-net.adamec.lib.common.logging.ilogger.errorpassthrough_system.exception-system.string___1vc33gk) and [FatalPassThrough(Exception, string)](#m-net.adamec.lib.common.logging.ilogger.fatalpassthrough_system.exception-system.string___1fx8xs8) methods will log given exception and return it for further processing.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (Exception ex){
+ if(logger.ErrorPassThrough(ex) is MyException){
+ return null;
+ }else{
+ throw;
+ }
+ }
+```
+ In the example above, the exception is always logged and then the decision/action is taken.
+
+ C# 6 brought the exception filters that don't unwind the stack as the exception is not catch yet when processing the filter. It can also be used for logging the exceptions without actually catching them (when the exception filter returns `false` ). Extended logger provides functions [ErrorFltr<TException>(ILogger.TException, string, bool)](#m-net.adamec.lib.common.logging.ilogger.errorfltr--1_--0-system.string-system.boolean___135nosm) and [FatalFltr<TException>(ILogger.TException, string, bool)](#m-net.adamec.lib.common.logging.ilogger.fatalfltr--1_--0-system.string-system.boolean___1av7ixa) for this purpose.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (Exception ex) when (logger.ErrorFltr(ex,"Error here!"){
+ //newer called as the default return value of ErrorFltr is false
+ }
+```
+ The example above logs but never catch all exceptions. The following code catch and log the ArgumentException and logs any other exception without catching it.
+```csharp
+ try
+ {
+ ...
+ }
+ catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) { ... }
+ catch (Exception e) when (Logger.FatalFltr(e)) {}
+```
+
+
+ Logger can also create and exception, log it and return using functions [Error<TException>(string, Exception)](#m-net.adamec.lib.common.logging.ilogger.error--1_system.string-system.exception___pmrssh) and [Fatal<TException>(string, Exception)](#m-net.adamec.lib.common.logging.ilogger.fatal--1_system.string-system.exception___x5u73)
+```csharp
+ if(value is null) throw logger.Fatal("Value is null");
+```
+
+
+ When logging an exception using the [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) methods, the event property `StackTrace` is set from System.Exception.StackTrace , when the logger creates an exception, the property is set using `new StackTrace(2, true).ToString()` . In other cases when the System.Exception.StackTrace is null or empty, `new StackTrace(true).ToString()` is used.
+
+ [LoggerExt](#t-net.adamec.lib.common.logging.loggerext__ac9km2) also provides set of methods for logging with the correlation ID (for example in integration scenarios), where the given correlation ID is set to the event property `CorrelationId` . Such methods have the name ending with `Corr` suffix.
+
+
-Sources- logging\_SourceOnlyPackage.cs
- logging\CommonLogging.cs
- logging\ILogger.cs
- logging\LoggerExt.cs
+Package members- [CommonLogging (Type)](#t-net.adamec.lib.common.logging.commonlogging__1dar5wb)
- [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm) factory
- [CreateLogger(string) (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger_system.string___wn77if)
- Creates the logger with given categoryName
- [CreateLogger(Type) (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger_system.type___uhum9e)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- [CreateLogger<T>() (Method)](#m-net.adamec.lib.common.logging.commonlogging.createlogger--1__lp2vax)
- Creates the logger for given type. The name of the logger will be System.Type.FullName
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [TraceCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.tracecorr_system.string-system.string___1bdni2z)
- Writes the diagnostic message at the `Trace` level with correlation ID.
- [DebugCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.debugcorr_system.string-system.string___aozvfj)
- Writes the diagnostic message at the `Debug` level with correlation ID.
- [InfoCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.infocorr_system.string-system.string___2iypny)
- Writes the diagnostic message at the `Info` level with correlation ID.
- [WarnCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warncorr_system.string-system.string___pr2tiu)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr_system.string-system.string___coifvu)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr_system.string-system.string___ufcx32)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [WarnCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warncorr_system.string-system.exception-system.string___1kh0i9m)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr_system.string-system.exception-system.string___1qll13u)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr_system.string-system.exception-system.string___yt34nm)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [ErrorCorr<TException>(string, ILogger.TException, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr--1_system.string---0-system.string___eypxkv)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalCorr<TException>(string, ILogger.TException, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr--1_system.string---0-system.string___108vdu1)
- Writes the diagnostic message at the `Fatal` level and returns the exception of given type
- [ErrorCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorcorr--1_system.string-system.string-system.exception___91akh7)
- Writes the diagnostic message at the `Error` level with correlation ID. Creates and returns the exception of given type
- [FatalCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalcorr--1_system.string-system.string-system.exception___1hlu7x)
- Writes the diagnostic message at the `Fatal` level with correlation ID. Creates and returns the exception of given type
- [ErrorFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorfltrcorr--1_system.string---0-system.string-system.boolean___1spds2w)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltrCorr<TException>(string, ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalfltrcorr--1_system.string---0-system.string-system.boolean___a9m338)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [Trace(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___15kc02k)
- Writes the diagnostic message at the `Trace` level.
- [Debug(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___jxdraq)
- Writes the diagnostic message at the `Debug` level.
- [Info(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1kbhewr)
- Writes the diagnostic message at the `Info` level.
- [Warn(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___1hy0rp3)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.string___kfa9gl)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1yxmkzz)
- Writes the diagnostic message at the `Fatal` level.
- [Warn(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___10z37vj)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___1watp5d)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___175gumn)
- Writes the diagnostic message at the `Fatal` level.
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [ErrorFltr<TException>(ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorfltr--1_--0-system.string-system.boolean___135nosm)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltr<TException>(ILogger.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalfltr--1_--0-system.string-system.boolean___1av7ixa)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [ILogger (Type)](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- Logger interface - wrapper around the NLog.ILogger with some additional methods
- [ErrorPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.errorpassthrough_system.exception-system.string___1vc33gk)
- Writes the diagnostic message at the `Error` level and returns given exception
- [FatalPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatalpassthrough_system.exception-system.string___1fx8xs8)
- Writes the diagnostic message at the `Fatal` level and returns given exception
- [Error<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.error--1_system.string-system.exception___pmrssh)
- Writes the diagnostic message at the `Error` level. Creates and returns the exception of given type
- [Fatal<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.ilogger.fatal--1_system.string-system.exception___x5u73)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- [TraceCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.tracecorr_system.string-system.string___1e218kz)
- Writes the diagnostic message at the `Trace` level with correlation ID
- [DebugCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.debugcorr_system.string-system.string___i119af)
- Writes the diagnostic message at the `Debug` level with correlation ID.
- [InfoCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.infocorr_system.string-system.string___3vobha)
- Writes the diagnostic message at the `Info` level with correlation ID.
- [WarnCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warncorr_system.string-system.string___cfr64e)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr_system.string-system.string___1vt0qk2)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr_system.string-system.string___c131ta)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [WarnCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warncorr_system.string-system.exception-system.string___sfdb1u)
- Writes the diagnostic message at the `Warn` level with correlation ID.
- [ErrorCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr_system.string-system.exception-system.string___1tdd1hu)
- Writes the diagnostic message at the `Error` level with correlation ID.
- [FatalCorr(string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr_system.string-system.exception-system.string___1q1adwi)
- Writes the diagnostic message at the `Fatal` level with correlation ID.
- [ErrorCorr<TException>(string, LoggerExt.TException, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr--1_system.string---0-system.string___bk3vj3)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalCorr<TException>(string, LoggerExt.TException, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr--1_system.string---0-system.string___17i1735)
- Writes the diagnostic message at the `Fatal` level and returns the exception of given type
- [ErrorCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorcorr--1_system.string-system.string-system.exception___4hcjn7)
- Writes the diagnostic message at the `Error` level with correlation ID. Creates and returns the exception of given type
- [FatalCorr<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalcorr--1_system.string-system.string-system.exception___w1l5gt)
- Writes the diagnostic message at the `Fatal` level with correlation ID. Creates and returns the exception of given type
- [ErrorFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorfltrcorr--1_system.string---0-system.string-system.boolean___84xqu8)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltrCorr<TException>(string, LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalfltrcorr--1_system.string---0-system.string-system.boolean___15t2hh0)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [LogIt(LogLevel, string, string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.string-system.exception-system.string___14n4i77)
- Writes the item (message with optional exception) with correlation Id into the log
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- [CreateException<TException>(string, string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.createexception--1_system.string-system.string--system.exception___1kt7m7i)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
- [LogIt(LogLevel, string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.string-system.exception-system.string___17r766x)
- Writes the item (message with optional exception) into the log
- [LogIt(LogLevel, Dictionary<string,object>, string, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.logit_nlog.loglevel-system.collections.generic.dictionary_system.string-system.object_-system.string-system.exception-system.string___vo1jng)
- Writes the item (message with optional event properties and exception) into the log
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- [Trace(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.trace_system.collections.generic.dictionary_system.string-system.object_-system.string___1k5wn70)
- Writes the diagnostic message at the `Trace` level.
- [Debug(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.debug_system.collections.generic.dictionary_system.string-system.object_-system.string___by66ma)
- Writes the diagnostic message at the `Debug` level.
- [Info(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.info_system.collections.generic.dictionary_system.string-system.object_-system.string___1qxds6b)
- Writes the diagnostic message at the `Info` level.
- [Warn(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warn_system.collections.generic.dictionary_system.string-system.object_-system.string___wuc2dz)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.error_system.collections.generic.dictionary_system.string-system.object_-system.string___u5pc5h)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal_system.collections.generic.dictionary_system.string-system.object_-system.string___1ff2uef)
- Writes the diagnostic message at the `Fatal` level.
- [Warn(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.warn_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___8kyvvj)
- Writes the diagnostic message at the `Warn` level.
- [Error(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.error_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___7fy00h)
- Writes the diagnostic message at the `Error` level.
- [Fatal(Dictionary<string,object>, Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal_system.collections.generic.dictionary_system.string-system.object_-system.exception-system.string___pw9hcn)
- Writes the diagnostic message at the `Fatal` level.
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- [ErrorFltr<TException>(LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorfltr--1_--0-system.string-system.boolean___ipfsfa)
- Writes the diagnostic message at the `Error` level and returns the exception of given type
- [FatalFltr<TException>(LoggerExt.TException, string, bool) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalfltr--1_--0-system.string-system.boolean___5rdjqe)
- Writes the diagnostic message at the `Fatal` level and returns catchIt value.
- [LoggerExt (Type)](#t-net.adamec.lib.common.logging.loggerext__ac9km2)
- Extended logger implementing [ILogger](#t-net.adamec.lib.common.logging.ilogger__y2ollm)
- [ErrorPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.errorpassthrough_system.exception-system.string___1ey2kd0)
- Writes the diagnostic message at the `Error` level and returns given exception
- [FatalPassThrough(Exception, string) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatalpassthrough_system.exception-system.string___10psm2o)
- Writes the diagnostic message at the `Fatal` level and returns given exception >
- [Error<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.error--1_system.string-system.exception___1qowqgx)
- Writes the diagnostic message at the `Error` level. Creates and returns the exception of given type
- [Fatal<TException>(string, Exception) (Method)](#m-net.adamec.lib.common.logging.loggerext.fatal--1_system.string-system.exception___1myw0tj)
- Writes the diagnostic message at the `Fatal` level. Creates and returns the exception of given type
+
+
+Sources- logging\_SourceOnlyPackage.cs
- logging\CommonLogging.cs
- logging\ILogger.CorrelationId.cs
- logging\ILogger.cs
- logging\ILogger.EventProperties.cs
- logging\ILogger.ExceptionFilter.cs
- logging\ILogger.ExceptionPassThrough.cs
- logging\LoggerExt.CorrelationId.cs
- logging\LoggerExt.cs
- logging\LoggerExt.EventProperties.cs
- logging\LoggerExt.ExceptionFilter.cs
- logging\LoggerExt.ExceptionPassThrough.cs
Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
@@ -8993,7 +10434,19 @@ Declaring file: utils\BaseDisposable.cs
Helper class for implementation of IDisposable types (Source only package).
-Package members- [BaseDisposable (Type)](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
- Helper class for implementation of System.IDisposable types
- [Disposed (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposed__nxq2fp)
- Flag whether the object is fully disposed
- [DisposedManaged (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposedmanaged__1pm7df6)
- Flag whether the managed resources are disposed
- [DisposedNative (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposednative__fqjn7i)
- Flag whether the native resources are disposed
- [Dispose() (Method)](#m-net.adamec.lib.common.utils.basedisposable.dispose__6qe9ri)
- Dispose the object
- [Dispose(bool) (Method)](#m-net.adamec.lib.common.utils.basedisposable.dispose_system.boolean___1vzs8w4)
- Internal implementation of dispose - free the managed and native resources using the respective methods
- [DisposeManaged() (Method)](#m-net.adamec.lib.common.utils.basedisposable.disposemanaged__1ht3p85)
- Dispose any disposable managed fields or properties.
- [DisposeNative() (Method)](#m-net.adamec.lib.common.utils.basedisposable.disposenative__uaa3i9)
- Dispose of COM objects, Handles, etc. Then set those objects to null.
- [~BaseDisposable() (Method)](#m-net.adamec.lib.common.utils.basedisposable.finalize__1l3n8dl)
+Package members- [BaseDisposable (Type)](#t-net.adamec.lib.common.utils.basedisposable__7s72ps)
- Helper class for implementation of System.IDisposable types
- [DisposedFlag (Field)](#f-net.adamec.lib.common.utils.basedisposable.disposedflag__1kqq0uz)
- Internal flag whether the object is fully disposed
- [isDisposed (Field)](#f-net.adamec.lib.common.utils.basedisposable.isdisposed__2u766d)
- The object is disposed when equals to [DisposedFlag](#f-net.adamec.lib.common.utils.basedisposable.disposedflag__1kqq0uz)
- [Disposed (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposed__nxq2fp)
- Returns
+```csharp
+true
+```
+ when the object is fully disposed
- [DisposedManaged (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposedmanaged__1pm7df6)
- Returns
+```csharp
+true
+```
+ when the managed resources are disposed
- [DisposedNative (Property)](#p-net.adamec.lib.common.utils.basedisposable.disposednative__fqjn7i)
- Returns
+```csharp
+true
+```
+ when the native resources are disposed
- [Dispose() (Method)](#m-net.adamec.lib.common.utils.basedisposable.dispose__6qe9ri)
- Dispose the object
- [Dispose(bool) (Method)](#m-net.adamec.lib.common.utils.basedisposable.dispose_system.boolean___1vzs8w4)
- Internal implementation of dispose - free the managed and native resources using the respective methods
- [DisposeManaged() (Method)](#m-net.adamec.lib.common.utils.basedisposable.disposemanaged__1ht3p85)
- Dispose any disposable managed fields or properties.
- [DisposeNative() (Method)](#m-net.adamec.lib.common.utils.basedisposable.disposenative__uaa3i9)
- Dispose of COM objects, Handles, etc. Then set those objects to null.
- [~BaseDisposable() (Method)](#m-net.adamec.lib.common.utils.basedisposable.finalize__1l3n8dl)
- [AssertNotDisposed(string) (Method)](#m-net.adamec.lib.common.utils.basedisposable.assertnotdisposed_system.string___18xs7ya)
- Throws an System.ObjectDisposedException when the current object is disposed
Sources- utils\BaseDisposable.cs
@@ -9026,6 +10479,73 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## RadCommons.utils.Context Source only package ##
+Tags: RadCommons source-only disposable context
+Includes: None
+Declaring file: utils\Context.cs
+
+
+The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed.
+ The current context is accessible via static property Current.
+ The contexts are chained, when a new context is created using static method BeginContext(),
+ the Current context became the Parent of the new one and
+ the newly created context will be set as the Current one.
+ When the context is disposed, the Current context is set to Parent of disposing context.
+ The base implementation just manages the life time, context chain and keeps the state (when provided).
+ Inherit from the Context to add the context related operations (inherited classes have the access to state).
+ Based on the implementation of Guard Scopes by https://github.com/safakgur.
+ (Source only package).
+
+
+Usings- [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
- [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
+
+
+### Remarks ###
+The context can be both state-less and state-full and it's valid until it's disposed. The current context is accessible via [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) . The contexts are chained, when a new context is created using [BeginContext(Context<TState>.TState)](#m-net.adamec.lib.common.utils.context-1.begincontext_-0___mkgdox) , the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context became the [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) of the new one and the newly created context will be set as the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) one. When the context is disposed, the [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context is set to [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) of disposing context. Context's children are disposed as well during the context disposal. The [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.context-1.addtodisposer_system.idisposable___1y4aua6) method is to be used in inherited classes whenever they manage any disposable resource to ensure their proper life time (when the [State](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy) is System.IDisposable , it's added to disposer automatically). The base implementation just manages the life time, context chain and keeps the state (when provided). Inherit from the [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) to add the context related operations (inherited classes have the access to [State](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy) ).
+
+ Based on the implementation of Guard Scopes by https://github.com/safakgur at https://github.com/safakgur/guard/blob/v1.7.0/src/Guard.Scopes.cs
+
+
+
+
+Package members- [Context<TState> (Type)](#t-net.adamec.lib.common.utils.context-1__15rsz3v)
- Base context implementation.
- [ContextDisposedMessage (Field)](#f-net.adamec.lib.common.utils.context-1.contextdisposedmessage__161hgfs)
- Error message that will be put into the exception when there will be any operation on the disposed context.
- [Local (Field)](#f-net.adamec.lib.common.utils.context-1.local__17b69oq)
- The context holder that is local to the calling asynchronous control flow.
- [Current (Property)](#p-net.adamec.lib.common.utils.context-1.current__14ss4su)
- Gets the current context.
- [Disposer (Property)](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c)
- Gets the disposer associated with this container.
- [parentContext (Field)](#f-net.adamec.lib.common.utils.context-1.parentcontext__1an2htq)
- Parent context.
- [Parent (Property)](#p-net.adamec.lib.common.utils.context-1.parent__18v621x)
- Gets the parent scope.
- [contextState (Field)](#f-net.adamec.lib.common.utils.context-1.contextstate__5jvaxj)
- State managed by the context.
- [State (Property)](#p-net.adamec.lib.common.utils.context-1.state__1qgilfy)
- Gets the state managed by the context.
- [Context<TState>(Context<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.context-1.-ctor_-0___7zfvl8)
- Creates an instance of [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) and initialize its [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) . The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) .
- [BeginContext(Context<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.context-1.begincontext_-0___mkgdox)
- Creates a new [Context<TState>](#t-net.adamec.lib.common.utils.context-1__15rsz3v) within the context chain. The new context will become [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) and the previous one its [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) .
- [AddToDisposer(IDisposable) (Method)](#m-net.adamec.lib.common.utils.context-1.addtodisposer_system.idisposable___1y4aua6)
- Adds the disposable object to the context disposer, so it will be disposed with the context
- [DisposeManaged() (Method)](#m-net.adamec.lib.common.utils.context-1.disposemanaged__1ueqxf2)
- Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.context-1.disposer__1lrrq4c) stack are pop and disposed. The [Parent](#p-net.adamec.lib.common.utils.context-1.parent__18v621x) context of the disposing one will become the new [Current](#p-net.adamec.lib.common.utils.context-1.current__14ss4su) context.
+
+
+
+
+Sources- utils\Context.cs
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
+## RadCommons.utils.Disposer Source only package ##
+Tags: RadCommons source-only disposable
+Includes: None
+Declaring file: utils\Disposer.cs
+
+
+Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. (Source only package).
+
+
+Usings- [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
+
+
+Package members- [Disposer (Type)](#t-net.adamec.lib.common.utils.disposer__1ejr99q)
- Keeps the stack of disposable objects, and disposes them when the disposer is being disposed.
- [disposables (Field)](#f-net.adamec.lib.common.utils.disposer.disposables__5cwehn)
- Stack of disposables kept by the [Disposer](#t-net.adamec.lib.common.utils.disposer__1ejr99q) .
- [lockObj (Field)](#f-net.adamec.lib.common.utils.disposer.lockobj__1oj1wh6)
- Lock object
- [Dispose(bool) (Method)](#m-net.adamec.lib.common.utils.disposer.dispose_system.boolean___32o7wm)
- Internal implementation of dispose - free the managed and native resources.
- [Add(IDisposable) (Method)](#m-net.adamec.lib.common.utils.disposer.add_system.idisposable___1c4uk8l)
- Adds the disposable object to the disposer.
+
+
+Sources- utils\Disposer.cs
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## RadCommons.utils.FileUtils.Copy Source only package ##
Tags: RadCommons source-only file-copy file-utilities
Includes: None
@@ -9131,6 +10651,41 @@ Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adame
+## RadCommons.utils.Scope Source only package ##
+Tags: RadCommons source-only disposable scope
+Includes: None
+Declaring file: utils\Scope.cs
+
+
+The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed.
+ The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel.
+ The base implementation just manages the life time, child scopes and keeps the state (when provided).
+ Inherit from the Scope (and IScope)
+ to add the scope related operations (inherited classes have the access to state).
+ (Source only package).
+
+
+Usings- [RadCommons.utils.BaseDisposable](#src-only-package--RadCommons.utils.BaseDisposable)
- [RadCommons.utils.Disposer](#src-only-package--RadCommons.utils.Disposer)
+
+
+### Remarks ###
+The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested, when the scope is disposed, the children are disposed as well. There can be multiple child scopes (siblings) living in parallel. The [AddToDisposer(IDisposable)](#m-net.adamec.lib.common.utils.scope-1.addtodisposer_system.idisposable___154ejbt) method is to be used in inherited classes whenever they manage any disposable resource to ensure the proper life time (when the [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) is System.IDisposable , it's added to disposer automatically). The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) (and [IScope<TState>](#t-net.adamec.lib.common.utils.iscope-1__88aydf) ) to add the scope related operations (inherited classes have the access to [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar) ).
+
+
+
+
+Package members- [IScope<TState> (Type)](#t-net.adamec.lib.common.utils.iscope-1__88aydf)
- Scope interface.
- [Parent (Property)](#p-net.adamec.lib.common.utils.iscope-1.parent__iyc99h)
- Gets the parent scope.
- [BeginScope(IScope<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.iscope-1.beginscope_-0___1d7nxoa)
- Creates a child scope of the current scope.
- [Scope<TState> (Type)](#t-net.adamec.lib.common.utils.scope-1__eepqvi)
- Base scope implementation.
- [ScopeDisposedMessage (Field)](#f-net.adamec.lib.common.utils.scope-1.scopedisposedmessage__12oxry0)
- Error message that will be put into the exception when there will be any operation on the disposed scope.
- [RootInternal (Field)](#f-net.adamec.lib.common.utils.scope-1.rootinternal__coycy3)
- Instance of the [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) created when the singleton is first touched - root scope with default [State](#p-net.adamec.lib.common.utils.scope-1.state__78jkar)
- [Root (Property)](#p-net.adamec.lib.common.utils.scope-1.root__17hnd9c)
- Gets the root scope.
- [Scope<TState>() (Method)](#m-net.adamec.lib.common.utils.scope-1.-cctor__1t7jr8v)
- Static constructor
- [Disposer (Property)](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt)
- Gets the disposer associated with this container.
- [parentScope (Field)](#f-net.adamec.lib.common.utils.scope-1.parentscope__h8qyu6)
- Parent scope.
- [Parent (Property)](#p-net.adamec.lib.common.utils.scope-1.parent__1hk8ypk)
- Gets the parent scope.
- [scopeState (Field)](#f-net.adamec.lib.common.utils.scope-1.scopestate__16lomdz)
- State managed by the scope.
- [State (Property)](#p-net.adamec.lib.common.utils.scope-1.state__78jkar)
- Gets the state managed by the scope.
- [Scope<TState>(Scope<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.scope-1.-ctor_-0___17usleh)
- Creates an instance of [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) and initialize its [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) .
- [Scope<TState>(IScope<TState>, Scope<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.scope-1.-ctor_net.adamec.lib.common.utils.iscope_-0_--0___a63u7z)
- Creates an instance of child [Scope<TState>](#t-net.adamec.lib.common.utils.scope-1__eepqvi) .
- [BeginScope(Scope<TState>.TState) (Method)](#m-net.adamec.lib.common.utils.scope-1.beginscope_-0___1bcz3lp)
- Creates a child scope of the current scope.
- [AddToDisposer(IDisposable) (Method)](#m-net.adamec.lib.common.utils.scope-1.addtodisposer_system.idisposable___154ejbt)
- Adds the disposable object to the scope disposer, so it will be disposed with the scope
- [DisposeManaged() (Method)](#m-net.adamec.lib.common.utils.scope-1.disposemanaged__19g6lc3)
- Dispose any disposable managed objects - all disposables kept in [Disposer](#p-net.adamec.lib.common.utils.scope-1.disposer__1at2jxt) stack are pop and disposed.
+
+
+Sources- utils\Scope.cs
+
+
+Go to [namespaces](net.adamec.lib.common.md#namespace-list) or [types](net.adamec.lib.common.md#type-list) or [source-only packages](net.adamec.lib.common.md#package-list)
+
+
+
+
+
## RadCommons.utils.Txt Source only package ##
Tags: RadCommons source-only text-builder string-builder
Includes: None
diff --git a/net.adamec.lib.common/config/Configuration.cs b/net.adamec.lib.common/config/Configuration.cs
index 2f13dbe..495079e 100644
--- a/net.adamec.lib.common/config/Configuration.cs
+++ b/net.adamec.lib.common/config/Configuration.cs
@@ -78,6 +78,7 @@ namespace net.adamec.lib.common.config
/// and environment variables as sources and their hierarchy/overrides. The configuration can be used as key-value pairs or bound to objects (Source only package).
/// RadCommons source-only configuration
///
+ ///
public sealed class Configuration
{
#region Singleton
diff --git a/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs b/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs
new file mode 100644
index 0000000..afaa30a
--- /dev/null
+++ b/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs
@@ -0,0 +1,33 @@
+using System;
+
+namespace net.adamec.lib.common.extensions
+{
+
+ ///
+ /// Array extensions
+ ///
+ /// RadCommons.extensions.ArrayExtensions.ConcatenateBytes
+ /// Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one) (Source only package).
+ /// RadCommons source-only extension array
+ internal static partial class ArrayExtensions
+ {
+ ///
+ /// Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one)
+ ///
+ /// Original byte array
+ /// Bytes to add
+ /// New concatenated byte array ( + )
+ public static byte[] AppendBytes(this byte[] original, byte[] addedBytes)
+ {
+ if(original is null) throw new ArgumentNullException(nameof(original));
+
+ if (addedBytes is null || addedBytes.Length == 0) return original;
+
+ var retVal = new byte[original.Length + addedBytes.Length];
+ Buffer.BlockCopy(original, 0, retVal, 0, original.Length);
+ Buffer.BlockCopy(addedBytes, 0, retVal, original.Length, addedBytes.Length);
+ return retVal;
+ }
+
+ }
+}
diff --git a/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs.partnuspec b/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs.partnuspec
new file mode 100644
index 0000000..115a1e2
--- /dev/null
+++ b/net.adamec.lib.common/extensions/ArrayExtensionsAppendBytes.cs.partnuspec
@@ -0,0 +1,14 @@
+
+
+ RadCommons.extensions.ArrayExtensions.ConcatenateBytes
+ Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one) (Source only package).
+ RadCommons source-only extension array
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/net.adamec.lib.common/extensions/ArrayExtensionsFill.cs b/net.adamec.lib.common/extensions/ArrayExtensionsFill.cs
index 679be7f..64ade56 100644
--- a/net.adamec.lib.common/extensions/ArrayExtensionsFill.cs
+++ b/net.adamec.lib.common/extensions/ArrayExtensionsFill.cs
@@ -7,7 +7,6 @@
/// RadCommons.extensions.ArrayExtensions.Fill
/// Fills the array with given value (Source only package).
/// RadCommons source-only extension array
- // ReSharper disable once PartialTypeWithSinglePart
internal static partial class ArrayExtensions
{
///
diff --git a/net.adamec.lib.common/logging/ILogger.CorrelationId.cs b/net.adamec.lib.common/logging/ILogger.CorrelationId.cs
new file mode 100644
index 0000000..b06beb9
--- /dev/null
+++ b/net.adamec.lib.common/logging/ILogger.CorrelationId.cs
@@ -0,0 +1,147 @@
+using System;
+using System.ComponentModel;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Logger interface - wrapper around the with some additional methods
+ ///
+ internal partial interface ILogger
+ {
+ ///
+ /// Writes the diagnostic message at the Trace level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void TraceCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Debug level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void DebugCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Info level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void InfoCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Warn level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void WarnCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void ErrorCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ void FatalCorr(string correlationId, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Warn level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ void WarnCorr(string correlationId, Exception exception, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ void ErrorCorr(string correlationId, Exception exception, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ void FatalCorr(string correlationId, Exception exception, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ TException ErrorCorr(string correlationId, TException exception, string message = null) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ TException FatalCorr(string correlationId, TException exception, string message = null) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID. Creates and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ TException ErrorCorr(string correlationId, string message, Exception innerException = null) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID. Creates and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ TException FatalCorr(string correlationId, string message, Exception innerException = null) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ bool ErrorFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns value.
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ bool FatalFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception;
+ }
+}
diff --git a/net.adamec.lib.common/logging/ILogger.EventProperties.cs b/net.adamec.lib.common/logging/ILogger.EventProperties.cs
new file mode 100644
index 0000000..09dd995
--- /dev/null
+++ b/net.adamec.lib.common/logging/ILogger.EventProperties.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Logger interface - wrapper around the with some additional methods
+ ///
+ internal partial interface ILogger
+ {
+ ///
+ /// Writes the diagnostic message at the Trace level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Trace(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Debug level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Debug(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Info level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Info(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Warn level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Warn(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Error level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Error(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Fatal level.
+ ///
+ /// Event properties
+ /// Log message.
+ void Fatal(Dictionary eventProperties, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Warn level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ void Warn(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Error level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ void Error(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
+
+ ///
+ /// Writes the diagnostic message at the Fatal level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ void Fatal(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
+ }
+}
diff --git a/net.adamec.lib.common/logging/ILogger.ExceptionFilter.cs b/net.adamec.lib.common/logging/ILogger.ExceptionFilter.cs
new file mode 100644
index 0000000..acdcad9
--- /dev/null
+++ b/net.adamec.lib.common/logging/ILogger.ExceptionFilter.cs
@@ -0,0 +1,60 @@
+using System;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Logger interface - wrapper around the with some additional methods
+ ///
+ internal partial interface ILogger
+ {
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ ///
+ /// The following code logs any exception without catching it (function returns false by default)
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (Exception e) when (Logger.FatalFltr(e)) {}
+ ///
+ /// The following code catch and log the ArgumentException and logs any other exception without catching it.
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) {}
+ /// catch (Exception e) when (Logger.FatalFltr(e)) {}
+ ///
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ /// Flag whether the exception is to be catch by exception filter
+ bool ErrorFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns value.
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ bool FatalFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception;
+ }
+}
diff --git a/net.adamec.lib.common/logging/ILogger.ExceptionPassThrough.cs b/net.adamec.lib.common/logging/ILogger.ExceptionPassThrough.cs
new file mode 100644
index 0000000..3177b26
--- /dev/null
+++ b/net.adamec.lib.common/logging/ILogger.ExceptionPassThrough.cs
@@ -0,0 +1,42 @@
+using System;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Logger interface - wrapper around the with some additional methods
+ ///
+ internal partial interface ILogger
+ {
+ ///
+ /// Writes the diagnostic message at the Error level and returns given
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ Exception ErrorPassThrough(Exception exception, string message = null);
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns given
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ Exception FatalPassThrough(Exception exception, string message = null);
+
+ ///
+ /// Writes the diagnostic message at the Error level. Creates and returns the exception of given type
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ TException Error(string message, Exception innerException = null) where TException : Exception;
+
+ ///
+ /// Writes the diagnostic message at the Fatal level. Creates and returns the exception of given type
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ TException Fatal(string message, Exception innerException = null) where TException : Exception;
+ }
+}
diff --git a/net.adamec.lib.common/logging/ILogger.cs b/net.adamec.lib.common/logging/ILogger.cs
index f639ce2..537b340 100644
--- a/net.adamec.lib.common/logging/ILogger.cs
+++ b/net.adamec.lib.common/logging/ILogger.cs
@@ -1,313 +1,91 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
namespace net.adamec.lib.common.logging
{
///
/// Logger interface - wrapper around the with some additional methods
///
- internal interface ILogger : NLog.ILogger
+ ///
+ ///
+ /// The NLog supports having additional (custom) event properties provided to loggers and optionally rendered to logs.
+ /// The event properties are represented as key-value dictionary, where key is the unique name of the property.
+ /// Extended logger provides following methods to log with given set of the properties.
+ ///
+ /// - ,
+ /// - ,
+ /// - ,
+ /// - ,
+ /// - ,
+ /// - ,
+ /// - ,
+ /// - and
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Sometimes, it's useful to have an exception logging method implemented as the operation returning the exception being logged.
+ /// The and methods will log given exception and return it for further processing.
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (Exception ex){
+ /// if(logger.ErrorPassThrough(ex) is MyException){
+ /// return null;
+ /// }else{
+ /// throw;
+ /// }
+ /// }
+ ///
+ /// In the example above, the exception is always logged and then the decision/action is taken.
+ ///
+ ///
+ /// C# 6 brought the exception filters that don't unwind the stack as the exception is not catch yet when processing the filter.
+ /// It can also be used for logging the exceptions without actually catching them (when the exception filter returns false).
+ /// Extended logger provides functions and for this purpose.
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (Exception ex) when (logger.ErrorFltr(ex,"Error here!"){
+ /// //newer called as the default return value of ErrorFltr is false
+ /// }
+ ///
+ /// The example above logs but never catch all exceptions.
+ /// The following code catch and log the ArgumentException and logs any other exception without catching it.
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) { ... }
+ /// catch (Exception e) when (Logger.FatalFltr(e)) {}
+ ///
+ ///
+ ///
+ ///
+ /// Logger can also create and exception, log it and return using functions and
+ ///
+ /// if(value is null) throw logger.Fatal<ArgumentNullException>("Value is null");
+ ///
+ ///
+ ///
+ ///
+ /// When logging an exception using the methods, the event property StackTrace is set from ,
+ /// when the logger creates an exception, the property is set using new StackTrace(2, true).ToString().
+ /// In other cases when the is null or empty, new StackTrace(true).ToString() is used.
+ ///
+ ///
+ ///
+ /// also provides set of methods for logging with the correlation ID (for example in integration scenarios),
+ /// where the given correlation ID is set to the event property CorrelationId.
+ /// Such methods have the name ending with Corr suffix.
+ ///
+ ///
+ internal partial interface ILogger : NLog.ILogger
{
- #region Log with Event properties
- ///
- /// Writes the diagnostic message at the Trace level.
- ///
- /// Event properties
- /// Log message.
- void Trace(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Debug level.
- ///
- /// Event properties
- /// Log message.
- void Debug(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Info level.
- ///
- /// Event properties
- /// Log message.
- void Info(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Warn level.
- ///
- /// Event properties
- /// Log message.
- void Warn(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Error level.
- ///
- /// Event properties
- /// Log message.
- void Error(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Fatal level.
- ///
- /// Event properties
- /// Log message.
- void Fatal(Dictionary eventProperties, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Warn level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- void Warn(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Error level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- void Error(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Fatal level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- void Fatal(Dictionary eventProperties, Exception exception, [Localizable(false)] string message);
-
-
- #endregion
-
- #region Log with Exception pass-through
-
- ///
- /// Writes the diagnostic message at the Error level and returns given
- ///
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- Exception ErrorPassThrough(Exception exception, string message = null);
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns given
- ///
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- Exception FatalPassThrough(Exception exception, string message = null) ;
-
- ///
- /// Writes the diagnostic message at the Error level. Creates and returns the exception of given type
- ///
- /// Exception to be logged
- /// Log message.
- /// Created exception
- TException Error(string message, Exception innerException = null) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Fatal level. Creates and returns the exception of given type
- ///
- /// Exception to be logged
- /// Log message.
- /// Created exception
- TException Fatal(string message, Exception innerException = null) where TException : Exception;
-
- #endregion
-
- #region Log in Exception filter
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- ///
- /// The following code logs any exception without catching it (function returns false by default)
- ///
- /// try
- /// {
- /// ...
- /// }
- /// catch (Exception e) when (Logger.FatalFltr(e)) {}
- ///
- /// The following code catch and log the ArgumentException and logs any other exception without catching it.
- ///
- /// try
- /// {
- /// ...
- /// }
- /// catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) {}
- /// catch (Exception e) when (Logger.FatalFltr(e)) {}
- ///
- ///
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- /// Flag whether the exception is to be catch by exception filter
- bool ErrorFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns value.
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- bool FatalFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception;
-
- #endregion
-
- #region Log with CorrelationId
-
- ///
- /// Writes the diagnostic message at the Trace level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void TraceCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Debug level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void DebugCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Info level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void InfoCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Warn level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void WarnCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void ErrorCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- void FatalCorr(string correlationId, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Warn level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- void WarnCorr(string correlationId, Exception exception, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- void ErrorCorr(string correlationId, Exception exception, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- void FatalCorr(string correlationId, Exception exception, [Localizable(false)] string message);
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- TException ErrorCorr(string correlationId, TException exception, string message = null) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- TException FatalCorr(string correlationId, TException exception, string message = null) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID. Creates and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Created exception
- TException ErrorCorr(string correlationId, string message, Exception innerException = null) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID. Creates and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Created exception
- TException FatalCorr(string correlationId, string message, Exception innerException = null) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- bool ErrorFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception;
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns value.
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- bool FatalFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception;
-
-
- #endregion
}
-}
+}
\ No newline at end of file
diff --git a/net.adamec.lib.common/logging/LoggerExt.CorrelationId.cs b/net.adamec.lib.common/logging/LoggerExt.CorrelationId.cs
new file mode 100644
index 0000000..e5effa9
--- /dev/null
+++ b/net.adamec.lib.common/logging/LoggerExt.CorrelationId.cs
@@ -0,0 +1,218 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using NLog;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Extended logger implementing
+ ///
+ internal partial class LoggerExt
+ {
+ ///
+ /// Writes the diagnostic message at the Trace level with correlation ID
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void TraceCorr(string correlationId, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Trace, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Debug level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void DebugCorr(string correlationId, [Localizable(false)] string message)
+ {
+ base.Debug("a", "a");
+ LogIt(LogLevel.Debug, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Info level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void InfoCorr(string correlationId, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Info, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Warn level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void WarnCorr(string correlationId, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Warn, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void ErrorCorr(string correlationId, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Error, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Log message.
+ public void FatalCorr(string correlationId, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Fatal, correlationId, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Warn level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ public void WarnCorr(string correlationId, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Warn, correlationId, message, exception);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ public void ErrorCorr(string correlationId, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Error, correlationId, message, exception);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID.
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ public void FatalCorr(string correlationId, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Fatal, correlationId, message, exception);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ public TException ErrorCorr(string correlationId, TException exception, string message = null) where TException : Exception
+ {
+ LogIt(LogLevel.Error, correlationId,string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
+ return exception;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ public TException FatalCorr(string correlationId, TException exception, string message = null) where TException : Exception
+ {
+ LogIt(LogLevel.Fatal, correlationId,string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
+ return exception;
+ }
+
+
+ ///
+ /// Writes the diagnostic message at the Error level with correlation ID. Creates and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ public TException ErrorCorr(string correlationId, string message, Exception innerException = null) where TException : Exception
+ {
+ var exception = CreateException(message, out var stackTrace, innerException);
+ LogIt(LogLevel.Error, correlationId, message, exception, stackTrace);
+ return exception;
+ }
+
+
+ ///
+ /// Writes the diagnostic message at the Fatal level with correlation ID. Creates and returns the exception of given type
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ public TException FatalCorr(string correlationId, string message, Exception innerException = null) where TException : Exception
+ {
+ var exception = CreateException(message, out var stackTrace, innerException);
+ LogIt(LogLevel.Fatal, correlationId, message, exception, stackTrace);
+ return exception;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ public bool ErrorFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception
+ {
+ ErrorCorr(correlationId, exception, message);
+ return catchIt;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns value.
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Correlation ID
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ public bool FatalFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception
+ {
+ FatalCorr(correlationId, exception, message);
+ return catchIt;
+ }
+
+ ///
+ /// Writes the item (message with optional exception) with correlation Id into the log
+ ///
+ ///
+ /// Correlation ID
+ /// Log message
+ /// Optional exception to be logged
+ /// Optional stack trace to be logged in StackTrace event property when the of is empty
+ private void LogIt(LogLevel level, string correlationId, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
+ {
+ LogIt(level, new Dictionary { { "CorrelationId", correlationId } }, message, exception, stackTrace);
+ }
+ }
+}
diff --git a/net.adamec.lib.common/logging/LoggerExt.EventProperties.cs b/net.adamec.lib.common/logging/LoggerExt.EventProperties.cs
new file mode 100644
index 0000000..96a55bc
--- /dev/null
+++ b/net.adamec.lib.common/logging/LoggerExt.EventProperties.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using NLog;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Extended logger implementing
+ ///
+ internal partial class LoggerExt
+ {
+ ///
+ /// Writes the diagnostic message at the Trace level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Trace(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Trace, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Debug level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Debug(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Debug, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Info level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Info(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Info, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Warn level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Warn(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Warn, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Error(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Error, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level.
+ ///
+ /// Event properties
+ /// Log message.
+ public void Fatal(Dictionary eventProperties, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Fatal, eventProperties, message);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Warn level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ public void Warn(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Warn, eventProperties, message, exception);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ public void Error(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Error, eventProperties, message, exception);
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level.
+ ///
+ /// Event properties
+ /// Exception to be logged
+ /// Log message.
+ public void Fatal(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
+ {
+ LogIt(LogLevel.Fatal, eventProperties, message, exception);
+ }
+ }
+}
diff --git a/net.adamec.lib.common/logging/LoggerExt.ExceptionFilter.cs b/net.adamec.lib.common/logging/LoggerExt.ExceptionFilter.cs
new file mode 100644
index 0000000..d32b1fa
--- /dev/null
+++ b/net.adamec.lib.common/logging/LoggerExt.ExceptionFilter.cs
@@ -0,0 +1,68 @@
+using System;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Extended logger implementing
+ ///
+ internal partial class LoggerExt
+ {
+ ///
+ /// Writes the diagnostic message at the Error level and returns the exception of given type
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ ///
+ /// The following code logs any exception without catching it (function returns false by default)
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (Exception e) when (Logger.FatalFltr(e)) {}
+ ///
+ /// The following code catch and log the ArgumentException and logs any other exception without catching it.
+ ///
+ /// try
+ /// {
+ /// ...
+ /// }
+ /// catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) {}
+ /// catch (Exception e) when (Logger.FatalFltr(e)) {}
+ ///
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ /// Flag whether the exception is to be catch by exception filter
+ public bool ErrorFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception
+ {
+ Error(exception, message);
+ return catchIt;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns value.
+ ///
+ ///
+ /// This function is intended for catch exception filters.
+ /// The parameter defines whether the exception filter will be applied after logging.
+ /// The exception will be catch when is true, otherwise the filter is evaluated as false
+ /// and it will continue with finding the catch clause (in both cases the log entry will be created)
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Flag whether the is to be catch by filter (default is false)
+ ///
+ /// Flag whether the exception is to be catch by exception filter
+ public bool FatalFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception
+ {
+ Fatal(exception, message);
+ return catchIt;
+ }
+ }
+}
diff --git a/net.adamec.lib.common/logging/LoggerExt.ExceptionPassThrough.cs b/net.adamec.lib.common/logging/LoggerExt.ExceptionPassThrough.cs
new file mode 100644
index 0000000..99e6e2e
--- /dev/null
+++ b/net.adamec.lib.common/logging/LoggerExt.ExceptionPassThrough.cs
@@ -0,0 +1,61 @@
+using System;
+using NLog;
+
+namespace net.adamec.lib.common.logging
+{
+ ///
+ /// Extended logger implementing
+ ///
+ internal partial class LoggerExt
+ {
+ ///
+ /// Writes the diagnostic message at the Error level and returns given
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ public Exception ErrorPassThrough(Exception exception, string message = null)
+ {
+ LogIt(LogLevel.Error, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
+ return exception;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level and returns given >
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Pass-through exception
+ public Exception FatalPassThrough(Exception exception, string message = null)
+ {
+ LogIt(LogLevel.Fatal, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
+ return exception;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Error level. Creates and returns the exception of given type
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ public TException Error(string message, Exception innerException = null) where TException : Exception
+ {
+ var exception = CreateException(message, out var stackTrace, innerException);
+ LogIt(LogLevel.Error, message, exception, stackTrace);
+ return exception;
+ }
+
+ ///
+ /// Writes the diagnostic message at the Fatal level. Creates and returns the exception of given type
+ ///
+ /// Exception to be logged
+ /// Log message.
+ /// Created exception
+ public TException Fatal(string message, Exception innerException = null) where TException : Exception
+ {
+ var exception = CreateException(message, out var stackTrace, innerException);
+ LogIt(LogLevel.Fatal, message, exception, stackTrace);
+ return exception;
+ }
+ }
+}
diff --git a/net.adamec.lib.common/logging/LoggerExt.cs b/net.adamec.lib.common/logging/LoggerExt.cs
index 67b3c01..4ff04e2 100644
--- a/net.adamec.lib.common/logging/LoggerExt.cs
+++ b/net.adamec.lib.common/logging/LoggerExt.cs
@@ -1,430 +1,30 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
+using System.Diagnostics;
using NLog;
namespace net.adamec.lib.common.logging
{
///
- /// extensions
+ /// Extended logger implementing
///
- internal class LoggerExt : Logger, ILogger
+ internal partial class LoggerExt : Logger, ILogger
{
- #region Log with Event properties
- ///
- /// Writes the diagnostic message at the Trace level.
- ///
- /// Event properties
- /// Log message.
- public void Trace(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Trace, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Debug level.
- ///
- /// Event properties
- /// Log message.
- public void Debug(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Debug, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Info level.
- ///
- /// Event properties
- /// Log message.
- public void Info(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Info, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Warn level.
- ///
- /// Event properties
- /// Log message.
- public void Warn(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Warn, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Error level.
- ///
- /// Event properties
- /// Log message.
- public void Error(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Error, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level.
- ///
- /// Event properties
- /// Log message.
- public void Fatal(Dictionary eventProperties, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Fatal, eventProperties, message);
- }
-
- ///
- /// Writes the diagnostic message at the Warn level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- public void Warn(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Warn, eventProperties, message, exception);
- }
-
- ///
- /// Writes the diagnostic message at the Error level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- public void Error(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Error, eventProperties, message, exception);
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level.
- ///
- /// Event properties
- /// Exception to be logged
- /// Log message.
- public void Fatal(Dictionary eventProperties, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Fatal, eventProperties, message, exception);
- }
-
- #endregion
-
- #region Log with Exception pass-through
- ///
- /// Writes the diagnostic message at the Error level and returns given
- ///
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- public Exception ErrorPassThrough(Exception exception, string message = null)
- {
- LogIt(LogLevel.Error, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns given >
- ///
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- public Exception FatalPassThrough(Exception exception, string message = null)
- {
- LogIt(LogLevel.Fatal, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Error level. Creates and returns the exception of given type
- ///
- /// Exception to be logged
- /// Log message.
- /// Created exception
- public TException Error(string message, Exception innerException = null) where TException : Exception
- {
- var exception = CreateException(message, innerException);
- LogIt(LogLevel.Error, message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level. Creates and returns the exception of given type
- ///
- /// Exception to be logged
- /// Log message.
- /// Created exception
- public TException Fatal(string message, Exception innerException = null) where TException : Exception
- {
- var exception = CreateException(message, innerException);
- LogIt(LogLevel.Fatal, message, exception);
- return exception;
- }
-
///
/// Writes the diagnostic message at the Fatal level. Creates and returns the exception of given type
///
/// Log message.
+ /// Stack trace to be logged in StackTrace event property
/// Exception to be logged
/// Created exception
- private static TException CreateException(string message, Exception innerException = null)
+ private static TException CreateException(string message, out string stackTrace, Exception innerException = null)
where TException : Exception
{
var exception = (TException)Activator.CreateInstance(typeof(TException), message, innerException);
+ stackTrace = new StackTrace(2, true).ToString(); //skip 2 - CreateException+Logger method
return exception;
}
- #endregion
-
- #region Log in Exception filter
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- ///
- /// The following code logs any exception without catching it (function returns false by default)
- ///
- /// try
- /// {
- /// ...
- /// }
- /// catch (Exception e) when (Logger.FatalFltr(e)) {}
- ///
- /// The following code catch and log the ArgumentException and logs any other exception without catching it.
- ///
- /// try
- /// {
- /// ...
- /// }
- /// catch (ArgumentException e) when (Logger.ErrorFltr(e,catchIt:true)) {}
- /// catch (Exception e) when (Logger.FatalFltr(e)) {}
- ///
- ///
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- /// Flag whether the exception is to be catch by exception filter
- public bool ErrorFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception
- {
- Error(exception, message);
- return catchIt;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns value.
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- public bool FatalFltr(TException exception, string message = null, bool catchIt = false) where TException : Exception
- {
- Fatal(exception, message);
- return catchIt;
- }
- #endregion
-
- #region Log with CorrelationId
-
- ///
- /// Writes the diagnostic message at the Trace level with correlation ID
- ///
- /// Correlation ID
- /// Log message.
- public void TraceCorr(string correlationId, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Trace, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Debug level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- public void DebugCorr(string correlationId, [Localizable(false)] string message)
- {
- base.Debug("a", "a");
- LogIt(LogLevel.Debug, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Info level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- public void InfoCorr(string correlationId, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Info, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Warn level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- public void WarnCorr(string correlationId, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Warn, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- public void ErrorCorr(string correlationId, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Error, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID.
- ///
- /// Correlation ID
- /// Log message.
- public void FatalCorr(string correlationId, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Fatal, correlationId, message);
- }
-
- ///
- /// Writes the diagnostic message at the Warn level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- public void WarnCorr(string correlationId, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Warn, correlationId, message, exception);
- }
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- public void ErrorCorr(string correlationId, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Error, correlationId, message, exception);
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID.
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- public void FatalCorr(string correlationId, Exception exception, [Localizable(false)] string message)
- {
- LogIt(LogLevel.Fatal, correlationId, message, exception);
- }
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- public TException ErrorCorr(string correlationId, TException exception, string message = null) where TException : Exception
- {
- LogIt(LogLevel.Error, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Pass-through exception
- public TException FatalCorr(string correlationId, TException exception, string message = null) where TException : Exception
- {
- LogIt(LogLevel.Fatal, string.IsNullOrWhiteSpace(message) ? exception.Message : message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Error level with correlation ID. Creates and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Created exception
- public TException ErrorCorr(string correlationId, string message, Exception innerException = null) where TException : Exception
- {
- var exception = CreateException(message, innerException);
- LogIt(LogLevel.Error, correlationId, message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level with correlation ID. Creates and returns the exception of given type
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Created exception
- public TException FatalCorr(string correlationId, string message, Exception innerException = null) where TException : Exception
- {
- var exception = CreateException(message, innerException);
- LogIt(LogLevel.Fatal, correlationId, message, exception);
- return exception;
- }
-
- ///
- /// Writes the diagnostic message at the Error level and returns the exception of given type
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- public bool ErrorFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception
- {
- ErrorCorr(correlationId, exception, message);
- return catchIt;
- }
-
- ///
- /// Writes the diagnostic message at the Fatal level and returns value.
- ///
- ///
- /// This function is intended for catch exception filters.
- /// The parameter defines whether the exception filter will be applied after logging.
- /// The exception will be catch when is true, otherwise the filter is evaluated as false
- /// and it will continue with finding the catch clause (in both cases the log entry will be created)
- ///
- /// Correlation ID
- /// Exception to be logged
- /// Log message.
- /// Flag whether the is to be catch by filter (default is false)
- ///
- /// Flag whether the exception is to be catch by exception filter
- public bool FatalFltrCorr(string correlationId, TException exception, string message = null, bool catchIt = false) where TException : Exception
- {
- FatalCorr(correlationId, exception, message);
- return catchIt;
- }
-
- #endregion
#region Private LogIt
@@ -434,23 +34,13 @@ public bool FatalFltrCorr(string correlationId, TException exception
///
/// Log message
/// Optional exception to be logged
- private void LogIt(LogLevel level, [Localizable(false)] string message, Exception exception = null)
+ /// Optional stack trace to be logged in StackTrace event property when the of is empty
+ private void LogIt(LogLevel level, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
{
- LogIt(level, (Dictionary)null, message, exception);
- }
-
- ///
- /// Writes the item (message with optional exception) with correlation Id into the log
- ///
- ///
- /// Correlation ID
- /// Log message
- /// Optional exception to be logged
- private void LogIt(LogLevel level, string correlationId, [Localizable(false)] string message, Exception exception = null)
- {
- LogIt(level, new Dictionary { { "CorrelationId", correlationId } }, message, exception);
+ LogIt(level, (Dictionary)null, message, exception, stackTrace);
}
+
///
/// Writes the item (message with optional event properties and exception) into the log
///
@@ -458,9 +48,17 @@ private void LogIt(LogLevel level, string correlationId, [Localizable(false)] st
/// Event properties (null when no properties are provided)
/// Log message
/// Optional exception to be logged
- private void LogIt(LogLevel level, Dictionary eventProperties, [Localizable(false)] string message, Exception exception = null)
+ /// Optional stack trace to be logged in StackTrace event property when the of is empty
+ private void LogIt(LogLevel level, Dictionary eventProperties, [Localizable(false)] string message, Exception exception = null, string stackTrace = null)
{
var logEvent = new LogEventInfo(level, Name, message) { Exception = exception };
+ if (exception != null)
+ {
+ if (!string.IsNullOrWhiteSpace(exception.StackTrace)) stackTrace = exception.StackTrace;
+ //fall back - not sure how many frames to skip here for different calls, so the full stack trace will be used
+ if (string.IsNullOrWhiteSpace(stackTrace)) stackTrace = new StackTrace(true).ToString();
+ logEvent.Properties.Add("StackTrace", stackTrace);
+ }
if (eventProperties != null)
{
foreach (var eventProperty in eventProperties)
diff --git a/net.adamec.lib.common/logging/_SourceOnlyPackage.cs b/net.adamec.lib.common/logging/_SourceOnlyPackage.cs
index 4686eb0..6747629 100644
--- a/net.adamec.lib.common/logging/_SourceOnlyPackage.cs
+++ b/net.adamec.lib.common/logging/_SourceOnlyPackage.cs
@@ -7,6 +7,7 @@ namespace net.adamec.lib.common.logging
/// RadCommons source-only logging NLog
///
///
+ ///
[CompilerGenerated]
// ReSharper disable once InconsistentNaming
internal class _SourceOnlyPackage
diff --git a/net.adamec.lib.common/logging/_SourceOnlyPackage.cs.partnuspec b/net.adamec.lib.common/logging/_SourceOnlyPackage.cs.partnuspec
index c195cbd..4da9583 100644
--- a/net.adamec.lib.common/logging/_SourceOnlyPackage.cs.partnuspec
+++ b/net.adamec.lib.common/logging/_SourceOnlyPackage.cs.partnuspec
@@ -12,9 +12,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/net.adamec.lib.common/net.adamec.lib.common.csproj b/net.adamec.lib.common/net.adamec.lib.common.csproj
index b776e29..5f818ed 100644
--- a/net.adamec.lib.common/net.adamec.lib.common.csproj
+++ b/net.adamec.lib.common/net.adamec.lib.common.csproj
@@ -24,16 +24,22 @@
+
-
-
+
+
%(FileName)
+
+
+ ArrayExtensionsAppendBytes.cs
+
+
\ No newline at end of file
diff --git a/net.adamec.lib.common/utils/BaseDisposable.cs b/net.adamec.lib.common/utils/BaseDisposable.cs
index 701c812..33b6ce4 100644
--- a/net.adamec.lib.common/utils/BaseDisposable.cs
+++ b/net.adamec.lib.common/utils/BaseDisposable.cs
@@ -1,5 +1,6 @@
using System;
using System.Diagnostics;
+using System.Threading;
namespace net.adamec.lib.common.utils
{
@@ -13,15 +14,32 @@ namespace net.adamec.lib.common.utils
public abstract class BaseDisposable : IDisposable
{
///
- /// Flag whether the object is fully disposed
+ /// Internal flag whether the object is fully disposed
///
- public bool Disposed { get; private set; }
+ private const int DisposedFlag = 1;
///
- /// Flag whether the managed resources are disposed
+ /// The object is disposed when equals to
+ ///
+ private int isDisposed;
+
+ ///
+ /// Returns true
when the object is fully disposed
+ ///
+ public bool Disposed
+ {
+ get
+ {
+ Interlocked.MemoryBarrier();
+ return isDisposed == DisposedFlag;
+ }
+ }
+
+ ///
+ /// Returns true
when the managed resources are disposed
///
public bool DisposedManaged { get; private set; }
///
- /// Flag whether the native resources are disposed
+ /// Returns true
when the native resources are disposed
///
public bool DisposedNative { get; private set; }
@@ -38,13 +56,10 @@ public void Dispose()
///
/// Internal implementation of dispose - free the managed and native resources using the respective methods
///
- /// Flag whether the object is disposing (called from method). False if called from destructor
+ /// True to dispose both managed and native resources, false to dispose the native resources only
protected virtual void Dispose(bool disposing)
{
- if (Disposed)
- {
- return;
- }
+ if (Disposed) return; //already disposed
if (disposing)
{
@@ -86,7 +101,7 @@ protected virtual void Dispose(bool disposing)
}
}
- Disposed = true;
+ Interlocked.Exchange(ref isDisposed, DisposedFlag);
}
///
@@ -100,5 +115,16 @@ protected virtual void DisposeManaged() { }
protected virtual void DisposeNative() { }
~BaseDisposable() => Dispose(false);
+
+ ///
+ /// Throws an when the current object is disposed
+ ///
+ /// Optional exception message
+ /// Current object is disposed
+ protected void AssertNotDisposed(string message = null)
+ {
+ if (Disposed)
+ throw new ObjectDisposedException(!string.IsNullOrWhiteSpace(message) ? message : "Object is disposed");
+ }
}
}
diff --git a/net.adamec.lib.common/utils/Context.cs b/net.adamec.lib.common/utils/Context.cs
new file mode 100644
index 0000000..41e600f
--- /dev/null
+++ b/net.adamec.lib.common/utils/Context.cs
@@ -0,0 +1,162 @@
+using System;
+using System.Threading;
+
+namespace net.adamec.lib.common.utils
+{
+ ///
+ /// Base context implementation.
+ ///
+ ///
+ /// The context can be both state-less and state-full and it's valid until it's disposed.
+ /// The current context is accessible via .
+ /// The contexts are chained, when a new context is created using ,
+ /// the context became the of the new one and
+ /// the newly created context will be set as the one.
+ /// When the context is disposed, the context is set to of disposing context.
+ /// Context's children are disposed as well during the context disposal.
+ /// The method is to be used in inherited classes whenever
+ /// they manage any disposable resource to ensure their proper life time
+ /// (when the is , it's added to disposer automatically).
+ ///
+ /// The base implementation just manages the life time, context chain and keeps the state (when provided).
+ /// Inherit from the to add the context related operations
+ /// (inherited classes have the access to ).
+ ///
+ /// Based on the implementation of Guard Scopes by https://github.com/safakgur
+ /// at https://github.com/safakgur/guard/blob/v1.7.0/src/Guard.Scopes.cs
+ ///
+ /// Type of the state object managed by the context
+ /// RadCommons.utils.Context
+ /// The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed.
+ /// The current context is accessible via static property Current.
+ /// The contexts are chained, when a new context is created using static method BeginContext(),
+ /// the Current context became the Parent of the new one and
+ /// the newly created context will be set as the Current one.
+ /// When the context is disposed, the Current context is set to Parent of disposing context.
+ /// The base implementation just manages the life time, context chain and keeps the state (when provided).
+ /// Inherit from the Context<TState> to add the context related operations (inherited classes have the access to state).
+ /// Based on the implementation of Guard Scopes by https://github.com/safakgur.
+ /// (Source only package).
+ /// RadCommons source-only disposable context
+ ///
+ ///
+ ///
+ internal class Context : BaseDisposable where TState : class, new()
+ {
+ ///
+ /// Error message that will be put into the exception when there will be any operation on the disposed context.
+ ///
+ private const string ContextDisposedMessage = "Current context has been disposed";
+
+ ///
+ /// The context holder that is local to the calling asynchronous control flow.
+ ///
+ private static readonly AsyncLocal> Local = new AsyncLocal>();
+
+ ///
+ /// Gets the current context.
+ ///
+ public static Context Current
+ {
+ get => Local.Value;
+ private set => Local.Value = value;
+ }
+
+ ///
+ /// Gets the disposer associated with this container.
+ ///
+ /// Type of the state object managed by the context.
+ private Disposer Disposer { get; }
+
+ ///
+ /// Parent context.
+ ///
+ /// Type of the state object managed by the context.
+ private readonly Context parentContext;
+
+ ///
+ /// Gets the parent scope.
+ ///
+ /// Type of the state object managed by the context.
+ /// The current context has been disposed.
+ public Context Parent
+ {
+ get
+ {
+ AssertNotDisposed(ContextDisposedMessage);
+ return parentContext;
+ }
+ }
+
+ ///
+ /// State managed by the context.
+ ///
+ private readonly TState contextState;
+
+ ///
+ /// Gets the state managed by the context.
+ ///
+ /// Type of the state object managed by the context.
+ /// The current context has been disposed.
+ protected TState State
+ {
+ get
+ {
+ AssertNotDisposed(ContextDisposedMessage);
+ return contextState;
+ }
+ }
+
+ ///
+ /// Creates an instance of and initialize its .
+ /// The new context will become and the previous one its .
+ ///
+ /// Type of the state object managed by the context.
+ /// Optional state managed by the context.
+ protected Context(TState state = null)
+ {
+ Disposer = new Disposer();
+ parentContext = Current;
+ Current = this;
+
+ contextState = state;
+ if (contextState is IDisposable disposableState) AddToDisposer(disposableState);
+ }
+
+ ///
+ /// Creates a new within the context chain.
+ /// The new context will become and the previous one its .
+ ///
+ /// Type of the state object managed by the context.
+ /// Optional state managed by the context.
+ public static IDisposable BeginContext(TState state = null)
+ {
+ return new Context(state);
+ }
+
+ ///
+ /// Adds the object to the context disposer, so it will be disposed with the context
+ ///
+ /// object to be added to the disposer.
+ /// is null.
+ /// The current context has been disposed.
+ protected void AddToDisposer(IDisposable disposable)
+ {
+ if (disposable is null) throw new ArgumentNullException(nameof(disposable));
+ AssertNotDisposed(ContextDisposedMessage);
+
+ Disposer.Add(disposable);
+ }
+
+ ///
+ /// Dispose any disposable managed objects - all disposables kept in stack are pop and disposed.
+ /// The context of the disposing one will become the new context.
+ ///
+ protected override void DisposeManaged()
+ {
+ Disposer.Dispose();
+ Current = Parent;
+ }
+ }
+
+}
diff --git a/net.adamec.lib.common/utils/Context.cs.partnuspec b/net.adamec.lib.common/utils/Context.cs.partnuspec
new file mode 100644
index 0000000..2114c80
--- /dev/null
+++ b/net.adamec.lib.common/utils/Context.cs.partnuspec
@@ -0,0 +1,27 @@
+
+
+ RadCommons.utils.Context
+ The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed.
+ The current context is accessible via static property Current.
+ The contexts are chained, when a new context is created using static method BeginContext(),
+ the Current context became the Parent of the new one and
+ the newly created context will be set as the Current one.
+ When the context is disposed, the Current context is set to Parent of disposing context.
+ The base implementation just manages the life time, context chain and keeps the state (when provided).
+ Inherit from the Context<TState> to add the context related operations (inherited classes have the access to state).
+ Based on the implementation of Guard Scopes by https://github.com/safakgur.
+ (Source only package).
+ RadCommons source-only disposable context
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/net.adamec.lib.common/utils/Disposer.cs b/net.adamec.lib.common/utils/Disposer.cs
new file mode 100644
index 0000000..dac6e3e
--- /dev/null
+++ b/net.adamec.lib.common/utils/Disposer.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+
+namespace net.adamec.lib.common.utils
+{
+ ///
+ /// Keeps the stack of disposable objects, and disposes them when the disposer is being disposed.
+ ///
+ /// RadCommons.utils.Disposer
+ /// Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. (Source only package).
+ /// RadCommons source-only disposable
+ ///
+ internal class Disposer : BaseDisposable
+ {
+ ///
+ /// Stack of disposables kept by the .
+ ///
+ private Stack disposables = new Stack();
+ ///
+ /// Lock object
+ ///
+ private readonly object lockObj = new object();
+
+ ///
+ /// Internal implementation of dispose - free the managed and native resources.
+ ///
+ ///
+ /// When disposing the managed objects ( is true),
+ /// all disposables kept in stack are pop and disposed.
+ ///
+ /// True to dispose both managed and native resources, false to dispose the native resources only.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ lock (lockObj)
+ {
+ while (disposables.Count > 0)
+ {
+ var item = disposables.Pop();
+ item?.Dispose();
+ }
+ disposables = null;
+ }
+ }
+ base.Dispose(disposing);
+ }
+
+ ///
+ /// Adds the object to the disposer.
+ ///
+ /// object to be added to the disposer.
+ /// is null.
+ public void Add(IDisposable disposable)
+ {
+ if (disposable == null)
+ throw new ArgumentNullException(nameof(disposable));
+
+ lock (lockObj)
+ {
+ disposables.Push(disposable);
+ }
+ }
+ }
+}
diff --git a/net.adamec.lib.common/utils/Disposer.cs.partnuspec b/net.adamec.lib.common/utils/Disposer.cs.partnuspec
new file mode 100644
index 0000000..5b79ee7
--- /dev/null
+++ b/net.adamec.lib.common/utils/Disposer.cs.partnuspec
@@ -0,0 +1,17 @@
+
+
+ RadCommons.utils.Disposer
+ Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. (Source only package).
+ RadCommons source-only disposable
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/net.adamec.lib.common/utils/Scope.cs b/net.adamec.lib.common/utils/Scope.cs
new file mode 100644
index 0000000..fe3c757
--- /dev/null
+++ b/net.adamec.lib.common/utils/Scope.cs
@@ -0,0 +1,190 @@
+using System;
+
+namespace net.adamec.lib.common.utils
+{
+ ///
+ /// Scope interface.
+ ///
+ /// Type of the state object managed by the scope
+ /// RadCommons.utils.Scope
+ /// The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed.
+ /// The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel.
+ /// The base implementation just manages the life time, child scopes and keeps the state (when provided).
+ /// Inherit from the Scope<TState> (and IScope<TState>)
+ /// to add the scope related operations (inherited classes have the access to state).
+ /// (Source only package).
+ /// RadCommons source-only disposable scope
+ ///
+ ///
+ ///
+ internal interface IScope : IDisposable where TState: class,new()
+ {
+ ///
+ /// Gets the parent scope.
+ ///
+ /// Type of the state object managed by the scope
+ IScope Parent { get; }
+
+ ///
+ /// Creates a child scope of the current scope.
+ ///
+ /// State managed by the child scope.
+ /// Type of the state object managed by the scope
+ /// Child scope owned by the current scope.
+ IScope BeginScope(TState state);
+ }
+
+ ///
+ /// Base scope implementation.
+ ///
+ ///
+ /// The scope can be both state-less and state-full and it's valid until it's disposed.
+ /// The scopes can be nested, when the scope is disposed, the children are disposed as well.
+ /// There can be multiple child scopes (siblings) living in parallel.
+ /// The method is to be used in inherited classes whenever
+ /// they manage any disposable resource to ensure the proper life time
+ /// (when the is , it's added to disposer automatically).
+ ///
+ /// The base implementation just manages the life time, child scopes and keeps the state (when provided).
+ /// Inherit from the (and )
+ /// to add the scope related operations (inherited classes have the access to ).
+ ///
+ ///
+ /// Type of the state object managed by the scope
+ internal class Scope : BaseDisposable, IScope where TState : class, new()
+ {
+ ///
+ /// Error message that will be put into the exception when there will be any operation on the disposed scope.
+ ///
+ private const string ScopeDisposedMessage = "The scope has been disposed";
+
+ #region Root scope
+ ///
+ /// Instance of the created when the singleton is first touched - root scope with default
+ ///
+ ///
+ /// Not using the auto-property to have better control, when the instance is created
+ ///
+ /// Type of the state object managed by the scope
+ private static readonly Scope RootInternal = new Scope(new TState());
+
+ ///
+ /// Gets the root scope.
+ ///
+ /// Type of the state object managed by the scope
+ // ReSharper disable once ConvertToAutoProperty
+ public static Scope Root => RootInternal;
+
+ ///
+ /// Static constructor
+ ///
+ /// Explicit static constructor to tell C# compiler not to mark type as beforefieldinit
+ static Scope(){}
+ #endregion
+
+ ///
+ /// Gets the disposer associated with this container.
+ ///
+ private Disposer Disposer { get; }
+
+ ///
+ /// Parent scope.
+ ///
+ /// Type of the state object managed by the scope
+ private readonly IScope parentScope;
+
+ ///
+ /// Gets the parent scope.
+ ///
+ /// Type of the state object managed by the scope
+ /// The current scope has been disposed.
+ public IScope Parent
+ {
+ get
+ {
+ AssertNotDisposed(ScopeDisposedMessage);
+ return parentScope;
+ }
+ }
+
+ ///
+ /// State managed by the scope.
+ ///
+ private readonly TState scopeState;
+
+ ///
+ /// Gets the state managed by the scope.
+ ///
+ /// Type of the state object managed by the scope
+ /// The current scope has been disposed.
+ protected TState State
+ {
+ get
+ {
+ AssertNotDisposed(ScopeDisposedMessage);
+ return scopeState;
+ }
+ }
+
+ ///
+ /// Creates an instance of and initialize its .
+ ///
+ /// Type of the state object managed by the scope
+ /// Optional state managed by the scope.
+ private Scope( TState state = null)
+ {
+ Disposer = new Disposer();
+
+ scopeState = state;
+ if (scopeState is IDisposable disposableState) AddToDisposer(disposableState);
+ }
+
+ ///
+ /// Creates an instance of child .
+ ///
+ /// Type of the state object managed by the scope
+ /// Parent scope
+ /// Optional state managed by the scope.
+ protected Scope(IScope parent, TState state = null) : this(state)
+ {
+ parentScope = parent ?? throw new ArgumentNullException(nameof(parent));
+ }
+
+ ///
+ /// Creates a child scope of the current scope.
+ ///
+ /// Type of the state object managed by the scope
+ /// Optional state managed by the child scope..
+ /// Child scope owned by the current scope.
+ /// The current scope has been disposed.
+ public IScope BeginScope(TState state = null)
+ {
+ AssertNotDisposed(ScopeDisposedMessage);
+ var scope = new Scope(this, state);
+ AddToDisposer(scope);
+ return scope;
+ }
+
+ ///
+ /// Adds the object to the scope disposer, so it will be disposed with the scope
+ ///
+ /// object to be added to the disposer.
+ /// is null.
+ /// The current scope has been disposed.
+ protected void AddToDisposer(IDisposable disposable)
+ {
+ if(disposable is null) throw new ArgumentNullException(nameof(disposable));
+ AssertNotDisposed(ScopeDisposedMessage);
+
+ Disposer.Add(disposable);
+ }
+
+ ///
+ /// Dispose any disposable managed objects - all disposables kept in stack are pop and disposed.
+ ///
+ protected override void DisposeManaged()
+ {
+ Disposer.Dispose();
+ }
+ }
+}
diff --git a/net.adamec.lib.common/utils/Scope.cs.partnuspec b/net.adamec.lib.common/utils/Scope.cs.partnuspec
new file mode 100644
index 0000000..71e0092
--- /dev/null
+++ b/net.adamec.lib.common/utils/Scope.cs.partnuspec
@@ -0,0 +1,23 @@
+
+
+ RadCommons.utils.Scope
+ The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed.
+ The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel.
+ The base implementation just manages the life time, child scopes and keeps the state (when provided).
+ Inherit from the Scope<TState> (and IScope<TState>)
+ to add the scope related operations (inherited classes have the access to state).
+ (Source only package).
+ RadCommons source-only disposable scope
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 6577d5a..27e4646 100644
--- a/readme.md
+++ b/readme.md
@@ -10,30 +10,35 @@ The Commons library use the customized MS Build process allowing to create and p
## Packages ##
The brief of the packages is described here, for more details see the [code documentation](doc/net.adamec.lib.common.md) generated by [MarkupDoc](https://github.com/adamecr/MarkupDoc).
-| Name | Summary |
-| ------ | --------- |
-| [RadCommons.async.AsyncManager](doc/net.adamec.lib.common.md#src-only-package--RadCommons.async.AsyncManager) | Helpers for running the actions in sync or async mode. |
-| [RadCommons.async.FileAsync](doc/net.adamec.lib.common.md#src-only-package--RadCommons.async.FileAsync) | Helpers for reading text files in async mode. |
-| [RadCommons.config.Configuration](doc/net.adamec.lib.common.md#src-only-package--RadCommons.config.Configuration) | Simple configuration container in case DI with more sophisticated containers is not used. |
-| [RadCommons.di.Component](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.Component) | RadCommons DI Component - allows to mark and register the component to Autofac container using the [Component] class attributes. |
-| [RadCommons.di.Config](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.Config) | Application configuration helpers for DI containers. |
-| [RadCommons.di.PostInit](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.PostInit) | RadCommons DI PostInit - allows to run post init method of component in Autofac container. |
-| [RadCommons.extensions.ArrayExtensions.Fill](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.ArrayExtensions.Fill) | Fills the array with given value. |
-| [RadCommons.extensions.EnumeratorExtensions.ToEnumerable](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.EnumeratorExtensions.ToEnumerable) | Transforms the IEnumerator or IEnumerator to IEnumerable. |
-| [RadCommons.extensions.IEnumerableExtensions.ForEach](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.IEnumerableExtensions.ForEach) | Invokes the action for each item if IEnumerable. |
-| [RadCommons.extensions.StringExtensions.Case](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Case) | String case manipulation helpers. |
-| [RadCommons.extensions.StringExtensions.Html](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Html) | HTML related string manipulation helpers. |
-| [RadCommons.extensions.StringExtensions.Parts](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Parts) | String splitting and parts manipulation helpers. |
-| [RadCommons.extensions.StringExtensions.Paths](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Paths) | Path manipulation helpers for strings. |
-| [RadCommons.extensions.StringExtensions.Whitespace](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Whitespace) | Whitespace manipulation helpers for strings. |
-| [RadCommons.extensions.TypeExtensions.DefaultValue](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.TypeExtensions.DefaultValue) | Provides default value for types. |
-| [RadCommons.logging.CommonLogging](doc/net.adamec.lib.common.md#src-only-package--RadCommons.logging.CommonLogging) | RadCommons logging wrapper around NLog. |
-| [RadCommons.utils.BackgroundWorkerWithSyncCancel](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.BackgroundWorkerWithSyncCancel) | Executes an operation on a separate thread with possibility of sync cancel. |
-| [RadCommons.utils.BaseDisposable](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.BaseDisposable) | Helper class for implementation of IDisposable types. |
-| [RadCommons.utils.ConsoleUtils](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ConsoleUtils) | Console output utilities. |
-| [RadCommons.utils.FileUtils.Copy](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.FileUtils.Copy) | File copy utilities. |
-| [RadCommons.utils.MarshalExt](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.MarshalExt) | Marshaling helpers. |
-| [RadCommons.utils.PeriodicTask](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.PeriodicTask) | Periodic (or scheduled) async task runner. |
-| [RadCommons.utils.ProcessUtils](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ProcessUtils) | Process related utilities. |
-| [RadCommons.utils.ProcessWrapper](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ProcessWrapper) | A class the wraps a process, allowing programmatic input and output. |
-| [RadCommons.utils.Txt](#src-only-package--RadCommons.utils.Txt) | Text builder. |
+
+ | Name | Summary |
+ | ------ | --------- |
+ | [RadCommons.async.AsyncManager](doc/net.adamec.lib.common.md#src-only-package--RadCommons.async.AsyncManager) | Helpers for running the async tasks in sync mode and executing sync actions in async mode. |
+ | [RadCommons.async.FileAsync](doc/net.adamec.lib.common.md#src-only-package--RadCommons.async.FileAsync) | Helpers for reading text files in async mode. |
+ | [RadCommons.config.Configuration](doc/net.adamec.lib.common.md#src-only-package--RadCommons.config.Configuration) | Simple configuration container in case DI with more sophisticated containers is not used. Supports the JSON config files, command line arguments and environment variables as sources and their hierarchy/overrides. The configuration can be used as key-value pairs or bound to objects. |
+ | [RadCommons.di.Component](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.Component) | RadCommons DI Component - allows to mark and inject the component using the class attributes. |
+ | [RadCommons.di.Config](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.Config) | RadCommons DI helpers for application configuration. |
+ | [RadCommons.di.PostInit](doc/net.adamec.lib.common.md#src-only-package--RadCommons.di.PostInit) | RadCommons DI PostInit - allows to run post init method of component. |
+ | [RadCommons.extensions.ArrayExtensions.ConcatenateBytes](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.ArrayExtensions.ConcatenateBytes) | Adds the byte array to the current one and returns resulting array (concatenates two byte arrays into a new one). |
+ | [RadCommons.extensions.ArrayExtensions.Fill](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.ArrayExtensions.Fill) | Fills the array with given value. |
+ | [RadCommons.extensions.EnumeratorExtensions.ToEnumerable](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.EnumeratorExtensions.ToEnumerable) | Transforms the IEnumerator or IEnumerator to IEnumerable. |
+ | [RadCommons.extensions.IEnumerableExtensions.ForEach](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.IEnumerableExtensions.ForEach) | Invokes the action for each item if IEnumerable. |
+ | [RadCommons.extensions.StringExtensions.Case](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Case) | String case manipulation helpers. |
+ | [RadCommons.extensions.StringExtensions.Html](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Html) | HTML related string manipulation helpers. |
+ | [RadCommons.extensions.StringExtensions.Parts](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Parts) | String splitting and parts manipulation helpers. |
+ | [RadCommons.extensions.StringExtensions.Paths](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Paths) | Path manipulation helpers for strings. |
+ | [RadCommons.extensions.StringExtensions.Whitespace](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.StringExtensions.Whitespace) | Whitespace manipulation helpers for strings. |
+ | [RadCommons.extensions.TypeExtensions.DefaultValue](doc/net.adamec.lib.common.md#src-only-package--RadCommons.extensions.TypeExtensions.DefaultValue) | Provides default value for types. |
+ | [RadCommons.logging.CommonLogging](doc/net.adamec.lib.common.md#src-only-package--RadCommons.logging.CommonLogging) | RadCommons logging wrapper around NLog with some extended functionality. |
+ | [RadCommons.utils.BackgroundWorkerWithSyncCancel](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.BackgroundWorkerWithSyncCancel) | Executes an operation on a separate thread with possibility of sync cancel. |
+ | [RadCommons.utils.BaseDisposable](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.BaseDisposable) | Helper class for implementation of IDisposable types. |
+ | [RadCommons.utils.ConsoleUtils](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ConsoleUtils) | Console output utilities. |
+ | [RadCommons.utils.Context](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.Context) | The runtime "container" for context operations. The context can be both state-less and state-full and it's valid until it's disposed. The current context is accessible via static property Current. The contexts are chained, when a new context is created using static method BeginContext(), the Current context became the Parent of the new one and the newly created context will be set as the Current one. When the context is disposed, the Current context is set to Parent of disposing context. The base implementation just manages the life time, context chain and keeps the state (when provided). Inherit from the Context to add the context related operations (inherited classes have the access to state). Based on the implementation of Guard Scopes by https://github.com/safakgur. |
+ | [RadCommons.utils.Disposer](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.Disposer) | Keeps the stack of disposable objects, and disposes them when the disposer is being disposed. |
+ | [RadCommons.utils.FileUtils.Copy](doc/net.adamec.lib.common.md#doc/net.adamec.lib.common.mdsrc-only-package--RadCommons.utils.FileUtils.Copy) | File copy utilities. |
+ | [RadCommons.utils.MarshalExt](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.MarshalExt) | Marshaling helpers. |
+ | [RadCommons.utils.PeriodicTask](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.PeriodicTask) | Periodic (or scheduled) async task runner. |
+ | [RadCommons.utils.ProcessUtils](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ProcessUtils) | Process related utilities. |
+ | [RadCommons.utils.ProcessWrapper](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.ProcessWrapper) | A class the wraps a process, allowing programmatic input and output. |
+ | [RadCommons.utils.Scope](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.Scope) | The runtime "container" for scoped operations. The scope can be both state-less and state-full and it's valid until it's disposed. The scopes can be nested (when the scope is disposed, the children are disposed as well) and there can be multiple child scopes (siblings) living in parallel. The base implementation just manages the life time, child scopes and keeps the state (when provided). Inherit from the Scope (and IScope) to add the scope related operations (inherited classes have the access to state).. |
+ | [RadCommons.utils.Txt](doc/net.adamec.lib.common.md#src-only-package--RadCommons.utils.Txt) | Text builder allowing to build strings from parts, supporting conditions, enumerations, etc. |