Table of Contents

Class Environment

Namespace
TimeCockpit.Data
Assembly
TimeCockpit.Data.dll

Represents the gateway to information that should be available throughout the datalayer.

public class Environment
Inheritance
Object
Environment
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Remarks

An instance of Environment is attatched to an instance of a DataContext. That is, the Environment is not global for the application life time, but the life time of a corresponding DataContext.

Constructors

Environment(IDataContext, EntityObject)

Initializes a new instance of the Environment class.

public Environment(IDataContext context, EntityObject currentUser)

Parameters

context IDataContext

The parent DataContext to which the environment belongs.

currentUser EntityObject

The current user under which the datacontext is running.

Environment(IDataContext, EntityObject, EntityObject)

Initializes a new instance of the Environment class.

public Environment(IDataContext context, EntityObject currentUser, EntityObject globalSettings)

Parameters

context IDataContext

The parent DataContext to which the environment belongs.

currentUser EntityObject

The current user under which the datacontext is running.

globalSettings EntityObject

The global settings.

Properties

CurrentUser

Gets the current user that uses the current instance of a DataContext

public EntityObject CurrentUser { get; }

Property Value

EntityObject

GlobalSettings

Gets or sets the settings.

public EntityObject GlobalSettings { get; set; }

Property Value

EntityObject

The settings.

Item[String]

Gets the System.Object with the specified property name.

public object this[string propertyName] { get; }

Parameters

propertyName String

The name of the member to get the value for.

Property Value

Object

Returns the value of the specified member.

NamedSets

Gets or sets the NamedSets that exist in the current instance Environment.

public IDictionary<string, NamedSet> NamedSets { get; set; }

Property Value

IDictionary<String, NamedSet>

ParentContext

Gets or sets the parent context.

public IDataContext ParentContext { get; set; }

Property Value

IDataContext

The parent context.

Methods

GetNamedSet(String)

Get named set.

public NamedSet GetNamedSet(string name)

Parameters

name String

The name of the NamedSet to search for.

Returns

NamedSet

true if the NamedSet with the name is found, else false

Remarks

If the set with the name cannot be found, the method return null.

RefreshEveryQuerySets()

Refreshes the every query sets.

public void RefreshEveryQuerySets()

RefreshLogonSets(DataContext, Environment)

Refresh all (logon) named sets.

public void RefreshLogonSets(DataContext context, Environment environment)

Parameters

context DataContext

Context to use for refresh.

environment Environment

The environment.

TryGetNamedSet(String, out NamedSet)

Tries the get named set.

public bool TryGetNamedSet(string name, out NamedSet namedSet)

Parameters

name String

The name of the NamedSet to search for.

namedSet NamedSet

The instance of NamedSet with the corresponding name.

Returns

Boolean

true if the NamedSet with the name is found, else false