Search Results for

    Show / Hide Table of Contents

    Namespace LemonEdge.Utils

    Classes

    ApplicationLogging

    Helper class for logging all actions in the LemonEdge platform

    AsyncDisposableSet<T>

    AsyncEvent

    A container for event listeners, fired asynchronously.

    AsyncEventDictionary<TKey, TEventArgs>

    A dictionary of event listeners keyed on a conditional parameter.

    AsyncEvent<TEventArgs>

    A container for event listeners requiring event arguments, fired asynchronously.

    AsyncHelper

    A set of helper functions for waiting on tasks and running them synchronously

    This should be used sparingly and only in areas that require it like validation attributes, as this can lock up the UI

    Used mostly within single threaded enviromnents such as a command console

    BaseHasChildren<T>

    A base class that items can inherit from that implements the IHasChildren<T> functionality

    BaseTreeNode<T, TN>

    A class holding a typed TreeNode implementation

    ColorHelper

    A set of functions for helping with default colours in the application. The application can color tabs for ensuring layouts look different. This helps cycle through a set of distinct colors to make sure tabs dont clash

    CommandLineArgOptions

    Details the options expected for command line arguments

    CommandLineArgParser

    A class for common operations around resolving command line arguments

    CompiledLambda

    Creates a compiled lambda to use in place of reflection.

    CompressionHelper

    A set of helper functions for compressing and decompressing data

    ConnectionSettings

    Constants

    Helper function for common constant values

    CurrencyHelper

    CustomMessageException

    A marker for throwing exceptions that contain very simple error messages for low/no code users. Throw these in code snippets to give a user clearer error messages. Use optional notes to help.

    DependencyLoopChecker<T>

    DependencyLoopItem<T>

    A helper object for DependencyLoopChecker<T>. Wraps your object to work with the loop checker.

    DescriptionAttribute

    An attribute for providing a description against a property, field or interface.

    Used against enum values for tooltips in the UI

    DisposableSet<T>

    EncodingExtensions

    A helper extension for retrieving

    EnumHelper

    A set of functions and extensions for helping to work with an Enum

    EnumWrapper

    A wrapper for providing details about an enum value including a description for use with user selection of values

    EnumWrapper<T>

    A strongly typed version of the EnumWrapper for a specific Enum type. This ensures it holds the enum value correctly typed

    Event

    A basic implementation which would only be used with an EventDictionary<TKey>.

    EventBase<TDelegate>

    Provides a base container for event listeners - this is an unordered concurrent collection.

    EventDictionaryBase<TKey, TEvent, TDelegate>

    Provides a base container for a dictionary of events.

    EventDictionary<TKey>

    A dictionary of event listeners, invoked by key.

    ExpressionTypeChanger<T>

    A class for traversing expressions and changing the type of a parameter from a type to another

    This is used by the system for Linq expressions generated against an interface and replacing them to work against the actual class implementation of that interface

    ExpressionsHelper

    A set of helper functions and extensions around expressions and reflection for Linq functionality

    FileHelper

    Helper functions associated with file operations in .net core

    FormulaFunctionAttribute

    Describes a function that can be used by the formula engine. The description is used in the formula engine editor for information about all possible callable functions

    HasChildrenExtensions

    A set of helper functions and extensions for working with IHasChildren implementations

    HttpClientExtensions

    IPAddressRange

    Parses an ip address range for checking to see if a supplied ip address is valid within that range.

    Formats:

    ipaddress{optional comment}

    ipaddresMmin-ipaddressMax(optional expirey date){optional comment}

    JsonHelper

    A collection of helper functions for json manipulation

    LinqExtensions

    MiscExtensions

    A set of miscellaneous extension and helper methods

    PredicateBuilder

    Helper functions for combining Linq expressions through logical operators

    ProcessMonitor

    ProcessMonitorFactory

    PropertyComparer<T, P>

    Implements IEqualityComparer<T> for the specified type T comparing the specified property

    QueryExecuterHelper

    A helper class for common functions using QueryableExecuters

    QueryableExecuter

    The base class for holding all queries in a generic manner for LemonEdge. The LemonEdge context interface allows access to data across direct DB access and web services, as such we don't use LINQ as it is not fully supported in all circumstances (see OData spec).

    This class is designed to encapsulate the queries possible by LemonEdge across services or direct db access, and is responsible for translating it into appropriate Linq queries where required

    QueryableExecuter<T>

    A QueryableExecuter that operates against the specified interface of type T

    QueryableExecuter<T, TT>

    A QueryableExecuter that operates against the specified interface of type T and a class of type TT implementing T

    QueryableFilter

    Contains information on filtering a set of items. Can contain child QueryableFilters forming a filter like the following:

    And

    --- XXX Equals 123

    --- Or

    ------ YYY Equals 123

    ------ ZZZ NotEquals 321

    QueryableFilterExtensions

    QueryableSort

    Contains information on a property and direction to use to sort a collection of items

    ReflectionExtensions

    Contains a set of extensions for common reflection activities

    ReflectionHelper

    A set of functions to help with reflection, including referencing custom loaded DLLs by LemonEdge

    ReflectionHelperExtensions

    SerializedParam

    An abstract base class for serializing and working with parameters/settings associated with items

    Also implements ICloneable to ensure parameters can be copied and passed around as strings

    Serializer

    SetOrderEnumerator<T>

    A class that enumerates a collection into a given order of mutually exclusive sets

    Singleton<T>

    Temporary DI hack for public static references.

    StandardFunctions

    All contexts that are used in the formula engine should inherit from this base class that provides a set of common functions that can be used simply in formulas

    StringBuilderExtensions

    StringExtensions

    A set of extension methods for string manipulation

    StringHelper

    A collection of helper functions for common string manipulation

    TreeNode

    Holds an associated Item and child TreeNode items through the BaseHasChildren<T> implementation.

    TreeNode<T>

    Holds an associated Item of type T for this TreeNode, with Children items that are all of type TreeNode<T>

    VersionUtility

    Interfaces

    ICanTrackProperties

    Indicates this item can track the original values of certain properties before any changes are made

    ICustomSettingRetriever

    Can be used to override the SettingsHelper functionality to provide an alternative method for retrieving custom setting values from propeitary sources

    IDependencyLoopChecker<T>

    Runs through a set of objects, checking that no referencial loop exists between them.

    Usage: 1. Create new DependencyLoopChecker<T> 2. Provide a mapping function as above 3. Call AddDependency(T) for each item you need to check 4. Call HasLoop() - returns true if you have a loop. 5. Call PrintLooped() to get a message and the list of offending objects. 6. Call Reset() to clear the internal state, to reuse.

    Given the following example class:

    private class TestLinkedObject
    {
        public Guid EntityTypeID { get; set; }
        public Guid NewEntityTypeID { get; set; } 
        public override string ToString() => Name;
    }

    LoopChecker will then generate a wrapper (DependencyLoopItem<T>) for each object that you add via AddDependency(T).

    You must provide a lambda for how to map your object to DependencyLoopItem<T>. Given the above code, usage would look like this:

    var loopChecker = new DependencyLoopChecker{TestLinkedObject}
    (
        x => new DependencyItem{TestLinkedObject}
        {
            From = x.EntityTypeID,
            To = x.NewEntityTypeID,
            Item = x
        }
    );

    IHasChildren

    Indicates this item contains child items within it that can themselves contain children

    IHasChildren<T>

    Indicates this item has children that are all typed to be of the same type

    IProcessMonitor

    Handles the running of Tasks, with logging and duration. Use as follows:

    public class UsageExample
    {
        private readonly ProcessMonitor _monitor;
    
        public UsageExample(ILogger<UsageExample> logger)
        {
            _monitor = ProcessMonitor.Create(logger, new EventId());
        }
    
        internal async Task<bool> ConsumeProcessMonitor()
        {
            return await _monitor.ProcessAsync<bool>("parent", async () =>
            {
                await _monitor.Child.ProcessAsync("step1", step1);
                bool result = await _monitor.Child.ProcessAsync("step2", step2);
                return result;
            });
        }
    
        async Task<double> step1() => await Task.FromResult(1);
    
        async Task<bool> step2() => true;
    }

    IProcessMonitorFactory

    Handles creation of IProcessMonitors.

    IReflectionHelper

    ISerializer

    ITreeNode

    Generalizes a property that a class implements that provides an associated Item object that can be held against the class while also having child items through the IHasChildren interface implementation.

    ITreeNode<T>

    Generalizes a property that a class implements that provides an associated Item that can be held against the class while also having child items through the IHasChildren interface implementation.

    ITreeNode<T, TN>

    Generalizes a property that a class implements that provides an associated Item that is of the same treenode type again, that can be held against the class while also having child items through the IHasChildren<T> interface implementation.

    Enums

    ImageType

    An enum of the standard images within the LemonEdge application.

    Images can be referenced by this Enum or by the equivalant Guid value. Guid values outside this enum range refer to unique custom images configured within the LemonEdge platform.

    MathOperator

    An enum used for addition and subtraction options

    QueryableExecuterApplyType

    A bitwise flag of options that can be used from a QueryableExecuter

    StringHelper.CharLetterTypeCase

    Indicates an alphabet character should come from the set of characters that are lower case, upper case, or both.

    TextFileEncoding

    AN enumeration of the different types of text encoding supported

    Delegates

    HasChildrenExtensions.CreateCopiedNode<T>

    In this article
    Back to top © LemonEdge Technologies. All rights reserved.