Class DataContext
- Namespace
- KSP.Api.CoreTypes
- Assembly
- Assembly-CSharp.dll
public class DataContext : IDisposable, IDataContext, IDataContextReadonly, IDataContextWritable
- Inheritance
-
DataContext
- Implements
-
- Derived
-
- Inherited Members
-
- Extension Methods
-
Constructors
DataContext(IDataContextReadonly, string)
public DataContext(IDataContextReadonly stackParent, string debugName = null)
Parameters
stackParent IDataContextReadonly
debugName string
DataContext(string)
public DataContext(string debugName = null)
Parameters
debugName string
Fields
debugName
protected string debugName
Field Value
- string
Properties
ActionCount
public int ActionCount { get; }
Property Value
- int
Actions
public IReadOnlyDictionary<string, IAction> Actions { get; }
Property Value
- IReadOnlyDictionary<string, IAction>
IsDisposed
public bool IsDisposed { get; }
Property Value
- bool
Labels
public IReadOnlyDictionary<string, string> Labels { get; }
Property Value
- IReadOnlyDictionary<string, string>
ListCount
public int ListCount { get; }
Property Value
- int
Lists
public IReadOnlyDictionary<string, IContextListProperty> Lists { get; }
Property Value
- IReadOnlyDictionary<string, IContextListProperty>
NumberRanges
public IReadOnlyDictionary<string, UIValueNumberRange> NumberRanges { get; }
Property Value
- IReadOnlyDictionary<string, UIValueNumberRange>
Properties
public IReadOnlyDictionary<string, IProperty> Properties { get; }
Property Value
- IReadOnlyDictionary<string, IProperty>
PropertyCount
public int PropertyCount { get; }
Property Value
- int
StackActionCount
public int StackActionCount { get; }
Property Value
- int
StackListCount
public int StackListCount { get; }
Property Value
- int
StackPropertyCount
public int StackPropertyCount { get; }
Property Value
- int
StackSubContextCount
public int StackSubContextCount { get; }
Property Value
- int
SubContextCount
public int SubContextCount { get; }
Property Value
- int
SubContexts
public IReadOnlyDictionary<string, IDataContextReadonly> SubContexts { get; }
Property Value
- IReadOnlyDictionary<string, IDataContextReadonly>
ToStringDelegates
public IReadOnlyDictionary<string, ToStringDelegate> ToStringDelegates { get; }
Property Value
- IReadOnlyDictionary<string, ToStringDelegate>
Methods
AddAction(string, IAction)
public void AddAction(string key, IAction action)
Parameters
key string
action IAction
AddActionInternal(string, IAction, bool)
public void AddActionInternal(string key, IAction action, bool fireEvent)
Parameters
key string
action IAction
fireEvent bool
AddList(string, IContextListProperty)
public void AddList(string key, IContextListProperty list)
Parameters
key string
list IContextListProperty
AddListInternal(string, IContextListProperty, bool)
public void AddListInternal(string key, IContextListProperty list, bool fireEvent)
Parameters
key string
list IContextListProperty
fireEvent bool
AddProperty(string, IProperty)
public void AddProperty(string key, IProperty property)
Parameters
key string
property IProperty
AddPropertyInternal(string, IProperty, bool)
public void AddPropertyInternal(string key, IProperty property, bool fireEvent)
Parameters
key string
property IProperty
fireEvent bool
AddSubContext(string, IDataContextReadonly)
public void AddSubContext(string key, IDataContextReadonly subContext)
Parameters
key string
subContext IDataContextReadonly
AddSubContextInternal(string, IDataContextReadonly, bool)
public void AddSubContextInternal(string key, IDataContextReadonly subContext, bool fireEvent)
Parameters
key string
subContext IDataContextReadonly
fireEvent bool
ClearAllData()
public void ClearAllData()
ClearLabel(string)
public void ClearLabel(string key)
Parameters
key string
ClearNumberRange(string)
public void ClearNumberRange(string key)
Parameters
key string
ClearToStringDelegate(string)
public void ClearToStringDelegate(string key)
Parameters
key string
Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing bool
ExtendStack()
public DataContext ExtendStack()
Returns
- DataContext
GetActionKeys(ISet<string>, bool)
public void GetActionKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetDebugHierarchyChain()
public string GetDebugHierarchyChain()
Returns
- string
GetDebugName()
public string GetDebugName()
Returns
- string
GetDebugStackChain()
public string GetDebugStackChain()
Returns
- string
GetHierarchyParent(bool)
public IDataContextReadonly GetHierarchyParent(bool searchStack = true)
Parameters
searchStack bool
Returns
- IDataContextReadonly
GetLabelKeys(ISet<string>, bool)
public void GetLabelKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetListKeys(ISet<string>, bool)
public void GetListKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetNumberRangeKeys(ISet<string>, bool)
public void GetNumberRangeKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetPropertyKeys(ISet<string>, bool)
public void GetPropertyKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetStackParent()
public IDataContextReadonly GetStackParent()
Returns
- IDataContextReadonly
GetSubContextKeys(ISet<string>, bool)
public void GetSubContextKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
GetToStringDelegateKeys(ISet<string>, bool)
public void GetToStringDelegateKeys(ISet<string> target, bool searchStack = true)
Parameters
target ISet<string>
searchStack bool
InvokeContextChanged()
public void InvokeContextChanged()
InvokeContextMetadataChanged()
public void InvokeContextMetadataChanged()
IsPathAbsolute(string)
public static bool IsPathAbsolute(string path)
Parameters
path string
Returns
- bool
ParsePath(string)
public static string[] ParsePath(string path)
Parameters
path string
Returns
- string[]
RemoveAction(string)
public void RemoveAction(string key)
Parameters
key string
RemoveActionInternal(string, bool)
public void RemoveActionInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveLabelInternal(string, bool)
public void RemoveLabelInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveList(string)
public void RemoveList(string key)
Parameters
key string
RemoveListInternal(string, bool)
public void RemoveListInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveNumberRangeInternal(string, bool)
public void RemoveNumberRangeInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveProperty(string)
public void RemoveProperty(string key)
Parameters
key string
RemovePropertyInternal(string, bool)
public void RemovePropertyInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveSubContext(string)
public void RemoveSubContext(string key)
Parameters
key string
RemoveSubContextInternal(string, bool)
public void RemoveSubContextInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
RemoveToStringDelegateInternal(string, bool)
public void RemoveToStringDelegateInternal(string key, bool fireEvent)
Parameters
key string
fireEvent bool
SetDebugName(string)
public void SetDebugName(string debugName)
Parameters
debugName string
SetHierarchyParent(IDataContextReadonly, bool)
public void SetHierarchyParent(IDataContextReadonly newHierarchyParent, bool fireEvent = true)
Parameters
newHierarchyParent IDataContextReadonly
fireEvent bool
SetLabel(string, string)
public void SetLabel(string key, string label)
Parameters
key string
label string
SetLabelInternal(string, string, bool)
public void SetLabelInternal(string key, string label, bool fireEvent)
Parameters
key string
label string
fireEvent bool
SetNumberRange(string, UIValueNumberRange)
public void SetNumberRange(string key, UIValueNumberRange numberRange)
Parameters
key string
numberRange UIValueNumberRange
SetNumberRange(string, double, double)
public void SetNumberRange(string key, double min, double max)
Parameters
key string
min double
max double
SetNumberRange(string, double, double, double)
public void SetNumberRange(string key, double min, double max, double step)
Parameters
key string
min double
max double
step double
SetNumberRangeInternal(string, UIValueNumberRange, bool)
public void SetNumberRangeInternal(string key, UIValueNumberRange numberRange, bool fireEvent)
Parameters
key string
numberRange UIValueNumberRange
fireEvent bool
SetStackParent(IDataContextReadonly, bool)
public void SetStackParent(IDataContextReadonly newParent, bool fireEvent)
Parameters
newParent IDataContextReadonly
fireEvent bool
SetToStringDelegate(string, ToStringDelegate)
public void SetToStringDelegate(string key, ToStringDelegate toStringDelegate)
Parameters
key string
toStringDelegate ToStringDelegate
SetToStringDelegateInternal(string, ToStringDelegate, bool)
public void SetToStringDelegateInternal(string key, ToStringDelegate toStringDelegate, bool fireEvent)
Parameters
key string
toStringDelegate ToStringDelegate
fireEvent bool
TryResolveAction(string, out IAction, bool)
public virtual bool TryResolveAction(string keyPath, out IAction action, bool searchStack = true)
Parameters
keyPath string
action IAction
searchStack bool
Returns
- bool
TryResolveLabel(string, out string, bool)
public virtual bool TryResolveLabel(string keyPath, out string label, bool searchStack = true)
Parameters
keyPath string
label string
searchStack bool
Returns
- bool
TryResolveList(string, out IContextListProperty, bool)
public virtual bool TryResolveList(string keyPath, out IContextListProperty list, bool searchStack = true)
Parameters
keyPath string
list IContextListProperty
searchStack bool
Returns
- bool
TryResolveNumberRange(string, out UIValueNumberRange, bool)
public virtual bool TryResolveNumberRange(string keyPath, out UIValueNumberRange numberRange, bool searchStack = true)
Parameters
keyPath string
numberRange UIValueNumberRange
searchStack bool
Returns
- bool
TryResolvePathHierarchy(string, out IDataContextReadonly, out string)
public virtual bool TryResolvePathHierarchy(string keyPath, out IDataContextReadonly hierarchyContext, out string keyLocal)
Parameters
keyPath string
hierarchyContext IDataContextReadonly
keyLocal string
Returns
- bool
TryResolveProperty(string, out IProperty, bool)
public virtual bool TryResolveProperty(string keyPath, out IProperty property, bool searchStack = true)
Parameters
keyPath string
property IProperty
searchStack bool
Returns
- bool
TryResolveSubContext(string, out IDataContextReadonly, bool, bool)
public virtual bool TryResolveSubContext(string keyPath, out IDataContextReadonly subContext, bool searchStack = true, bool wrapStackResult = true)
Parameters
keyPath string
subContext IDataContextReadonly
searchStack bool
wrapStackResult bool
Returns
- bool
TryResolveToStringDelegate(string, out ToStringDelegate, bool)
public virtual bool TryResolveToStringDelegate(string keyPath, out ToStringDelegate toStringDelegate, bool searchStack = true)
Parameters
keyPath string
toStringDelegate ToStringDelegate
searchStack bool
Returns
- bool
Events
ContextChanged
public event Action<IDataContextReadonly> ContextChanged
Event Type
- Action<IDataContextReadonly>
ContextMetadataChanged
public event Action<IDataContextReadonly> ContextMetadataChanged
Event Type
- Action<IDataContextReadonly>