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
-
ObjectEnvironment
- 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
contextIDataContextThe parent DataContext to which the environment belongs.
currentUserEntityObjectThe 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
contextIDataContextThe parent DataContext to which the environment belongs.
currentUserEntityObjectThe current user under which the datacontext is running.
globalSettingsEntityObjectThe global settings.
Properties
CurrentUser
Gets the current user that uses the current instance of a DataContext
public EntityObject CurrentUser { get; }
Property Value
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
propertyNameStringThe 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
nameStringThe name of the NamedSet to search for.
Returns
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
contextDataContextContext to use for refresh.
environmentEnvironmentThe environment.
TryGetNamedSet(String, out NamedSet)
Tries the get named set.
public bool TryGetNamedSet(string name, out NamedSet namedSet)
Parameters
nameStringThe name of the NamedSet to search for.
namedSetNamedSetThe instance of NamedSet with the corresponding name.
Returns
- Boolean
true if the NamedSet with the name is found, else false