public override void OnSave(ConfigNode node) { ConfigNode contextNode = new ConfigNode("context"); // Save variables if (Variables.Count > 0) { ConfigNode varNode = new ConfigNode("variables"); foreach (var kvp in Variables) { if (!(kvp.Value is BoundVariable)) { varNode.AddValue(kvp.Key, File.EncodeLine(kvp.Value.Value.ToString())); } } contextNode.AddNode(varNode); } if (ChildContext != null) { ChildContext.OnSave(contextNode); } node.AddNode(contextNode); }
public virtual bool Type(char c) { if (ChildContext != null) { return(ChildContext.Type(c)); } return(false); }
public virtual bool SpecialKey(kOSKeys key) { if (ChildContext != null) { return(ChildContext.SpecialKey(key)); } return(false); }
public override void Initialize(TElement[] elements) { if (ChildContext != null) { ChildContext.Initialize(elements); } _keys = new TKey[elements.Length]; for (var i = 0; i < _keys.Length; i++) { _keys[i] = _selector(elements[i]); } }
public virtual void OnSave(ConfigNode node) { var contextNode = new ConfigNode("context"); contextNode.AddValue("context-type", GetType().ToString()); if (ChildContext != null) { ChildContext.OnSave(contextNode); } node.AddNode(contextNode); }
//[ConfigureAwait(false)] internal override async Task Initialize(TElement[] elements) { if (ChildContext != null) { await ChildContext.Initialize(elements).ConfigureAwait(false); } keys = new TKey[elements.Length]; for (var i = 0; i < keys.Length; i++) { keys[i] = await keySelector(elements[i]).ConfigureAwait(false); } }
public override int Compare(int firstIndex, int secondIndex) { var comparison = _comparer.Compare(_keys[firstIndex], _keys[secondIndex]); if (comparison == 0) { if (ChildContext != null) { return(ChildContext.Compare(firstIndex, secondIndex)); } comparison = Direction == SortDirection.Descending ? secondIndex - firstIndex : firstIndex - secondIndex; } return(Direction == SortDirection.Descending ? -comparison : comparison); }
internal override int Compare(int firstIndex, int secondIndex) { int comparison = comparer.Compare(keys[firstIndex], keys[secondIndex]); if (comparison == 0) { if (ChildContext != null) { return(ChildContext.Compare(firstIndex, secondIndex)); } comparison = descending ? secondIndex - firstIndex : firstIndex - secondIndex; } return(descending ? -comparison : comparison); }
public virtual IContext GetContext() { var context = _contextLifetimeManager.Find(DefaultContextKey) as IContext; if (context == null) { context = new TopContext(); _contextLifetimeManager.Store(DefaultContextKey, context); _logger.Debug("Top context created and stored."); } else { context = new ChildContext(context); _logger.Debug("Child context created."); } return(context); }
public virtual IContext GetContext() { var context = _contextLifetimeManager.Find(DefaultContextKey) as IContext; if (context == null) { context = new TopContext(); _contextLifetimeManager.Store(DefaultContextKey, context); _logger.Debug("Top context created and stored."); } else { context = new ChildContext(context); _logger.Debug("Child context created."); } return context; }
public virtual void Update(float time) { // Process Command locks foreach (var command in new List <ICommand>(CommandLocks)) { command.Update(time); } if (ChildContext != null) { if (ChildContext.State == ExecutionState.DONE) { ChildContext = null; } else { ChildContext.Update(time); } } }
public ConfirmationModel(ChildContext context) { _context = context; }
public override int GetCursorX() { return(ChildContext != null?ChildContext.GetCursorX() : cursorX); }
public ListChildModel(ChildContext context) { _context = context; }
public DeleteChildModel(ChildContext db) { _db = db; }
public ThankYouModel(ChildContext db) { _db = db; }
public virtual int GetCursorY() { return(ChildContext != null?ChildContext.GetCursorY() : -1); }
public EditChildModel(ChildContext db) { _db = db; }
public CreateApplicationModel(ChildContext db) { _db = db; }
public IExecutionContext GetDeepestChildContext() { return(ChildContext == null ? this : ChildContext.GetDeepestChildContext()); }
public CreateChildModel(ChildContext db) { _db = db; }
public override int GetCursorY() { return(ChildContext != null?ChildContext.GetCursorY() : CursorY); }
public ChildrenController(ChildContext context) { _context = context; }
public bool KeyInput(char c) { return(ChildContext != null?ChildContext.Type(c) : Type(c)); }
public ChildController(ChildContext context, ILogger <ChildController> logger) { _context = context; _logger = logger; }
public override char[,] GetBuffer() { var childBuffer = (ChildContext != null) ? ChildContext.GetBuffer() : null; return(childBuffer != null ? childBuffer : buffer); }
public virtual char[,] GetBuffer() { return((ChildContext != null) ? ChildContext.GetBuffer() : null); }
public SearchApplicationModel(ChildContext db) { _db = db; }
public ListChildrenModel(ChildContext db) { _db = db; }